def test_subscription_banner(self, main, steps, bookmark_steps): BottomPanel().bookmarks().click() steps.try_get_by_text(LocalizedButtons.GUIDES.get()).click() bookmark_steps.click_download_guides() guides_page = GuidesCatalog() guides_page.try_subscription().click() banner = SubscriptionBanner() assert banner.title() assert banner.city_outdoor() assert banner.monthly() assert banner.yearly() banner.yearly().click() assert steps.try_get(Locator.TERM_OF_USE_CHECKBOX.get()) assert steps.try_get(Locator.POLICY_CHECKBOX.get()) if steps.try_get(LocalizedButtons.SIGN_IN_WITH.get()): TouchAction(steps.driver).tap(x=100, y=100).perform() assert banner.close() banner.close().click() assert not banner.title()
def test_pp_toponyms(self, main, steps): steps.search(LocalizedMapsNames.MOSCOW.get()) steps.choose_first_search_result( category=LocalizedCategories.CAPITAL.get()) steps.assert_catalog_promo() assert not steps.try_get(Locator.AD_BANNER.get()) steps.scroll_down() assert steps.try_get_by_text(LocalizedButtons.DETAILS.get()) sleep(5) steps.try_get_by_text(LocalizedButtons.DETAILS.get()).click() assert GuidesCatalog().navigation_bar_title() """steps.press_back_until_main_page()
def test_deeplink_guides_page(self, main, steps, system_steps): steps.wait_map_auto_download(LocalizedMapsNames.MOSCOW.get()) params = (("url", "search/?tag=24&city=4611686018695784240"), ) res = self.create_url("https://dlink.maps.me/guides_page", params) system_steps.execute_deeplink_universal(res) sleep(10) guides_page = GuidesCatalog() assert guides_page.navigation_bar_title() assert guides_page.filter_by_city().get_attribute( attributes.TEXT_VALUE.get()) == LocalizedMapsNames.AMSTERDAM.get() assert guides_page.filter_by_tag().get_attribute( attributes.TEXT_VALUE.get()) == LocalizedCategories.FOOD.get() guides_page.close()
def test_deeplink_catalogue(self, main, steps, delete_guide, system_steps): steps.wait_map_auto_download(LocalizedMapsNames.MOSCOW.get()) params = ( ("id", "06e2e2b3-2e01-43d2-be15-27e7370ae77b"), ("name", "Zagreb - a city of unusual museums and amazing nature scenery"), ) res = self.create_url("https://dlink.maps.me/catalogue", params) system_steps.execute_deeplink_universal(res) WebDriverWait(steps.driver, 30).until( EC.visibility_of_element_located( (By.XPATH, "//*[@text='{0}' or @name='{0}']".format( LocalizedButtons.GUIDE_DOWNLOADED.get())))) steps.try_get(Locator.NOT_NOW.get()).click() try: GuidesCatalog().close().click() except: pass
def test_deeplink_onelink_guides_page(self, main, steps, system_steps): steps.wait_map_auto_download(LocalizedMapsNames.MOSCOW.get()) params = ( ("pid", "mapsme_app"), ("is_retargeting", "true"), ("af_dp", "https://dlink.maps.me/guides_page?url=search%2F%3Fcity%3D4611686018695784240%26tag%3D24" ), ) res = self.create_url("https://mapsme.onelink.me/LBgk", params) system_steps.execute_onelink_deeplink(res) sleep(10) guides_page = GuidesCatalog() assert guides_page.navigation_bar_title() assert guides_page.filter_by_city().get_attribute( attributes.TEXT_VALUE.get()) == LocalizedMapsNames.AMSTERDAM.get() assert guides_page.filter_by_tag().get_attribute( attributes.TEXT_VALUE.get()) == LocalizedCategories.FOOD.get() guides_page.close()
def test_deeplink_onelink_catalogue(self, main, steps, delete_guide, system_steps): steps.wait_map_auto_download(LocalizedMapsNames.MOSCOW.get()) params = ( ("pid", "mapsme_app"), ("is_retargeting", "true"), ("af_dp", "https://dlink.maps.me/catalogue?id=06e2e2b3-2e01-43d2-be15-27e7370ae77b&name=Zagreb+-+a+city+of+unusual+museums+and+amazing+nature+scenery" ), ) res = self.create_url("https://mapsme.onelink.me/LBgk", params) system_steps.execute_onelink_deeplink(res) WebDriverWait(steps.driver, 30).until( EC.visibility_of_element_located( (By.XPATH, "//*[@text='{0}' or @name='{0}']".format( LocalizedButtons.GUIDE_DOWNLOADED.get())))) steps.try_get(Locator.NOT_NOW.get()).click() try: GuidesCatalog().close().click() except: pass
def assert_guides_page_navbar(self): assert GuidesCatalog().navigation_bar_title()
def test_search_banner(self, main, steps, bookmark_steps): BottomPanel().bookmarks().click() steps.try_get_by_text(LocalizedButtons.GUIDES.get()).click() bookmark_steps.click_download_guides() guides_page = GuidesCatalog() sleep(2) guides_page.filter_by_tag().send_keys(LocalizedMapsNames.MOSCOW.get()) sleep(2) guides_page.search_result_dropdown( LocalizedMapsNames.MOSCOW.get()).click() sleep(2) guides_page.clear_search().click() sleep(2) guides_page.filter_by_tag().send_keys(LocalizedMapsNames.LONDON.get()) sleep(2) guides_page.search_result_dropdown( LocalizedMapsNames.LONDON.get()).click() sleep(2) guides_page.clear_search().click() sleep(2) guides_page.filter_by_tag().send_keys(LocalizedMapsNames.BERLIN.get()) sleep(2) guides_page.search_result_dropdown( LocalizedMapsNames.BERLIN.get()).click() sleep(2) guides_page.clear_search().click() sleep(2) assert guides_page.subscribe_result_banner()
def test_discovery_guides(self, main, download_moscow_map, steps): panel = BottomPanel() panel.discovery().click() page = DiscoveryPage() sleep(5) guide_name = page.first_guide_name().text guide_type = page.first_guide_type().text page.first_guide_name().click() guides_page = GuidesCatalog() assert guides_page.navigation_bar_title() if len([ x for x in steps.driver.contexts if x != "NATIVE_APP" and "chrome" not in x ]) > 0: assert guides_page.guide_title().text == guide_name assert guides_page.guide_author().text == guide_type else: sleep(3) assert steps.try_get_by_text(guide_name) sleep(3) assert steps.try_get_by_text(guide_type, strict=False) guides_page.close().click() steps.press_back_until_main_page() panel.discovery().click() sleep(5) coord_y = page.first_guide_name().location["y"] page.slide_left(coord_y, 3) page.click_more(coord_y) assert guides_page.navigation_bar_title() if len([ x for x in steps.driver.contexts if x != "NATIVE_APP" and "chrome" not in x ]) > 0: assert guides_page.breadcrumbs_active_item( ).text == LocalizedMapsNames.MOSCOW.get() assert guides_page.see_all() guides_page.close().click()