Exemplo n.º 1
0
 def test_invalid_search_rik_ee(self):
     #Kontrollime, et kirjutades otsingumootorisse '$$$' ei tule vasteid
     main_page = page.MainPage(self.driver)
     main_page.search_text_element = "$$$"
     main_page.click_search_button()
     search_results_page = page.SearchResultsPage(self.driver)
     assert not search_results_page.is_results_found()
Exemplo n.º 2
0
 def test_search_in_python_org(self):
     main_page = page.MainPage(self.driver)
     assert main_page.is_title_matches(), "python.org title doesn;t match."
     main_page.search_text_element = "pycon"
     main_page.click_go_button()
     search_results_page = page.SearchResultsPage(self.driver)
     assert search_results_page.is_results_cound(), "No results found."
Exemplo n.º 3
0
 def test_video_list(self):
     mainPage = page.MainPage(self.driver)
     assert mainPage.is_title_match()
     mainPage.search_text = "nct 127"
     mainPage.click_search_btn()
     searchResultPage = page.SearchResultsPage(self.driver)
     assert searchResultPage.is_video_found()
Exemplo n.º 4
0
    def test_weightwatchers(self):

        main_page = page.MainPage(self.driver)
        #2. Verify loaded page title matches “WW (Weight Watchers): Weight Loss & Wellness Help”
        assert main_page.title_matches(
        ), "Weight Loss & Wellness Help, does not match"
        #3. On the right corner of the page, click on “Find a Studio”
        main_page.click_find_workshop()
        #4. Verify loaded page title contains “Find WW Studios & Meetings Near You | WW USA”
        searchworkshoppage = page.SearchWorkshopPage(self.driver)
        assert searchworkshoppage.title_matches, "Find WW Studios & Meetings Near You | WW USA"

        self.driver.implicitly_wait(3)
        #5. In the search field, search for meetings for zip code: 10011
        searchworkshoppage.type_seach_term("10001")
        searchworkshoppage.click_on_search()
        # 6. Print the title of the first result and the distance (located on the right of location title/name)
        search_results_page = page.SearchResultsPage(self.driver)
        #7. Click on the first search result and then, verify displayed location name/title matches with the name of the first searched result that was clicked.
        location_on_search_result = search_results_page.return_location_name()
        search_results_page.click_on_first_location()
        location_details_page = page.LocationDetailsPage(self.driver)
        location_details_locationname = location_details_page.assert_location_is_same(
        )
        assert (location_on_search_result == location_details_locationname)
        # 8. From this location page, print TODAY’s hours of operation (located towards the bottom of the page) - This is missing in page right now
        #9. Create a method to print the number of meeting the each person(under the scheduled time) has a particular day of the week
        print("test")
        day = raw_input("Enter the Day: Mon Tue Wed Thur Fri Sat Sun ")
        location_details_page.printmeetings(day)
Exemplo n.º 5
0
    def test_search_in_rozetka(self):
        """
        Tests rozetka search feature. Searches for the word "----" then verified that some results show up.
        Note that it does not look for any particular text in search results page. This test verifies that
        the results were not empty.
        """

        #Load the main page. In this case the home page of Python.org.
        main_page = page.MainPage(self.driver)
        #Checks if the word "rozetka" is in title
        assert main_page.is_title_matches(), "rozetka,com.ua title doesn't match."
        #Sets the text of search textbox to "----"
        main_page.search_text_element = "диван"
        main_page.click_go_button()
        search_results_page = page.SearchResultsPage(self.driver)
        #Verifies that the results page is not empty
        assert search_results_page.is_results_found(), "No results found."
        search_results_page.filter_min="100"
        search_results_page.filter_max="7000"
        search_results_page.apply_filters()
        search_results_page.filter_country="Украина"
        item_page = page.ItemPage(self.driver)
        price = item_page.get_result()
        assert (price<7000), "Invalid price"
        cart_page = page.CartPage(self.driver)
        cart_page.to_checkout()
        assert cart_page.is_price_valid(price), "Invalid price"
        checkout_page = page.CheckoutPage(self.driver)
        checkout_page.name = "Иван Иванофф"
        checkout_page.mail = "*****@*****.**"
        checkout_page.phone = "+380446666666"
        #self.driver.find_element_by_xpath('//div[@class=\"check-f-i-field\"]/span/button').click()

        checkout_page.checkout()
