Skip to content

Commit

Permalink
17 commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhi-Cool-karni committed Jul 29, 2023
1 parent 1a07633 commit e987e74
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 7 deletions.
35 changes: 35 additions & 0 deletions PythonSelFramework/PageObjectMechanism/HomePage.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,38 @@ def shopItems(self):
checkoutPage = CheckoutPage(self.driver)
return checkoutPage
# self.driver.find_element(By.CSS_SELECTOR, "a[href*='shop']")

# Homepage data
name = (By.CSS_SELECTOR, "input[name='name']")
inlineRadio = (By.CSS_SELECTOR, "#inlineRadio1")
email = (By.NAME, "email")
password = (By.ID, "exampleInputPassword1")
checkbox = (By.ID, "exampleCheck1")
dropDown = (By.ID, "exampleFormControlSelect1")
radio = (By.CSS_SELECTOR, "#inlineRadio1")
submit = (By.XPATH, "//input[@type='submit']")
message = (By.CLASS_NAME, "alert-success")

def getName(self):
return self.driver.find_element(*HomePage.name)

def getEmail(self):
return self.driver.find_element(*HomePage.email)

def getPassword(self):
return self.driver.find_element(*HomePage.password)

def getCheckbox(self):
return self.driver.find_element(*HomePage.checkbox)

def selectDropdown(self):
return self.driver.find_element(*HomePage.dropDown)

def ClickRadio(self):
return self.driver.find_element(*HomePage.radio)

def clickSubmit(self):
return self.driver.find_element(*HomePage.submit)

def getSuccess(self):
return self.driver.find_element(*HomePage.message).text
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ Selenium Python Framework Implementation from scratch:
• Passing Command Line options to select browser at run time. (DONE)
• Implementing Page object Mechanism. (DONE)
• Smarter way of returning Page objects from Navigation Methods. (DONE)
• Creating Selenium WebDriver Custom Utilities in Base class.
• Creating Selenium WebDriver Custom Utilities in Base class. (DONE)
• Parameterizing WebDriver tests with Multiple Data sets.
• Organizing Data from Separate Data files and injecting into fixture at run time.
• Implementing Logging feature to WebDriver tests.
• Text Execution Html Reporting.
• Automatic Screenshot Capture on Test failures.
• Integrating Selenium Python Framework to Jenkins CI tool with Jenkins build Parameterization.
• GitHub Basics for Project version control.
• GitHub Basics for Project version control.
6 changes: 5 additions & 1 deletion PythonSelFramework/Utility/BaseClass.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait

from selenium.webdriver.support.select import Select

@pytest.mark.usefixtures("setup")
class baseClass:

def verifyLinktextPresence(self, text):
wait = WebDriverWait(self.driver, 10)
wait.until(expected_conditions.presence_of_element_located((By.LINK_TEXT, text)))

def selectOptioByText(self, locator, text):
dropdown = Select(locator)
dropdown.select_by_visible_text(text)
Binary file modified PythonSelFramework/Utility/__pycache__/BaseClass.cpython-311.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
22 changes: 22 additions & 0 deletions PythonSelFramework/tests/test_anugularPractice.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from selenium import webdriver
from selenium.webdriver.common.by import By

from PageObjectMechanism.HomePage import HomePage
from Utility.BaseClass import baseClass


class TestHomePage(baseClass):

def test_FormSubmission(self):

homepage = HomePage(self.driver)
homepage.getName().send_keys('Abhishek') #NAME
homepage.getEmail().send_keys("[email protected]") #EMAIL
homepage.getPassword().send_keys("abhishek@1234") #PASSWORD
homepage.getCheckbox().click() #CHECKBOX
self.selectOptioByText(homepage.selectDropdown(), "Female") #GENDER SELECTION
homepage.ClickRadio().click() #Employment Status
homepage.clickSubmit().click() #Submit button
message = homepage.getSuccess()
print(message)
assert "Success" in message
4 changes: 0 additions & 4 deletions PythonSelFramework/tests/test_e2e.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions
from Utility.BaseClass import baseClass
from PageObjectMechanism.ConfirmPage import ConfirmPage
from PageObjectMechanism.CheckoutPage import CheckoutPage
from PageObjectMechanism.HomePage import HomePage


Expand Down

0 comments on commit e987e74

Please sign in to comment.