def before_scenario(context, scenario): context.driver = webdriver.Chrome() context.driver.maximize_window() context.driver.implicitly_wait(2) context.driver.get("http://automationpractice.com") if "skip" in scenario.tags: scenario.skip("Marked with @skip") return if "base_page" in scenario.tags: context.base_page = BasePage(context.driver) if "home_page" in scenario.tags: context.home_page = HomePage(context.driver) if "authentication_page" in scenario.tags: context.authentication_page = AuthenticationPage(context.driver) if "registration_page" in scenario.tags: context.registration_page = RegistrationPage(context.driver) if "checkout_page" in scenario.tags: context.checkout_page = CheckoutPage(context.driver) if "summary_page" in scenario.tags: context.summary_page = SummaryPage(context.driver) if "address_page" in scenario.tags: context.address_page = AddressPage(context.driver) if "shipping_page" in scenario.tags: context.shipping_page = ShippingPage(context.driver) if "payment_page" in scenario.tags: context.payment_page = PaymentPage(context.driver)
def before_all(context): context.base_url = 'https://contman.github.io/testing_pages/' context.browser = Browser() context.home_page = HomePage(context) context.contact_page = ContactPage(context)
def before_scenario(context, scenario): context.browser = Browser() context.home_page = HomePage() context.reservations_page = ReservationsPage()
def test_retrieve_selected_language(self): current_url = "http://www.simtlix.com/en/home/" home_page = HomePage(None) lang_prefix = home_page._retrieve_selected_language(current_url) self.assertEquals("en", lang_prefix)
def test_language_string_spanish(self): home_page = HomePage(None) lang = home_page._language_string("es") self.assertEquals("Spanish", lang)
def test_language_string_english(self): home_page = HomePage(None) lang = home_page._language_string("en") self.assertEquals("English", lang)
def prepare_pages(driver): world.home_page = HomePage(driver)
def step_impl(context): context.scenario.home_page = HomePage(context.browser) context.scenario.home_page.open("/")
def menu(step, menu, submenu): home_page = HomePage(step) home_page.clickMenu(menu) home_page.clickSubMenu(submenu)
def click_Teams_Dropdown(context): home_page = HomePage(context.browser) home_page.click_Teams_Dropdown()
def deep_link_to_schedule_page(context, team_id, schedule_id,entryId): HomePage(context.browser).is_page_loaded() url = '{}/schedule/{}/overview'.format(context.env_variables['BASE_URL'], team_id, schedule_id,entryId) context.browser.get(url)
def click_Teams_schedule_tab(context): home_page = HomePage(context.browser) home_page.click_Schedule_Tab()