Exemplo n.º 6
0
    def test_search_in_python_org(self):
        """
        Tests the ability to login to Dexcom Home page from https://clarity.dexcom.com
        """
        print("Title:  ", self.driver.title)

        # Define the main page and login page from Dexcom.com.
        main_page  = page.MainPage(self.driver)
        login_page  = page.LoginPage(self.driver)
        
        time.sleep(1)
        # Checks if the word "Dexcom" is in title
        assert main_page.is_title_matches(), "Dexcom title doesn't match."
        
        # Choos the button to login to Home page
        main_page.click_home_button()

        time.sleep(1)

        # Enter the provided Username and Password
        login_page.enter_username(config_username)
        login_page.enter_password(config_password)
        login_page.click_submit()
        
        time.sleep(1) 

        
        #Verifies that the results page is not empty
        search_results_page = page.SearchResultsPage(self.driver)
        assert search_results_page.is_results_found(), "No results found."
Exemplo n.º 7
0
    def test_register_user(self):
        driver = self.driver
        driver.get('http://39.107.96.138:3000/signup')

        #实例化一个Mainpage对象
        main_page = page.MainPage(self.driver)
        username = "******"
        pwd = '123456'
        email = '*****@*****.**'
        #输入注册用户名
        main_page.input_register_name(username)
        #输入密码
        main_page.input_password(pwd)
        #输入确认密码
        main_page.input_repass_name(pwd)
        #输入邮箱
        main_page.input_email(email)
        #点击注册按钮
        main_page.click_register_button()

        #验证页面是否显示"欢迎加入 Nodeclub!我们已给您的注册邮箱发送了一封邮件,请点击里面的链接来激活您的帐号"
        search_results_page = page.SearchResultsPage(self.driver)
        text = '我们已给您的注册邮箱发送了一封邮件'
        #Verifies that the results page is not empty
        assert search_results_page.is_results_found(text), "No results found."
        self.driver.delete_all_cookies()
Exemplo n.º 8
0
    def test_login(self):
        """
        登录操作,验证url及用户名出现
        """
        #打开登录网页
        self.driver.get("http://39.107.96.138:3000/signin")
        #Load the main page. In this case the home page of cnode.
        #实例化一个Mainpage对象
        main_page = page.MainPage(self.driver)
        username = "******"
        pwd = '123456'
        #输入用户名
        main_page.input_username(username)
        #输入密码
        main_page.input_password(pwd)
        #点击登录按钮
        main_page.click_login_button()

        #Checks if the word "Node" is in title
        assert main_page.is_title_matches(), "cNode title doesn't match."

        #验证页面是否显示username
        search_results_page = page.SearchResultsPage(self.driver)
        #Verifies that the results page is not empty
        assert search_results_page.is_results_found(
            username), "No results found."
Exemplo n.º 9
0
 def test_title(self):
     main_page = page.MainPage(self.driver)
     assert main_page.is_title_matches()
     main_page.search_text_element = 'pycon'
     main_page.click_go_button()
     search_result_page = page.SearchResultsPage(self.driver)
     assert search_result_page.is_results_found()
Exemplo n.º 10
0
 def test_ex227(self):
     main_page = page.MainPage(self.driver)
     assert main_page.is_title_matches(
     ), "Problème dans le titre de la page"
     main_page.search_txt("chiffon")
     search_results_page = page.SearchResultsPage(self.driver)
     assert search_results_page.is_title_matches(
     ), "Problème dans le titre de la page"
Exemplo n.º 11
0
 def test_tpb_results(self):
     main_page = page.MainPage(self.driver)
     main_page.commit_seacrh("sims")
     search_results_page = page.SearchResultsPage(self.driver)
     #search_results_page.count_search_results()
     #search_results_page.get_search_results_text_element()
     #search_results_page.analayze_search_results_text_element()
     search_results_page.count_total_results_on_all_results_pages()
