def app(request): """fixture for cross-platform model-based application always use session scope for this type of fixture & parameterize your platforms :rtype: App """ if isinstance(request.param, list) or isinstance(request.param, tuple): APPS = [] for platform in request.param: APPS.append(App.from_platform(platform, request)) request.addfinalizer(APPS[-1].driver.quit) return APPS APP = App.from_platform(request.param, request) request.addfinalizer(APP.driver.quit) return APP
def test_navigator_with_auto_connect(platform, request): app = App.from_platform(platform, request) app.navigate.to(app.linkedin_home).perform() # this is what the tester will want to test app.linkedin_home.register.register_and_submit(firstname='test123', lastname='456', email='testmail', password='******') app.driver.quit()
def test_navigator_2_navigations(platform, request): app = App.from_platform(platform, request) app.navigate(app.google_search) assert app.navigate.current_page == app.navigate.from_page == app.google_search app.navigate(app.linkedin_home) assert app.navigate.current_page == app.navigate.from_page == app.linkedin_home # this is what the tester will want to test app.linkedin_home.register.register_and_submit(firstname='test123', lastname='456', email='testmail', password='******') app.driver.quit()
def test_navigate_to_self_with_looped_navigation(platform, request): # setup app = App.from_platform(platform, request) # test flow app.navigate(app.google_search) # test scenario app.navigate(app.google_search) # validation app.google_search.search_bar.button() # teardown app.driver.quit()
def test_navigate_to_self_with_remote_looped_navigation(platform, request): app = App.from_platform(platform, request) app.navigate(app.google_home) app.google_home.google_search_button() app.driver.quit()
def test_navigate_with_no_possible_navigation(platform, request): app = App.from_platform(platform, request) app.navigate(app.linkedin_home) # with pytest.raises(PathUnreachableException): # app.navigate(app.google_home) app.driver.quit()
def test_navigate_to_self_with_no_possible_navigation(platform, request): app = App.from_platform(platform, request) app.navigate(app.linkedin_home) app.navigate(app.linkedin_home) app.linkedin_home.register.reg_submit() app.driver.quit()