Ejemplo n.º 1
0
    def test_walk_routing_bookmark(self, main, download_moscow_map, steps,
                                   r_steps, bookmark_steps):
        panel = BottomPanel()
        bookmark_steps.delete_all_groups()
        bookmark_steps.delete_bookmark(LocalizedButtons.MY_BOOKMARKS.get(),
                                       "проспект Мира, 78")
        bookmark_name = "проспект Мира, 78"
        bookmark_steps.create_bookmark(bookmark_name)
        steps.search("метро Алексеевская")

        steps.choose_first_search_result()
        panel.to().click()
        el = steps.try_get_by_text(LocalizedButtons.ACCEPT.get())
        if el:
            el.click()
        steps.try_get(Locator.ROUTING_WALK.get()).click()
        r_steps.wait_route_start()
        steps.press_back_until_main_page()
        panel.bookmarks().click()
        bookmark_steps.click_bookmark_group(
            LocalizedButtons.MY_BOOKMARKS.get())
        bookmark = bookmark_steps.try_find_bookmark_with_scroll(bookmark_name)
        sleep(1)
        bookmark.click()
        panel.to().click()
        el = steps.try_get_by_text(LocalizedButtons.ACCEPT.get())
        if el:
            el.click()

        r_steps.wait_route_start()
        assert not steps.try_get(Locator.ROUTING_WALK.get())
Ejemplo n.º 2
0
    def test_toll_roads(self, main, steps, r_steps):
        """https://testrail.corp.mail.ru/index.php?/tests/view/36653882
        https://testrail.corp.mail.ru/index.php?/tests/view/36653900"""
        panel = BottomPanel()
        steps.search("Воронеж")
        steps.choose_first_search_result(
            category=LocalizedCategories.CITY.get())

        panel.to().click()
        el = steps.try_get_by_text(LocalizedButtons.ACCEPT.get())
        if el:
            el.click()

        r_steps.download_additional_maps()
        r_steps.wait_route_start()
        steps.try_get(Locator.ZOOM_IN.get()).click()

        assert steps.try_get(Locator.DRIVING_OPTIONS.get())
        sleep(5)

        filename = "toll_road.png"
        steps.driver.get_screenshot_as_file(filename)
        coor = self.get_coords_proportions(
            filename, proportions=steps.driver.get_window_size())
        TouchAction(steps.driver).tap(
            x=round(coor[0] * steps.driver.get_window_size()["width"]),
            y=round(coor[1] *
                    steps.driver.get_window_size()["height"])).perform()

        assert steps.try_get_by_text(LocalizedButtons.AVOID_TOLL_ROADS.get())
        assert steps.try_get_by_text(LocalizedButtons.TOLL_ROAD.get(),
                                     strict=False)
Ejemplo n.º 3
0
    def test_routing_walk_stops_limit(self, main, steps, r_steps):
        """https://testrail.corp.mail.ru/index.php?/tests/view/36653637"""
        panel = BottomPanel()
        steps.search("метро Алексеевская")
        steps.choose_first_search_result()

        panel.to().click()
        el = steps.try_get_by_text(LocalizedButtons.ACCEPT.get())
        if el:
            el.click()

        steps.try_get(Locator.ROUTING_WALK.get()).click()
        r_steps.wait_route_start()

        steps.search("метро Сокол")
        steps.choose_first_search_result()

        panel.add_stop().click()
        r_steps.wait_route_start()

        steps.search("метро Беляево")
        steps.choose_first_search_result()

        panel.add_stop().click()
        r_steps.wait_route_start()

        steps.search("метро Тульская")
        steps.choose_first_search_result()
        panel.add_stop().click()

        r_steps.wait_route_start()

        steps.search("метро Сокольники")
        steps.choose_first_search_result()
        assert panel.add_stop() is None
Ejemplo n.º 4
0
    def test_routing_walk(self, main, download_moscow_map, steps, r_steps):
        """ Текущее местоположение -> метро Сокол -> метро Беляево -> Сергиев-Посад -> метро Алексеевская """
        panel = BottomPanel()
        steps.search("метро Алексеевская")
        steps.choose_first_search_result()

        panel.to().click()
        el = steps.try_get_by_text(LocalizedButtons.ACCEPT.get())
        if el:
            el.click()

        steps.search("метро Сокол")
        steps.choose_first_search_result()

        r_steps.click_add_stop()
        r_steps.wait_route_start()

        steps.search("метро Беляево")
        steps.choose_first_search_result()

        r_steps.click_add_stop()
        r_steps.wait_route_start()

        steps.search("Сергиев-Посад")
        steps.choose_first_search_result()
        r_steps.click_add_stop()

        r_steps.download_additional_maps()
        r_steps.wait_route_start()

        steps.try_get(Locator.ROUTING_WALK.get()).click()
        r_steps.wait_route_start()