Exemplo n.º 12
0
 def test_search(self):
     '''test search functionality'''
     print('Running search test')
     home = page.HomePage(self.driver)
     home.search_text_element = 'pycon'
     home.click_go_button()
     search_result_page = page.SearchResultsPage(self.driver)
     assert search_result_page.is_results_found()
Exemplo n.º 13
0
    def test_voice_input_search(self):
        content = "animal"

        self.main_page.voice_input_content(content)

        search_result_page = page.SearchResultsPage(self.driver)
        assert search_result_page.check_search_result(
            content), "{} voice search failed".format(content)
Exemplo n.º 14
0
    def test_key_word_search(self):
        content = "animal"

        self.main_page.input_search_content(content)
        self.main_page.click_search_button()
        search_result_page = page.SearchResultsPage(self.driver)
        assert search_result_page.check_search_result(
            content), "{} search failed".format(content)
Exemplo n.º 15
0
 def test_search_python(self):
     mainPage = page.MainPage(
         self.driver)  #creates the object for the class defined in page.py
     assert mainPage.is_title_matches(
     )  #if the assertion is true do the next lines
     mainPage.search_text_element = "pycon"  #invokes the __set__
     mainPage.click_go_button()
     search_result_page = page.SearchResultsPage(self.driver)
     assert search_result_page.is_results_found()
Exemplo n.º 16
0
 def test_verify_all_properties_should_visible_when_no_searchText_added(
         self):
     main_page = page.MainPage(self.driver)
     main_page.click_on_search()
     search_result_page = page.SearchResultsPage(self.driver)
     result = search_result_page.are_results_found()
     self.assertTrue(result, "Search results not found!!")
     print(
         "test_verify_all_properties_should_visible_when_no_searchText_added is PASSED!"
     )
Exemplo n.º 17
0
 def test_search_in_python_org(self):
     # Load the main page. In this case the home page of Python.org.
     main_page = page.MainPage(self.driver)
     # Checks if the word "Python" is in title
     assert main_page.is_title_matches(), "python.org title doesn't match."
     # Sets the text of search textbox to "pycon"
     main_page.search_text_element = "pycon"
     main_page.click_go_button()
     search_results_page = page.SearchResultsPage(self.driver)
     # Verifies that the results page is not empty
     assert search_results_page.is_results_found(), "No results found."
Exemplo n.º 18
0
    def test_condo_filter(self):
        home_page = page.Homepage(self.driver)
        home_page.click_find_a_home_search_field()
        home_page.set_search_text('Ivine, CA, USA')
        search_results_page = page.SearchResultsPage(self.driver)
        page.explicit_wait_by_xpath(
            self, '//*[@id="wideSidepaneFilterButtonContainer"]')
        search_results_page.click_more_filters_btn()
        page.explicit_wait_by_xpath(self, '//*[contains(text(), "Condo")]')
        search_results_page.click_condo_filter()
        page.explicit_wait_by_xpath(self,
                                    '//*[contains(text(), "Apply Filters")]')
        search_results_page.click_apply_filters_btn()
        sleep(1)
        while True:
            resultSet = self.driver.find_element_by_class_name('HomeViews')
            ids = resultSet.find_elements_by_xpath(
                '//*[contains(@id, "MapHomeCard")]')
            sleep(2)
            for id in ids:
                main_window = self.driver.current_window_handle
                page.explicit_wait_by_xpath(
                    self, '//*[contains(@id, "MapHomeCard")]')
                sleep(1)
                self.driver.find_element_by_id(id.get_attribute('id')).click()
                try:
                    windows = self.driver.window_handles
                    self.driver.switch_to.window(windows[1])
                    page.explicit_wait_by_xpath(
                        self, "//div[@class='keyDetailsList']")
                    details = self.driver.find_element(
                        *SearchResultsPageLocators.KEY_DETAILS)
                    text = details.get_attribute('innerHTML')
                    condominium = re.search("Condominium", text)
                    condo = re.search("Condo", text)
                    all_others = re.search("All Other Attached", text)
                    self.assertNotEqual(condominium or all_others or condo,
                                        None)
                    sleep(1)
                    if len(windows) > 1:
                        self.driver.switch_to.window(windows[1])
                        self.driver.close()
                    self.driver.switch_to.window(main_window)

                except:
                    print('test failed, check manually')
                    self.driver.get_screenshot_as_file('failed_test.png')
                    exit(1)
            try:
                search_results_page.next_btn()
                search_results_page.click_next_btn()

            except:
                break
