def test_login(self, setup): self.logger.info("********** Verifying Login test ***********") self.driver = setup self.driver.get(self.baseURL) # now need to create object of ba # se class (means we call the Login) self.lp = Login(self.driver) self.lp.setusername(self.username) self.lp.setpassword(self.password) self.lp.clicklogin() act_title = self.driver.title if act_title == "Dashboard / nopCommerce administration13": assert True self.driver.close() self.logger.info("****** Login test is passed ******") else: # self.driver.save_screenshot(".\\Screenshots\\" + "test_login.png") allure.attach(self.driver.get_screenshot_as_png(), name="testloginpage", attachment_type=AttachmentType.PNG) self.driver.close() self.logger.error("********* Login test is failed **********") assert False
def test_Login(self, setup): self.logger.info("*********** Test_001_Login ***********") self.logger.info("*********** Verifying Login Title ***********") self.driver = setup self.driver.get(self.baseURL) self.lp = Login(self.driver) self.lp.setUserName(self.username) self.lp.setPassword(self.password) self.lp.clickLogin() act_title = self.driver.title if act_title == "Dashboard / nopCommerce administration": self.logger.info( "*********** Login Title test is passed ***********") self.driver.close() assert True else: self.driver.save_screenshot( "C:\\Users\\durve\\PycharmProjects\\PytestFramework\\Screenshots\\" + "test_Login.png") self.logger.error( "*********** Login Title test is failed ***********") self.driver.close() assert False
def test_searchCustomerByEmail(self,setup): self.logger.info("************* SearchCustomerByEmail_004 **********") self.driver=setup self.driver.get(self.baseURL) self.driver.maximize_window() self.lp = Login(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_logout(self, setup): self.driver = setup self.driver.get(self.base_url) self.driver.maximize_window() self.lp = Login(self.driver) self.lp.set_Username(self.username) time.sleep(1) self.lp.click_next_btn() time.sleep(1) self.lp.set_password(self.Password) time.sleep(1) self.lp.click_signin_btn() time.sleep(1) self.lp.click_confirm_btn() time.sleep(1) print("Login is successfully completed") dashboard_text = self.lp.capture_text() print(dashboard_text) title = self.driver.title print(title) self.lp.click_user_profile() time.sleep(1) self.lp.logout_user() time.sleep(3) self.logger.info( "############ User is successfully logged out ########### ") print("User is logged out")
def test_searchCustomerByName(self, setup): self.logger.info("************* SearchCustomerByName_005 **********") self.driver = setup self.driver.get(self.baseURL) self.driver.maximize_window() self.lp = Login(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 *********** " )
class Test_002_DDT_Login: path = "C:\\Users\\durve\\PycharmProjects\\PytestFramework\\TestData\\LoginData.xlsx" baseURL = ReadConfig.getApplicationURL() logger = LogGen.loggens() @pytest.mark.regression def test_Login_DDT(self, setup): self.logger.info("*********** Test_002_DDT_Login ***********") self.logger.info("*********** Verifying Login Title ***********") self.driver = setup self.driver.get(self.baseURL) self.lp = Login(self.driver) self.rows = XLUtils.getRowCount(self.path,"Sheet1") print("Number of rows in excel:", self.rows) lst_status = [] # Empty ist variable for r in range(2,self.rows + 1): self.username = XLUtils.readData(self.path,"Sheet1",r,1) self.password = XLUtils.readData(self.path, "Sheet1", r, 2) self.expected = XLUtils.readData(self.path, "Sheet1", r, 3) self.lp.setUserName(self.username) self.lp.setPassword(self.password) self.lp.clickLogin() time.sleep(5) act_title = self.driver.title exp_title = "Dashboard / nopCommerce administration" if act_title == exp_title: if self.expected == "Pass": self.logger.info("*********** Login Title test is passed ***********") self.lp.clickLogout() lst_status.append("Pass") else: self.driver.save_screenshot("C:\\Users\\durve\\PycharmProjects\\PytestFramework\\Screenshots\\"+ "test_Login.png") self.logger.error("*********** Login Title test is failed ***********") lst_status.append("Fail") self.lp.clickLogout() else: if self.expected == "Fail": self.logger.info("*********** Login Title test is passed ***********") lst_status.append("Pass") else: self.driver.save_screenshot("C:\\Users\\durve\\PycharmProjects\\PytestFramework\\Screenshots\\"+ "test_Login.png") self.logger.error("*********** Login Title test is failed ***********") lst_status.append("Fail") if "Fail" not in lst_status: self.logger.error("*********** Test Login DDT testcase is passed ***********") self.driver.close() assert True else: self.logger.error("*********** Test Login DDT testcase is failed ***********") self.driver.close() assert False self.logger.info("************End of Login Test CAse DDT**************") self.logger.info('**************Completed TC_LoginDDT_002**************')
def test_addcustomer(self, setup): self.logger.info("*********Test_003_AddCustomer ************") self.driver = setup self.driver.get(self.baseURL) self.lp = Login(self.driver) self.lp.setusername(self.username) self.lp.setpassword(self.password) self.lp.clicklogin() self.logger.info("*****Login Successfull***********") 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.setFirstName("Ayushree") self.addcust.setLastName("Tagde") self.addcust.setGender("Female") self.addcust.setDob("7/05/1985") # Format: D / MM / YYY self.addcust.setCompanyName("busyQA") # self.addcust.setNewsletter("Test store 2") # newsletter is similar to roles, but not executed yet bcz of inc xpath # (will do later) self.addcust.setCustomerRoles("Guests") self.addcust.setManagerOfVendor("Vendor 2") 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 **********")
class Test_005_Form(): base_url = Readconfig.getApplicationURL() username = Readconfig.getUsername() Password = Readconfig.getPassword() logger = LogGen.loggen() formname = Readconfig.getFormname() template_form_description = Readconfig.getFormdescription() def test_createform(self,setup): self.logger.info("###### Executing Test_004_AssignSuccessor test case ########") self.logger.info("############ Setting up with the login test execution ########### ") self.driver = setup self.driver.get(self.base_url) self.driver.maximize_window() self.lp = Login(self.driver) self.lp.set_Username(self.username) time.sleep(1) self.lp.click_next_btn() time.sleep(2) self.lp.set_password(self.Password) time.sleep(1) self.lp.click_signin_btn() time.sleep(1) self.lp.click_confirm_btn() time.sleep(3) self.driver.get_screenshot_as_file(".\\Screenshoots\\login.png") self.logger.info("############ User is successfully logged in ########### ") print("Login is successfully completed") self.logger.info("###### Executing workflow script ######") self.form = CreateForm(self.driver) time.sleep(3) self.form.click_drop_down_menu() time.sleep(3) self.form.select_admin_from_the_drop_down_menu() time.sleep(3) self.form.click_breadcrumb_menu() time.sleep(3) self.form.click_form_management_menu() time.sleep(3) self.form.click_forms_button() time.sleep(3) self.form.click_add_form_button() time.sleep(2) self.form.enable_form_template_toggle() time.sleep(2) self.form.select_template_name("New hire") time.sleep(2) self.form.enter_form_name(self.formname) # self.driver.find_element_by_xpath("(//*[@id='name'])[2]").send_keys("RP-Starter form") time.sleep(2) # self.form.enter_descripton(self.template_form_description) # time.sleep(2) self.form.select_message_type("Hire") # select_message_type = Select(self.driver.find_element_by_xpath()) time.sleep(3) self.form.add_request_form() time.sleep(5)
def test_login_ddt(self, setup): self.logger.info("******* Starting Test_002_DDT_Login Test **********") self.logger.info("******* Starting Login DDT Test **********") self.driver = setup self.driver.get(self.baseURL) self.driver.maximize_window() self.lp = Login(self.driver) self.rows = ExcelUtils.getRowCount(self.path, 'Sheet1') print('Number of rows...', self.rows) lst_status = [] for r in range(2, self.rows + 1): self.user = ExcelUtils.readData(self.path, 'Sheet1', r, 1) self.password = ExcelUtils.readData(self.path, 'Sheet1', r, 2) self.exp = ExcelUtils.readData(self.path, 'Sheet1', r, 3) self.lp.setusername(self.user) self.lp.setpassword(self.password) time.sleep(3) self.lp.clicklogin() time.sleep(3) act_title = self.driver.title exp_title = "Dashboard / nopCommerce administration" if act_title == exp_title: if self.exp == 'Pass': self.logger.info("**** passed ****") self.lp.clicklogout() lst_status.append("Pass") elif self.exp == 'Fail': self.logger.info("**** failed ****") self.lp.clicklogout() lst_status.append("Fail") elif act_title != exp_title: if self.exp == 'Pass': self.logger.info("**** failed ****") lst_status.append("Fail") elif self.exp == 'Fail': self.logger.info("**** passed ****") lst_status.append("Pass") print(lst_status) if "Fail" not in lst_status: self.logger.info("******* DDT Login test passed **********") self.driver.close() assert True else: self.logger.error("******* DDT Login test failed **********") self.driver.close() assert False self.logger.info("******* End of Login DDT Test **********") self.logger.info( "**************** Completed TC_LoginDDT_002 ************* ")
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 = Login(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 'customer has been added successfully.' in self.msg: assert True self.logger.info("********* Add customer Test Passed *********") else: self.driver.save_screenshot("C:\\Users\\durve\\PycharmProjects\\PytestFramework\\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 **********")
class Test_002_CreateWorkflow: base_url = Readconfig.getApplicationURL() username = Readconfig.getUsername() Password = Readconfig.getPassword() workflow_name = Readconfig.getWorkflowName() workflow_description = Readconfig.getDescription() status_name = Readconfig.getStatus1() logger = LogGen.loggen() def test_createworkflow(self, setup): self.logger.info("############ Setting up with the login test execution ########### ") self.driver = setup self.driver.get(self.base_url) self.driver.maximize_window() self.lp = Login(self.driver) self.lp.set_Username(self.username) time.sleep(1) self.lp.click_next_btn() time.sleep(2) self.lp.set_password(self.Password) time.sleep(1) self.lp.click_signin_btn() time.sleep(1) self.lp.click_confirm_btn() time.sleep(3) self.driver.get_screenshot_as_file(".\\Screenshoots\\login.png") self.logger.info("############ User is successfully logged in ########### ") print("Login is successfully completed") self.logger.info("######### Creating WorkFlow #########") self.wf=CreateWorkflow(self.driver) time.sleep(1) self.wf.click_drop_down_menu() time.sleep(1) self.wf.select_admin_from_the_drop_down_menu() time.sleep(1) self.wf.click_breadcrumb_menu() time.sleep(1) self.wf.click_workflow_menu() time.sleep(1) self.wf.click_workflow_sub_menu() time.sleep(1) self.wf.click_new_button() time.sleep(2) self.wf.enter_workflow_name(self.workflow_name) time.sleep(1) self.wf.enter_workflow_description(self.workflow_description) time.sleep(1) self.wf.active_toggle() time.sleep(1) self.wf.add_workflow() time.sleep(3) self.logger.info("####### Workflow is created successfuly ########")
class Test_001_Login: baseURL = ReadConfig.getApplicationURL() username = ReadConfig.getApplicationUserName() password = ReadConfig.getApplicationPassword() logger = LogGen.loggens() @pytest.mark.regression def test_homepageTitle(self, setup): self.logger.info("*********** Test_001_Login ***********") self.logger.info("*********** Verifying Home Page Title ***********") self.driver = setup self.driver.get(self.baseURL) act_title = self.driver.title if act_title == "Your store. Login23": assert True self.logger.info( "*********** Home Page Title test is passed ***********") self.driver.close() else: self.driver.save_screenshot( "C:\\Users\\durve\\PycharmProjects\\PytestFramework\\Screenshots\\" + "test_homepageTitle.png") self.logger.error( "*********** Home Page Title test is failed ***********") self.driver.close() assert False @pytest.mark.sanity @pytest.mark.regression def test_Login(self, setup): self.logger.info("*********** Test_001_Login ***********") self.logger.info("*********** Verifying Login Title ***********") self.driver = setup self.driver.get(self.baseURL) self.lp = Login(self.driver) self.lp.setUserName(self.username) self.lp.setPassword(self.password) self.lp.clickLogin() act_title = self.driver.title if act_title == "Dashboard / nopCommerce administration": self.logger.info( "*********** Login Title test is passed ***********") self.driver.close() assert True else: self.driver.save_screenshot( "C:\\Users\\durve\\PycharmProjects\\PytestFramework\\Screenshots\\" + "test_Login.png") self.logger.error( "*********** Login Title test is failed ***********") self.driver.close() assert False
class Test_SearchCustomerByEmail_004: baseURL = ReadConfig.getApplicationURL() username = ReadConfig.getApplicationUserName() password = ReadConfig.getApplicationPassword() logger = LogGen.loggens() # Logger @pytest.mark.regression def test_searchCustomerByEmail(self, setup): self.logger.info("************* SearchCustomerByEmail_004 **********") self.driver = setup self.driver.get(self.baseURL) self.driver.maximize_window() self.lp = Login(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) time.sleep(5) if searchcust.ChkEmailObjExistence() == False: searchcust.ClickOnDropDown() searchcust.setEmail("*****@*****.**") searchcust.clickSearch() time.sleep(5) status = searchcust.searchCustomerByEmail( "*****@*****.**") self.driver.close() assert True == status self.logger.info( "*************** TC_SearchCustomerByEmail_004 Finished *********** " )
class Test_001_Login: baseURL = readconfig.getURL() username = readconfig.getuseremail() password = readconfig.getuserpassword() # baseURL = "https://admin-demo.nopcommerce.com" # username = "******" # password = "******" logger = LogGen.loggen() @pytest.mark.regression @allure.severity(allure.severity_level.MINOR) def test_homepageTitle(self, setup): self.logger.info("******** Test_001 Login ******") self.logger.info("******* Verifying home page title ********") # self.driver=webdriver.Chrome() self.driver = setup self.driver.get(self.baseURL) act_title = self.driver.title if act_title == "Your store. Login": assert True self.driver.close() self.logger.info( "********* home page title test is passed ********") else: allure.attach(self.driver.get_screenshot_as_png(), name="testhomepagetitle", attachment_type=AttachmentType.PNG) self.driver.close() self.logger.error("***** home page title test is failed ******") assert False @pytest.mark.sanity @pytest.mark.regression @allure.severity(allure.severity_level.BLOCKER) def test_login(self, setup): self.logger.info("********** Verifying Login test ***********") self.driver = setup self.driver.get(self.baseURL) # now need to create object of ba # se class (means we call the Login) self.lp = Login(self.driver) self.lp.setusername(self.username) self.lp.setpassword(self.password) self.lp.clicklogin() act_title = self.driver.title if act_title == "Dashboard / nopCommerce administration13": assert True self.driver.close() self.logger.info("****** Login test is passed ******") else: # self.driver.save_screenshot(".\\Screenshots\\" + "test_login.png") allure.attach(self.driver.get_screenshot_as_png(), name="testloginpage", attachment_type=AttachmentType.PNG) self.driver.close() self.logger.error("********* Login test is failed **********") assert False
def test_available_balance_and_Rent_balance(self): with nose.allure.step('Clicking on sign_in link'): # Defining sign_in link element and performing sign in link click action signin_link = Home(self.driver).getSignIn() signin_link.click() with nose.allure.step('Entering username'): # Defining username element and passing username value to it. username = Login(self.driver).getUsername() username_value = self.parser.get('login_credentials', 'username') username.send_keys(username_value) with nose.allure.step('Entering password'): # Defining password element and passing password value to it. password = Login(self.driver).getPassword() password_value = self.parser.get('login_credentials', 'password') password.send_keys(password_value) with nose.allure.step('Clicking on login button'): # Defining login button element and performing click action. login_btn = Login(self.driver).get_login_butn() login_btn.click() with nose.allure.step('Clicking on account details list box'): # Defining account details list element and performing click action on it. account_details_list = MyAccountPage( self.driver).getAccountDetailsList() account_details_list.click() with nose.allure.step('Selecting one account type'): # Defining account details option element and performing click action on it. account_details_select = MyAccountPage( self.driver).getAccountDetailsSelect() account_details_select.click() with nose.allure.step('Clicking on GO button'): # Defining account details submit button and performing click action on it account_details_submit_button = MyAccountPage( self.driver).getAccountDetailsSubmitButton() account_details_submit_button.click() with nose.allure.step('Getting available balance value'): # Defining available balance element and extracting amount from it. available_balance = AccountHistory( self.driver).getAvailableBalanceValue() available_balance_value = available_balance.text with nose.allure.step('Verifying available balance value'): # verifying available balance value is empty or not self.assertNotEqual(available_balance_value, "", msg="Available Balance value is empty") print(available_balance_value) with nose.allure.step('Verifying Rent balance'): # Defining rent amount and verifying rent balance value rent = AccountHistory(self.driver).getRentBalance() rent_balance_value = rent.text print("Rent value:", rent_balance_value)
class Test_001_Login: base_url = Readconfig.getApplicationURL() username = Readconfig.getUsername() Password = Readconfig.getPassword() logger = LogGen.loggen() def test_home(self, setup): self.logger.info( "############ Executing testcase TC_001_login ########### ") self.driver = setup self.driver.get(self.base_url) self.driver.maximize_window() title = self.driver.title print(title) print("Login page successfully launched") self.logger.info( "############ The browser is launched successfully ########### ") # @pytest.mark.regression def test_login(self): self.logger.info( "############ Setting up with the login test execution ########### " ) self.driver = webdriver.Chrome(ChromeDriverManager().install()) self.driver.get(self.base_url) self.driver.maximize_window() lp = Login(self.driver) lp.set_Username(self.username) time.sleep(1) lp.click_next_btn() time.sleep(1) lp.set_password(self.Password) time.sleep(1) lp.click_signin_btn() time.sleep(1) lp.click_confirm_btn() time.sleep(3) self.driver.get_screenshot_as_file(".\\Screenshoots\\login.png") self.logger.info( "############ User is successfully logged in ########### ") print("Login is successfully completed") def test_logout(self, setup): self.driver = setup self.driver.get(self.base_url) self.driver.maximize_window() self.lp = Login(self.driver) self.lp.set_Username(self.username) time.sleep(1) self.lp.click_next_btn() time.sleep(1) self.lp.set_password(self.Password) time.sleep(1) self.lp.click_signin_btn() time.sleep(1) self.lp.click_confirm_btn() time.sleep(1) print("Login is successfully completed") dashboard_text = self.lp.capture_text() print(dashboard_text) title = self.driver.title print(title) self.lp.click_user_profile() time.sleep(1) self.lp.logout_user() time.sleep(3) self.logger.info( "############ User is successfully logged out ########### ") print("User is logged out")
def test_successor(self, setup): self.logger.info( "###### Executing Test_004_AssignSuccessor test case ########") self.logger.info( "############ Setting up with the login test execution ########### " ) self.driver = setup self.driver.get(self.base_url) self.driver.maximize_window() self.lp = Login(self.driver) self.lp.set_Username(self.username) time.sleep(1) self.lp.click_next_btn() time.sleep(2) self.lp.set_password(self.Password) time.sleep(1) self.lp.click_signin_btn() time.sleep(1) self.lp.click_confirm_btn() time.sleep(3) self.driver.get_screenshot_as_file(".\\Screenshoots\\login.png") self.logger.info( "############ User is successfully logged in ########### ") print("Login is successfully completed") self.logger.info("###### Executing workflow script ######") self.wf = CreateWorkflow(self.driver) time.sleep(3) self.wf.click_drop_down_menu() time.sleep(3) self.wf.select_admin_from_the_drop_down_menu() time.sleep(3) self.wf.click_breadcrumb_menu() time.sleep(3) self.wf.click_workflow_menu() time.sleep(3) self.wf.click_workflow_sub_menu() time.sleep(3) self.driver.get_screenshot_as_file(".\\Screenshoots\\workflow.png") self.assignstatus = CreateStatus(self.driver) self.assignstatus.search_workflow_name(self.workflow_name) time.sleep(3) self.assignstatus.select_workflow() time.sleep(3) self.logger.info( "######## Assign successor to the created status ########") self.AS = SuccessorAssign(self.driver) self.AS.click_three_dot_icon_manager() time.sleep(1) self.AS.click_manager_successor_btn_three_dot_menu() time.sleep(2) self.logger.info( "###### Assign successor1 to the Manager status ######") self.AS.click_create_new_successor_btn() time.sleep(2) self.AS.assign_successor_to_status("Back to originator") time.sleep(1) self.AS.assign_next_status_to_successor("Review by originator") time.sleep(1) self.AS.click_add_successor_btn() time.sleep(3) self.logger.info( "###### Assign successor2 to the Manager status ######") self.AS.click_create_new_successor_btn() time.sleep(3) self.AS.assign_successor_to_status("Approve") time.sleep(3) self.AS.assign_next_status_to_successor("Approve") time.sleep(3) self.AS.click_add_successor_btn() time.sleep(3) self.logger.info( "###### Assign successor3 to the Manager status ######") self.AS.click_create_new_successor_btn() time.sleep(3) self.AS.assign_successor_to_status("Reject") time.sleep(3) self.AS.assign_next_status_to_successor("Reject") time.sleep(3) self.AS.click_add_successor_btn() self.driver.get_screenshot_as_file(".\\Screenshoots\\successor1.png") time.sleep(3) self.AS.click_back_button() self.logger.info("###### Navigate back to status page ######") self.logger.info( "###### Assign successor to the status Originator ######") time.sleep(3) self.AS.click_three_dot_icon_originator() time.sleep(3) self.AS.click_originator_successor_btn_three_dot_menu() time.sleep(3) self.AS.click_create_new_successor_btn() time.sleep(3) self.AS.assign_successor_to_status("Back to originator") time.sleep(3) self.AS.assign_next_status_to_successor("Review by manager") time.sleep(3) self.AS.click_add_successor_btn() time.sleep(2) self.driver.get_screenshot_as_file(".\\Screenshoots\\successor2.png") self.AS.click_back_button() time.sleep(2)
def test_statusassignment(self, setup): self.logger.info( "############ Setting up with the login test execution ########### " ) self.driver = setup self.driver.get(self.base_url) self.driver.maximize_window() self.lp = Login(self.driver) self.lp.set_Username(self.username) time.sleep(1) self.lp.click_next_btn() time.sleep(2) self.lp.set_password(self.Password) time.sleep(1) self.lp.click_signin_btn() time.sleep(1) self.lp.click_confirm_btn() time.sleep(3) self.driver.get_screenshot_as_file(".\\Screenshoots\\login.png") self.logger.info( "############ User is successfully logged in ########### ") print("Login is successfully completed") self.logger.info("######### Creating WorkFlow #########") self.wf = CreateWorkflow(self.driver) time.sleep(1) self.wf.click_drop_down_menu() time.sleep(1) self.wf.select_admin_from_the_drop_down_menu() time.sleep(1) self.wf.click_breadcrumb_menu() time.sleep(1) self.wf.click_workflow_menu() time.sleep(1) self.wf.click_workflow_sub_menu() time.sleep(1) self.driver.get_screenshot_as_file(".\\Screenshoots\\workflow.png") self.logger.info("####### Workflow is created successfuly ########") self.assignstatus = CreateStatus(self.driver) self.assignstatus.search_workflow_name(self.workflow_name) time.sleep(3) self.assignstatus.select_workflow() time.sleep(1) self.logger.info("####### Assign status in the workflow ########") self.assignstatus.click_add_new_status_btn() time.sleep(1) self.assignstatus.enter_status(self.status_name) time.sleep(1) self.logger.info( "####### Executing Test_003_StatusAssignment test case for status assignment" ) self.logger.info( "####### Assigning manager status1 to the workflow ########") self.assignstatus.select_assign_type("Manager") time.sleep(2) # self.assignstatus.select_fixed_value("Review") # time.sleep(2) self.assignstatus.enable_assignee_toggle() time.sleep(1) self.assignstatus.enable_originator_toggle() time.sleep(1) self.assignstatus.add_status() self.driver.get_screenshot_as_file(".\\Screenshoots\\.png") time.sleep(3) self.logger.info( "####### Assigning originator status2 to the workflow ########") self.assignstatus.click_add_new_status_btn() time.sleep(1) self.assignstatus.enter_status(self.status_name1) time.sleep(1) self.assignstatus.select_assign_type("Originator") time.sleep(2) self.assignstatus.select_fixed_value("Review") time.sleep(2) self.assignstatus.enable_assignee_toggle() time.sleep(1) self.assignstatus.enable_originator_toggle() time.sleep(1) self.assignstatus.add_status() self.driver.get_screenshot_as_file( ".\\Screenshots\\status_originator.png") time.sleep(3) self.logger.info( "####### Assigning manager status3 to the workflow ########") self.assignstatus.click_add_new_status_btn() time.sleep(1) self.assignstatus.enter_status(self.status_name2) time.sleep(1) self.assignstatus.select_assign_type("Manager") time.sleep(2) self.assignstatus.select_fixed_value("End approved") time.sleep(2) self.assignstatus.enable_assignee_toggle() time.sleep(1) self.assignstatus.enable_originator_toggle() time.sleep(1) self.assignstatus.add_status() self.driver.get_screenshot_as_file(".\\Screenshots\\manager2.png") time.sleep(3) self.logger.info( "####### Assigning manager status4 to the workflow ########") self.assignstatus.click_add_new_status_btn() time.sleep(1) self.assignstatus.enter_status(self.status_name3) time.sleep(1) self.assignstatus.select_assign_type("Manager") time.sleep(2) self.assignstatus.select_fixed_value("End rejected") time.sleep(2) self.assignstatus.enable_assignee_toggle() time.sleep(1) self.assignstatus.enable_originator_toggle() time.sleep(1) self.assignstatus.add_status() self.driver.get_screenshot_as_file(".\\Screenshots\\manager3.png") time.sleep(3) self.driver.get_screenshot_as_file( ".\\Screenshots\\assigned_status.png")
def test_creategroup(self, setup): self.logger.info( "###### Executing Test_004_AssignSuccessor test case ########") self.logger.info( "############ Setting up with the login test execution ########### " ) self.driver = setup self.driver.implicitly_wait(10) self.driver.get(self.base_url) time.sleep(2) self.driver.maximize_window() time.sleep(2) self.lp = Login(self.driver) time.sleep(2) self.lp.set_Username(self.username) time.sleep(2) self.lp.click_next_btn() time.sleep(2) self.lp.set_password(self.Password) time.sleep(2) self.lp.click_signin_btn() time.sleep(2) self.lp.click_confirm_btn() time.sleep(2) self.driver.get_screenshot_as_file(".\\Screenshoots\\login.png") self.logger.info( "############ User is successfully logged in ########### ") print("Login is successfully completed") self.logger.info("###### Executing workflow script ######") self.form = CreateForm(self.driver) time.sleep(2) self.form.click_drop_down_menu() time.sleep(2) self.form.select_admin_from_the_drop_down_menu() time.sleep(2) self.form.click_breadcrumb_menu() time.sleep(2) self.RG = RequestGroup(self.driver) self.logger.info( "######## Working on the request group creation ########") self.RG.click_request_group() time.sleep(2) self.RG.create_a_new_request_group() time.sleep(2) self.RG.enter_request_group_name(self.request_group) time.sleep(2) self.RG.enter_request_group_description(self.group_description) time.sleep(2) self.RG.click_enable_active_toggle() time.sleep(2) self.RG.click_add_button() time.sleep(2) self.logger.info( "######## The request group is added successfully ########") self.RG.search_request_group_name(self.request_group) time.sleep(3) self.RG.click_selected_request_group_name() time.sleep(3) self.RG.create_a_new_request_type() time.sleep(3) self.RG.enter_request_type_name(self.RequestType) time.sleep(2) self.RG.add_request_type_description(self.RequestType_Description) time.sleep(3) self.RG.select_workflow(self.workflow_name) time.sleep(3) self.RG.select_request_form(self.form_name) time.sleep(3) self.RG.add_request_type() time.sleep(5) self.logger.info( "######## A new request type is created successfully #########")
def test_login(self): self.logger.info( "############ Setting up with the login test execution ########### " ) self.driver = webdriver.Chrome(ChromeDriverManager().install()) self.driver.get(self.base_url) self.driver.maximize_window() lp = Login(self.driver) lp.set_Username(self.username) time.sleep(1) lp.click_next_btn() time.sleep(1) lp.set_password(self.Password) time.sleep(1) lp.click_signin_btn() time.sleep(1) lp.click_confirm_btn() time.sleep(3) self.driver.get_screenshot_as_file(".\\Screenshoots\\login.png") self.logger.info( "############ User is successfully logged in ########### ") print("Login is successfully completed")