def test_searchcustomerbyname(self, setUp): self.logger.info("SearchCustomer") self.driver = setUp self.driver.get(self.baseURL) self.driver.maximize_window() self.lp = LoginPage(self.driver) self.lp.setUserName(self.username) self.lp.setPassword(self.password) self.lp.clickLogin() self.logger.info("Login successful") self.logger.info("Search Customer by Email") self.addcust = AddCustomer(self.driver) self.addcust.clickOnCustomersMenu() self.addcust.clickOnCustomerMenuItem() searchcust = SearchCustomer(self.driver) searchcust.setFirstName("james") searchcust.setLastName("pan") searchcust.clickSearch() time.sleep(5) status = searchcust.searchCustomerbyName("James Pan") assert True == status self.logger.info("End of search customer by name test case ") self.driver.close()
def test_searchCustomerByName(self): self.logger.info("************* SearchCustomerByName_005 **********") self.driver = webdriver.Chrome( executable_path=".\\venv\\chromedriver_win32\\chromedriver") self.driver.get(self.baseURl) self.driver.maximize_window() self.lp = LoginPage(self.driver) self.lp.setUserName(self.userName) self.lp.setPassword(self.password) self.lp.clickLogin() self.logger.info("************* Login succesful **********") self.logger.info("******* Starting Search Customer By Name **********") self.addcust = AddCustomer(self.driver) self.addcust.clickOnCustomersMenu() self.addcust.clickOnCustomersMenuItem() time.sleep(2) self.logger.info("************* searching customer by Name **********") searchcust = SearchCustomer(self.driver) searchcust.setFirstName("Victoria") searchcust.setLastName("Terces") searchcust.clickSearch() time.sleep(5) status = searchcust.searchCustomerByName("Victoria Terces") self.driver.close() assert True == status self.logger.info( "*************** TC_SearchCustomerByName_005 Finished *********** " )
def test_searchCustomerByEmail(self, setup): self.logger.info("************* SearchCustomerByEmail_004 **********") self.driver = setup self.driver.get(self.baseURL) self.driver.maximize_window() self.lp = Loginpage(self.driver) self.lp.setusername(self.username) self.lp.setpassword(self.password) self.lp.login() self.logger.info("************* Login succesful **********") self.logger.info( "******* Starting Search Customer By Email **********") self.addcust = AddCustomer(self.driver) self.addcust.clickOnCustomersMenu() self.addcust.clickOnCustomersMenuItem() self.logger.info( "************* searching customer by emailID **********") self.searchcust = SearchCust(self.driver) self.searchcust.setEmail("*****@*****.**") self.searchcust.clickSearch() time.sleep(5) status = self.searchcust.searchCustomerByEmail( "*****@*****.**") self.driver.close() assert True == status self.logger.info( "*************** TC_SearchCustomerByEmail_004 Finished *********** " )
class Test_004_SearchcustomerbyEmail: baseURL = ReadConfig.getApplicationURL() username = ReadConfig.getUserEmail() password = ReadConfig.getPassword() logger = LogGen.loggen() @pytest.mark.regression def test_searchcustomerbyemail(self, setUp): self.logger.info("SearchCustomer") self.driver = setUp self.driver.get(self.baseURL) self.driver.maximize_window() self.lp = LoginPage(self.driver) self.lp.setUserName(self.username) self.lp.setPassword(self.password) self.lp.clickLogin() self.logger.info("Login successful") self.logger.info("Search Customer by Email") self.addcust = AddCustomer(self.driver) self.addcust.clickOnCustomersMenu() self.addcust.clickOnCustomerMenuItem() searchcust = SearchCustomer(self.driver) searchcust.setEmail("*****@*****.**") searchcust.clickSearch() time.sleep(5) status = searchcust.searchCustomerByEmail("*****@*****.**") assert True == status self.logger.info("End of search customer by email test case ") self.driver.close()
def test_searchCustomerByEmail(self): self.logger.info("************* SearchCustomerByEmail_004 **********") self.driver = webdriver.Chrome( executable_path=".\\venv\\chromedriver_win32\\chromedriver") self.driver.get(self.baseURl) self.driver.maximize_window() self.lp = LoginPage(self.driver) self.lp.setUserName(self.userName) self.lp.setPassword(self.password) self.lp.clickLogin() self.logger.info("************* Login succesful **********") self.logger.info( "******* Starting Search Customer By Email **********") self.addcust = AddCustomer(self.driver) self.addcust.clickOnCustomersMenu() self.addcust.clickOnCustomersMenuItem() self.logger.info( "************* searching customer by emailID **********") searchcust = SearchCustomer(self.driver) searchcust.setEmail("*****@*****.**") searchcust.clickSearch() time.sleep(5) status = searchcust.searchCustomerByEmail( "*****@*****.**") self.driver.close() assert True == status self.logger.info( "*************** TC_SearchCustomerByEmail_004 Finished *********** " )
def test_searchCustomerByName(self, setup): self.logger.info("************* SearchCustomerByName_005 **********") self.driver = setup self.driver.get(self.baseURL) self.driver.maximize_window() self.lp = Loginpage(self.driver) self.lp.setusername(self.username) self.lp.setpassword(self.password) self.lp.login() self.logger.info("************* Login succesful **********") self.logger.info("******* Starting Search Customer By Name **********") self.addcust = AddCustomer(self.driver) self.addcust.clickOnCustomersMenu() self.addcust.clickOnCustomersMenuItem() time.sleep(2) self.logger.info("************* searching customer by Name **********") searchcust = SearchCust(self.driver) searchcust.setFirstname("Victoria") searchcust.setLastName("Terces") searchcust.clickSearch() time.sleep(5) status = searchcust.searchbyname("Victoria Terces") self.driver.close() assert True == status self.logger.info( "*************** TC_SearchCustomerByName_005 Finished *********** " )
def test_addCustomer(self): self.logger.info("************* Test_003_AddCustomer **********") self.driver = webdriver.Chrome( executable_path=".\\venv\\chromedriver_win32\\chromedriver") self.driver.get(self.baseURl) self.driver.maximize_window() self.lp = LoginPage(self.driver) self.lp.setUserName(self.userName) self.lp.setPassword(self.password) self.lp.clickLogin() self.logger.info("************* Login succesful **********") self.logger.info("******* Starting Add Customer Test **********") self.addcust = AddCustomer(self.driver) self.addcust.clickOnCustomersMenu() self.addcust.clickOnCustomersMenuItem() self.addcust.clickOnAddnew() self.logger.info("************* Providing customer info **********") self.email = random_generator() + "@gmail.com" self.addcust.setEmail(self.email) self.addcust.setPassword("test123") self.addcust.setCustomerRoles("Guests") self.addcust.setManagerOfVendor("Vendor 2") self.addcust.setGender("Male") self.addcust.setFirstName("Pavan") self.addcust.setLastName("Kumar") self.addcust.setDob("7/05/1985") # Format: D / MM / YYY self.addcust.setCompanyName("busyQA") self.addcust.setAdminContent("This is for testing.........") self.addcust.clickOnSave() self.logger.info("************* Saving customer info **********") self.logger.info( "********* Add customer validation started *****************") self.msg = self.driver.find_element_by_tag_name("body").text # print(self.msg) if 'The new customer has been added successfully.' in self.msg: assert True self.logger.info("********* Add customer Test Passed *********") else: self.driver.save_screenshot( ".\\Screenshots\\" + "test_addCustomer_scr.png") # Screenshot self.logger.error( "********* Add customer Test Failed ************") assert False self.driver.close() self.logger.info("******* Ending Add customer test **********")
def test_addcustomer(self, setUp): self.logger.info("Test_003_AddCustomer") self.driver = setUp self.driver.get(self.baseURL) self.driver.maximize_window() self.lp = LoginPage(self.driver) self.lp.setUserName(self.username) self.lp.setPassword(self.password) self.lp.clickLogin() self.logger.info("Login successful") self.logger.info("starting add customer page") self.addcust = AddCustomer(self.driver) self.addcust.clickOnCustomersMenu() self.addcust.clickOnCustomerMenuItem() self.addcust.clickOnAddNew() self.logger.info("providing customer info") self.email = random_generator() + "@gmail.com" self.addcust.setUserEmail(self.email) self.addcust.setPassword("test123") self.addcust.setFirstName("Divya") self.addcust.setLastName("Khosla") self.addcust.setDOB("09/03/1988") self.addcust.setCustomerRoles("Guests") self.addcust.setCompany("QABee") self.addcust.setGender("Female") self.addcust.selectVendorManager("Vendor 2") self.addcust.setAdminComment("this is for testing add customer module") self.addcust.clickOnSave() self.logger.info("Save customer info") self.logger.info("Validating the data") self.msg = self.driver.find_element_by_tag_name("body").text print(self.msg) if 'customer has been added successfully.' in self.msg: assert True == True self.logger.info("Customer test passed") else: self.driver.save_screenshot( "C:\\Users\\gladi\\PycharmProjects\\SeleniumHybridFrameworkPytest\\Screenshots\\" + "test_addCustomer_scr.png") self.logger.info("add customer test failed") assert True == False self.driver.close() self.logger.info("End of add customer page")
class Test_003_AddCustomer: baseURL = readConfig.getappurl() username = readConfig.getuserid() password = readConfig.getuserpwd() logger = Loggen.loggen() @pytest.mark.sanity def test_addCustomer(self, setup): self.logger.info("************* Test_003_AddCustomer **********") self.driver = setup self.driver.get(self.baseURL) self.driver.maximize_window() self.lp = Loginpage(self.driver) self.lp.setusername(self.username) self.lp.setpassword(self.password) self.lp.login() self.logger.info("************* Login succesful **********") self.logger.info("******* Starting Add Customer Test **********") self.addcust = AddCustomer(self.driver) self.addcust.clickOnCustomersMenu() self.addcust.clickOnCustomersMenuItem() self.addcust.clickOnAddnew() self.logger.info("************* Providing customer info **********") self.email = random_generator() + "@gmail.com" self.addcust.setEmail(self.email) self.addcust.setPassword("test123") self.addcust.setCustomerRoles("Guests") self.addcust.setManagerOfVendor("Vendor 2") self.addcust.setGender("Male") self.addcust.setFirstName("Pavan") self.addcust.setLastName("Kumar") self.addcust.setDob("7/05/1985") # Format: D / MM / YYY self.addcust.setCompanyName("busyQA") self.addcust.setAdminContent("This is for testing.........") self.addcust.clickOnSave() self.logger.info("************* Saving customer info **********") self.logger.info( "********* Add customer validation started *****************") self.msg = self.driver.find_element_by_tag_name("body").text print(self.msg) if 'customer has been added successfully.' in self.msg: assert True self.logger.info("********* Add customer Test Passed *********") else: self.driver.save_screenshot( ".\\Screenshots\\" + "test_addCustomer_scr.png") # Screenshot self.logger.error( "********* Add customer Test Failed ************") assert False self.driver.close() self.logger.info("******* Ending Add customer test **********")