Ejemplo n.º 5
0
    def test_routing_pay_and_bad_roads_only_auto(self, main, steps, r_steps):
        """https://testrail.corp.mail.ru/index.php?/tests/view/36653881"""
        steps.download_map(LocalizedMapsNames.GREAT_BRITAIN, None,
                           LocalizedMapsNames.LONDON)
        panel = BottomPanel()
        steps.search("метро Алексеевская")
        steps.choose_first_search_result()

        panel.to().click()
        el = steps.try_get_by_text(LocalizedButtons.ACCEPT.get())
        if el:
            el.click()

        r_steps.wait_route_start()

        assert steps.try_get(Locator.DRIVING_OPTIONS.get(
        )) is None or steps.try_get(
            Locator.DRIVING_OPTIONS.get()).get_attribute("visible") == 'false'

        steps.press_back_until_main_page()
        steps.search("Compton Park")
        sleep(10)
        steps.choose_first_search_result(
            category=LocalizedCategories.PARK.get())

        panel.route_from().click()
        steps.try_get(Locator.ROUTING_CHOOSE_POINT.get()).click()
        steps.search("Errol Street", click_search_button=False)
        steps.choose_first_search_result()
        r_steps.wait_route_start()
        steps.try_get(Locator.DRIVING_OPTIONS.get()).click()
        sleep(2)
        steps.driver.back()

        steps.try_get(Locator.ROUTING_BIKE.get()).click()
        r_steps.wait_route_start()
        assert steps.try_get(Locator.DRIVING_OPTIONS.get(
        )) is None or steps.try_get(
            Locator.DRIVING_OPTIONS.get()).get_attribute("visible") == 'false'

        steps.try_get(Locator.ROUTING_WALK.get()).click()
        r_steps.wait_route_start()
        assert steps.try_get(Locator.DRIVING_OPTIONS.get(
        )) is None or steps.try_get(
            Locator.DRIVING_OPTIONS.get()).get_attribute("visible") == 'false'

        steps.try_get(Locator.ROUTING_METRO.get()).click()
        r_steps.wait_metro_panel()
        assert steps.try_get(Locator.DRIVING_OPTIONS.get(
        )) is None or steps.try_get(
            Locator.DRIVING_OPTIONS.get()).get_attribute("visible") == 'false'

        steps.try_get(Locator.ROUTING_TAXI.get()).click()
        r_steps.wait_taxi_panel()
        assert steps.try_get(Locator.DRIVING_OPTIONS.get(
        )) is None or steps.try_get(
            Locator.DRIVING_OPTIONS.get()).get_attribute("visible") == 'false'
Ejemplo n.º 6
0
    def test_routing_base(self, main, download_moscow_map, steps):
        panel = BottomPanel()
        steps.search("Проспект Мира 78")
        steps.choose_first_search_result()

        panel.to().click()
        el = steps.try_get_by_text(LocalizedButtons.ACCEPT.get())
        if el:
            el.click()

        assert steps.try_get_by_text(
            LocalizedButtons.START.get()) or steps.try_get(Locator.START.get())
Ejemplo n.º 7
0
    def test_routing_taxi_route_to(self, main, download_moscow_map, steps,
                                   r_steps):
        """Текущее местоположение -> метро Алексеевская"""
        panel = BottomPanel()
        steps.search("метро Алексеевская")
        steps.choose_first_search_result()

        panel.to().click()
        el = steps.try_get_by_text(LocalizedButtons.ACCEPT.get())
        if el:
            el.click()

        sleep(2)
        steps.try_get(Locator.ROUTING_TAXI.get()).click()
        r_steps.wait_taxi_panel()
Ejemplo n.º 8
0
    def test_auto_routing_bookmark(self, main, download_moscow_map, steps,
                                   r_steps, bookmark_steps):
        panel = BottomPanel()
        bookmark_steps.delete_all_groups()
        bookmark_steps.delete_bookmark(LocalizedButtons.MY_BOOKMARKS.get(),
                                       "проспект Мира, 78")
        bookmark_name = "проспект Мира, 78"
        bookmark_steps.create_bookmark(bookmark_name)
        panel.bookmarks().click()
        bookmark_steps.click_bookmark_group(
            LocalizedButtons.MY_BOOKMARKS.get())
        bookmark = bookmark_steps.try_find_bookmark_with_scroll(bookmark_name)
        sleep(1)
        bookmark.click()
        panel.to().click()
        el = steps.try_get_by_text(LocalizedButtons.ACCEPT.get())
        if el:
            el.click()

        r_steps.wait_route_start()