Exemplo n.º 19
0
    def test_search_in_booking_com(self):
        """
        zalando.com search feature. Search for surfing clothes
        """

        main_page = page.MainPage(self.driver)
        assert main_page.is_title_matches(), "python.org title doesn't match."
        main_page.search_text_element = "billabong"
        main_page.click_enter()
        search_results_page = page.SearchResultsPage(self.driver)
        assert search_results_page.is_results_found(), "No results found."
Exemplo n.º 20
0
 def test(self):
     main_page = page.MainPage(self.driver)
     assert main_page.is_google_input("Центральный банк РФ"), True
     main_page.click_search_button()
     search_results_page = page.SearchResultsPage(self.driver)
     search_results_page.get_site()
     cbr_page = page.CBRPage(self.driver)
     assert cbr_page.is_cbr_page(), 'Центральный банк Российской Федерации'
     cbr_page.get_reception()
     cbr_page.send_gratitude()
     cbr_page.about_page()
Exemplo n.º 21
0
    def test_search_valid_data(self):
        main_page = page.MainPage(self.driver)
        main_page.send_keys_to_searchbox('Amsterdam')
        main_page.select_range_dropdown('+ 5 km')
        main_page.select_from_dropdown('€ 75.000')
        main_page.select_uptil_dropdown('€ 500.000')
        main_page.click_on_search()

        search_result_page = page.SearchResultsPage(self.driver)
        result = search_result_page.are_results_found()
        self.assertTrue(result, "Search results not found!!")
        print("test_search_valid_data is PASSED!")
Exemplo n.º 22
0
    def test_image_input_search(self):

        imageLink = "https://c-ssl.duitang.com/uploads/item/201209/01/20120901083238_GiQaC.thumb.1000_0.jpeg"
        self.main_page.click_image_button()
        self.main_page.image_url_input(imageLink)
        self.main_page.image_search_click()

        search_result_page = page.SearchResultsPage(self.driver)
        search_result_page.check_image_search_result()

        assert search_result_page.check_image_search_result(
        ), "{} image search failed!".format(imageLink)
Exemplo n.º 23
0
    def test_search_tenzor_at_yandex_ru(self):

        #Загрузите главную страницу. В этом случае домашняя страница Python.org.
        main_page = page.MainPage(self.browser)
        #Checks if the word "Python" is in title
        assert main_page.is_title_matches(), "Мы не на Яндексе!"

        #Устанавливает текст текстового поля поиска на "pycon"
        main_page.search_text_element = "Тензор"
        main_page.click_go_button()
        search_results_page = page.SearchResultsPage(self.browser)
        
        #Проверяет, что страница результатов не пуста
        assert search_results_page.is_results_found(), "No results found."
    def test_search_in_python_org(self):
        """
        Tests python.org search feature. Searches for the word "pycon" then verified that some results show up.
        Note that it does not look for any particular text in search results page. This test verifies that
        the results were not empty.
        """

        #Load the main page. In this case the home page of Python.org.
        main_page = page.MainPage(self.driver)
        assert main_page.is_title_matches(), "python.org title doesn't match"
        main_page.search_text_element = "pycon\n"
        #main_page.click_go_button()
        search_results_page = page.SearchResultsPage(self.driver)
        assert search_results_page.is_results_found(), "No results found."
Exemplo n.º 25
0
    def test_search_in_python_org(self):

# Load the main page
    main_page = page.MainPage(self.driver)

