def setup_class(self): '''用例执行前,启动浏览器,创建chrome实例''' driver = webdriver.Chrome() driver.maximize_window() # 实例化页面 self.lg = login_page.LoginPage(driver) self.sa = sales_order_page.SalesOrderPage(driver)
def setup_class(self): '''用例执行前,启动浏览器,创建chrome实例''' driver = webdriver.Chrome() driver.maximize_window() # 实例化页面 self.lg = login_page.LoginPage(driver) self.op = optometre_sales_page.OptometreSalesPage(driver)
def setUp(self): self.driver = webdriver.Chrome() self.base_page = base_page.BasePage(self.driver) self.login_page = login_page.LoginPage(self.driver) self.profile_page = profile_page.ProfilePage(self.driver) self.development_plan_page = udpp.UsersDevelopmentPlan(self.driver) self.login_page.sign_in_as(**login_page.VALID_DATA) self.profile_page.go_to_development_plan()
def login(self, request): _driver = webdriver.Chrome() def quit(): _driver.quit() request.addfinalizer(quit) return login_page.LoginPage(_driver)
def login(self, request): _geckodriver = os.path.join(os.getcwd(), 'vendor', 'geckodriver') driver_ = webdriver.Firefox(executable_path=_geckodriver) def quit(): driver_.quit() request.addfinalizer(quit) return login_page.LoginPage(driver_)
def setUp(self): self.driver = webdriver.Chrome() self.login_page = lp.LoginPage(self.driver) self.profile_page = pp.ProfilePage(self.driver) self.event_create_page = ecp.EventCreatePage(self.driver) self.event_edit_page = eep.EventEditPage(self.driver) self.events_page = ep.EventsPage(self.driver) self.event_details_page = edp.EventsDetailsPage(self.driver) self.login_page.sign_in_as(**lp.VALID_DATA)
def test_click_login_link(self): globalHeader = global_header.GlobalHeaderComponent(self.driver) loginPage = login_page.LoginPage(self.driver) try: globalHeader.login_link_displayed() globalHeader.click_login_link() assert loginPage.login_header_displayed() except NoSuchElementException: print("Element is not visible")
def setUp(self): self.driver = webdriver.Chrome() self.driver.get(base_page.BASE_URL) self.main_window = self.driver.window_handles[0] self.driver.execute_script('window.open("{}");'.format(tep.TEMPORARY_EMAIL_CLIENT)) self.email_window = self.driver.window_handles[1] self.sign_up_window = reg_p.RegistationPage(self.driver) self.email_service = tep.TemporaryEmailPage(self.driver) self.login_window = lp.LoginPage(self.driver) self.home_page = hp.HomePage(self.driver)
def setUp(self): self.driver = webdriver.Chrome() self.login_page = lp.LoginPage(self.driver) self.login_page.sign_in_as(**lp.VALID_DATA) self.login_page.is_page_loaded(bp.PROFILE_PAGE_URL) self.profile_page = pp.ProfilePage(self.driver) self.courses_page = cp.CoursesPage(self.driver) self.course_details_page = cdp.CourseDetailsPage(self.driver) self.courses_page.go_to() self.courses_page.click_on_first_course_on_page()
class App: login_page = LP.LoginPage(driver) home_page = HP.HomePage(driver) select_procedure_modal = HP.SelectProcedureModal(driver) tender_page = TP.TenderPage(driver) lot_form = LF.LotForm(driver) item_form = IF.ItemForm(driver) feature_form = FF.FeatureForm(driver) document_form = DF.DocumentForm(driver) date_widget = DW.DateWidget(driver)
def test_edit_account(self): """ test scenario: login existing user, select finance menu, edit account account (index of account is temp solution), verify that acc was changed """ login = login_page.LoginPage(self.driver) login.login_existing_user('*****@*****.**', 'auto_qa_kur1') menu = base_page_with_table.BasePageWithTable(self.driver) menu.select_finance_menu_item() finance_menu = finance_page.FinancePage(self.driver) finance_menu.edit_account(0, 'acc1', 1, 1, 100) self.assertTrue(finance_menu.message_success())
def test_delete_account(self): """ test scenario: login existing user, select finance menu, delete account, verify that acc was deleted """ login = login_page.LoginPage(self.driver) login.login_existing_user('*****@*****.**', 'auto_qa_kur1') menu = base_page_with_table.BasePageWithTable(self.driver) menu.select_finance_menu_item() finance_menu = finance_page.FinancePage(self.driver) finance_menu.delete_account_confirm(1) self.assertTrue(finance_menu.message_success())
def test_add_new_account(self): """ test scenario: login existing user, select finance menu, add new account, verify that acc was added """ # setup login = login_page.LoginPage(self.driver) login.login_existing_user('*****@*****.**', 'auto_qa_kur1') menu = base_page_with_table.BasePageWithTable(self.driver) menu.select_finance_menu_item() finance_menu = finance_page.FinancePage(self.driver) finance_menu.add_account('acc1', 1, 1, 100, 200) self.assertTrue(finance_menu.message_success())
def login(self, request): _geckodriver = os.path.join(os.getcwd(), 'vendor', 'geckodriver') if os.path.isfile(_geckodriver): _service = FirefoxService(executable_path=_geckodriver) driver_ = webdriver.Firefox(service=_service) else: driver_ = webdriver.Firefox() def quit(): driver_.quit() request.addfinalizer(quit) return login_page.LoginPage(driver_)
def before_all(context): context.browser = Browser() context.login = login_page.LoginPage() context.post = new_post.PostNewEntry() context.settings = settings.SettingsTab()
def setUp(self): self.driver = webdriver.Firefox() self.login_page = lp.LoginPage(self.driver) self.profile_page = pp.ProfilePage(self.driver)
def setUp(self): self.driver = webdriver.Chrome() self.login_page = lp.LoginPage(self.driver) self.profile_page = pp.ProfilePage(self.driver) self.events_page = ep.EventsPage(self.driver) self.event_details_page = edp.EventsDetailsPage(self.driver)
def setUp(self): self.driver = webdriver.Chrome() self.login_page = lp.LoginPage(self.driver) self.profile_page = pp.ProfilePage(self.driver) self.course_page = cp.CoursesPage(self.driver)
def setUp(self): self.driver = webdriver.Firefox() self.login_page = lp.LoginPage(self.driver) self.profile_page = pp.ProfilePage(self.driver) self.events_page = ep.EventsPage(self.driver) self.events_page.wait = WebDriverWait(self.driver, 3)
def to_purchase_manage(self): """进入采购管理""" login = login_page.LoginPage(self.driver) login.to_opto_operation() self.click(self.purchase_manage)
def login(self, driver): return login_page.LoginPage(driver)
def to_inventory_manage(self): """进入库存管理""" login = login_page.LoginPage(self.driver) login.to_opto_operation() self.click(self.inventory_manage)
def setUp(self): self.driver = webdriver.Chrome() self.login_page = lp.LoginPage(self.driver)
def setUp(self): self.driver = webdriver.Chrome() self.login_page = lp.LoginPage(self.driver) self.profile_page = pp.ProfilePage(self.driver) self.edit_profile_page = epp.EditProfilePage(self.driver) self.base_page = bp.BasePage(self.driver)
"""再开一单--订单金额不能为0""" self.another_bill() self.click(self.minus_one) time.sleep(1) # self.sendKeys(self.sale_number_input, 0) self.click(self.submit) def replace_prescription(self): """更换处方""" self.another_bill() self.click(self.replace_button) time.sleep(5) self.click(self.new_prescription) time.sleep(1) self.click(self.choose_prescription) time.sleep(1) self.submi_bill() if __name__ == '__main__': driver = webdriver.Chrome() login = login_page.LoginPage(driver) login.login() sa = SalesOrderPage(driver) time.sleep(1) # sa.choose_discount() # sa.bill_amount_wrong() sa.replace_prescription()
def setUp(self): self.driver = webdriver.Chrome() self.courses_page = cp.CoursesPage(self.driver) self.login_page = lp.LoginPage(self.driver)
def setUp(self): self.driver = webdriver.Chrome() self.login_page = lp.LoginPage(self.driver) self.profile_page = pp.ProfilePage(self.driver) self.course_page = cc.NewCoursePage(self.driver) self.base_page = bp.BasePage(self.driver)
def step_impl(context): context.login_page = login_page.LoginPage(context.dr) context.login_page.url = context.login_page.domain + 'wp-login.php' context.login_page.navigate()
def setUp(self): self.driver = webdriver.Chrome() self.login_page = lp.LoginPage(self.driver) self.edit_profile_page = ep.EditProfilePage(self.driver) self.profile_page = pp.ProfilePage(self.driver) self.driver.implicitly_wait(30)
def before_all(context): context.driver = driver.Driver() context.start_page = start_page.StartPage() context.login_page = login_page.LoginPage() context.main_page = main_page.MainPage()