Exemplo n.º 1
0
def test_set_home(browser, mobile):

    functions.login(browser)

    home = FirstPage(browser)
    home.my_maps()
    home = MyMapsPage(browser)
    home.set_home()
    for i in range(100000000):
        pass
    home.set_work()

    #mobile check
    # mobile
    main_screen = MainScreen(mobile)
    main_screen.menu_click()

    menu_screen = MenuScreen(mobile)
    menu_screen.places_and_routes()

    my_maps = MyMapsScreen(mobile)
    my_maps.refresh()

    elem_home = mobile.find_element_by_xpath(
        '//android.widget.FrameLayout[@content-desc="Home: Muzeum"]/android.widget.LinearLayout/android.widget.TextView'
    )
    elem_work = mobile.find_element_by_xpath(
        '//android.widget.FrameLayout[@content-desc="Work: Rudolfinum"]/android.widget.LinearLayout/android.widget.TextView'
    )

    assert elem_home.get_attribute(
        'text') == 'Muzeum' and elem_work.get_attribute('text') == 'Rudolfinum'
Exemplo n.º 2
0
def test_folder_sync(browser, mobile):
    functions.login(browser)

    my_maps = FirstPage(browser)
    my_maps.load()
    my_maps.my_maps()

    my_maps = MyMapsPage(browser)
    my_maps.create_folder('Changed names')

    # #mobile
    # USER_NAME = 'mapytesting2'
    # PASSWORD = '******'
    #
    # main_screen = MainScreen(mobile)
    # main_screen.menu_click()
    #
    # menu_screen = MenuScreen(mobile)
    # menu_screen.log_in()
    #
    # login_screen = LogInScreen(mobile)
    # login_screen.user_name(USER_NAME)
    # login_screen.password(PASSWORD)
    # login_screen.sign_in_button()

    # mobile
    elem = functions.check_mobile_folder(mobile)
    assert elem.get_attribute('text') == 'Changed names'

    #delete
    functions.delete_folder(mobile)
Exemplo n.º 3
0
def login(browser):
    my_maps = FirstPage(browser)
    my_maps.load()
    my_maps.my_maps()

    login = LoginPage(browser)
    login.sign_in()
Exemplo n.º 4
0
def test_create_folder_and_items(browser, mobile):
    functions.login(browser)
    my_maps = FirstPage(browser)
    my_maps.load()
    my_maps.my_maps()

    my_maps = MyMapsPage(browser)
    my_maps.create_folder('new folder')

    SEARCH: str = 'Rudolfinum'
    functions.search_element(browser, SEARCH)

    search = SearchPage(browser)
    search.save_exact_match()

    save_page = SavePage(browser)
    save_page.select_folder('new folder')
    save_page.save()

    planning = FirstPage(browser)
    planning.load()
    planning.planning()

    auto = PlanningPage(browser)
    # auto.auto()

    auto.start()
    auto.end()

    auto.save_route()

    save_page = SavePage(browser)
    save_page.change_name('Route')
    save_page.select_folder('new folder')
    save_page.save()

    elem = functions.check_mobile_folder(mobile)
    elem = mobile.find_element_by_id('cz.seznam.mapy:id/image').click()
    folder_screen = FolderScreen(mobile)
    print(len(folder_screen.get_titles))

    mobile.back()

    #delete
    functions.delete_folder(mobile)
Exemplo n.º 5
0
def check_web_folder(browser):
    # web check
    my_maps = FirstPage(browser)
    my_maps.load()
    my_maps.my_maps()

    login = LoginPage(browser)
    login.sign_in()

    my_maps = FirstPage(browser)
    my_maps.load()
    my_maps.my_maps()

    my_maps = MyMapsPage(browser)

    elem = WebDriverWait(browser, 10).until(
        EC.presence_of_element_located(
            (By.XPATH, "/html/body/div/div[2]/div[2]/div[1]/div/div[3]/div/ul[1]/li/div/div[2]/h2")))
    return  elem
Exemplo n.º 6
0
def return_web_items(browser):
    # web check
    my_maps = FirstPage(browser)
    my_maps.load()
    my_maps.my_maps()

    login = LoginPage(browser)
    login.sign_in()

    my_maps = FirstPage(browser)
    my_maps.load()
    my_maps.my_maps()

    my_maps = MyMapsPage(browser)

    elem = WebDriverWait(browser, 10).until(
        EC.presence_of_element_located(
            (By.XPATH, "//h2[@class='title overflow-ellipsis']")))
    elems = browser.find_elements_by_xpath("//h2[@class='title overflow-ellipsis']")
    return elems