# Checks if the word "python" is in title
    assert main_page.is_title_matches(), 
    main_page.search_text_element = "pycon"
    main_page.click_go_button()
    search_results_page = page.SearchResultsPage(self.driver)
    # Verify that the rsults page is not empty
    assert search_results_page.is_results_found(), 

    def tearDown(self):
        self.driver.close()
Exemplo n.º 26
0
 def test_search_invalid_data(self):
     searchInput = 'qopasdqqqq'
     main_page = page.MainPage(self.driver)
     main_page.send_keys_to_searchbox(searchInput)
     main_page.click_on_search()
     isErrorPresent = main_page.get_autocomplete_error()
     self.assertTrue(isErrorPresent,
                     "Error message did appear under Searchbox")
     main_page.click_on_search()
     search_result_page = page.SearchResultsPage(self.driver)
     expectedText = "We kunnen " + searchInput + " niet vinden"
     actualText = search_result_page.get_no_search_result_found_text()
     self.assertEqual(actualText, expectedText,
                      "Actual and Expected results are not equal")
     print("tests_search_invalid_data is PASSED!")
Exemplo n.º 27
0
 def test_search_for_maximum_budget(self):
     searchInput = 'Amsterdam'
     range_data = '+ 15 km'
     maximum_amt_from = '€ 2.000.000'
     maximum_amt_until = 'Geen maximum'
     main_page = page.MainPage(self.driver)
     main_page.send_keys_to_searchbox(searchInput)
     main_page.select_range_dropdown(range_data)
     main_page.select_from_dropdown(maximum_amt_from)
     main_page.select_uptil_dropdown(maximum_amt_until)
     main_page.click_on_search()
     search_result_page = page.SearchResultsPage(self.driver)
     result = search_result_page.are_results_found()
     self.assertTrue(result, "Search results not found!!")
     print("test_search_for_maximum_budget is PASSED!")
Exemplo n.º 28
0
 def test_search_in_python_org(self):
     self.driver.get("http://www.python.org")
     main_page = page.MainPage(self.driver)
     # use built in python asserts
     assert main_page.does_title_contain("Python"), "Title of page is not correct ..."
     # use the unittest assertions
     self.assertTrue(main_page.does_title_contain("Python"), "Title of page is not correct ...")
     # calls __set__ descriptor
     main_page.search_text_element = "pycon"
     # calls __get__ descriptor
     self.assertEqual(main_page.search_text_element, "pycon", "Wrong text in field.")
     main_page.click_go_button()
     search_results_page = page.SearchResultsPage(self.driver)
     assert search_results_page.are_results_found(), "No results found."
     search_results_page.click_go_home()
Exemplo n.º 29
0
 def test_dors_repository_index(self):
     """
     tests whether each of dor's repositories,
     is found on the same index, when the repository name
     is searched on github
     """
     USER_NAME = "doryalo"
     self.driver.get("https://github.com/")
     self.main_page = page.MainPage(self.driver)
     self.main_page.commit_search(USER_NAME)
     self.search_result_page = page.SearchResultsPage(self.driver)
     self.search_result_page.filter_results_by_user_name()
     self.search_result_page.navigate_to_user_page(USER_NAME)
     self.user_page = page.UserProfilePage(self.driver)
     self.analyze_all_repositories(
         repositories_list=self.user_page.get_all_repositories_elements())
    def test_search_artist(self):
        """
        Tests python.org search feature. Searches for the word "pycon" then verified that some results show up.
        Note that it does not look for any particular text in search results page. This test verifies that
        the results were not empty.
        """

        #Load the main page. In this case the home page of Python.org.
        main_page = page.MainPage(self.driver)
        #Checks if the word "Python" is in title
        assert main_page.is_title_matches(), "kkbox title doesn't match."
        #Sets the text of search textbox to "pycon"
        main_page.search_text_element = u"韋禮安"
        main_page.click_go_button()
        search_results_page = page.SearchResultsPage(self.driver)
        #Verifies that the results page is not empty
        assert search_results_page.is_results_found(), "No results found."