コード例 #1
0
    def delete_repo(self) -> pages.MainPage:
        self._scroll_to_bottom()
        self._await_element_to_appear(Tag.Summary, (Param.Text, Condition.Contains, "Delete this repository")).click()

        self._fill_form(("verify", f"{self._username}/{self._name}"))
        self._await_element_to_enable(Tag.Button, (Param.Type, Condition.Equals, "submit"), (Param.Class, Condition.Contains, "btn-danger")).click()
        return pages.MainPage(self._driver, self._username)
コード例 #2
0
 def logout(self) -> pages.MainPage:
     self._find_visible_enabled(Tag.Summary,
                                (Param.Label, Condition.Contains,
                                 "View profile and more")).click()
     self._await_element_to_appear(
         Tag.Button, (Param.Text, Condition.Contains, "Sign out")).click()
     return pages.MainPage(self._driver)
コード例 #3
0
    def test_001_SumUp_Login(self):
        Reporting.TestLog("Create all pages and navigate")
        main_page = pages.MainPage(self.driver,
                                   'https://me.sumup.com/en-gb/login')
        dashboard_page = pages.DashboardPage(self.driver)

        main_page.login("*****@*****.**", "qataskqatask")
        label_text = dashboard_page.get_label_text()
        assert "find anything that matches your search." in label_text
コード例 #4
0
ファイル: test.py プロジェクト: GNKirov/KIWIpy101
    def test_search_for_non_existing(self):
        # create main page and navigate to it
        main_page = pages.MainPage(self.driver)
        main_page.search_for('banitza')

        # wait for search results to load
        time.sleep(7)
        search_results = pages.SearchResults(self.driver)
        # .results is empty
        assert 0 == len(search_results.results())
コード例 #5
0
    def test_vaccine_appt(self):
        '''This all has to be done in one single test due to hidden redirection links'''
        #Load the pages classes
        main_page = pages.MainPage(self.driver, self.wait, self.timeslots,
                                   self.first, self.last, self.code,
                                   self.number, self.address, self.email,
                                   self.dob)
        appt_page = pages.PageTwo(self.driver, self.wait, self.timeslots,
                                  self.first, self.last, self.code,
                                  self.number, self.address, self.email,
                                  self.dob)
        info_page = pages.PageThree(self.driver, self.wait, self.timeslots,
                                    self.first, self.last, self.code,
                                    self.number, self.address, self.email,
                                    self.dob)
        remaining_pages = pages.RemainingPages(self.driver, self.wait,
                                               self.timeslots, self.first,
                                               self.last, self.code,
                                               self.number, self.address,
                                               self.email, self.dob)

        #assert main_page.is_title_matches()

        #find appt and click next
        main_page.is_appt_available()
        main_page.click_primary_button()

        #find best appt time and click next
        appt_page.get_best_appt_time()
        appt_page.click_next_button()
        #appt_page.did_we_get_appt()

        #fill out form page and click next
        info_page.fill_personal_info()
        info_page.click_next_button()

        #fill out rest of the pages
        #ethnicity page
        remaining_pages.fill_ethnicity_info()
        remaining_pages.click_next_button()
        #accomodations page
        remaining_pages.fill_accomdations_info()
        remaining_pages.click_next_button()
        #optional 2 pages
        remaining_pages.click_next_button()
        remaining_pages.click_next_button()
        #screening page
        remaining_pages.fill_screening_info()
        remaining_pages.click_next_button()
        #almost done page
        remaining_pages.click_continue_button()
        #registration page
        remaining_pages.click_register_button()
        #save ticket page
        remaining_pages.click_primary_button()
コード例 #6
0
    def test_search_in_privatmarket(self):
        main_page = pages.MainPage(self.driver)

        assert main_page.is_title_matches(
        ), "ПриватМаркет title doesn't match."

        main_page.search_text_element = "ШКАФ"
        main_page.click_search_button()

        search_results_page = pages.SearchResultsPage(self.driver)

        assert search_results_page.is_results_found(
        ), "По запросу «шкаф» найдено"
コード例 #7
0
ファイル: test.py プロジェクト: GNKirov/KIWIpy101
    def test_search_for_tutorial_should_work(self):
        # create main page and navigate to it
        main_page = pages.MainPage(self.driver)
        main_page.search_for('tutorial')

        # wait for search results to load
        time.sleep(7)
        search_results = pages.SearchResults(self.driver)
        # .results is a list of <a> tags
        assert search_results.results()[0].get_attribute('href') == 'https://www.python.org/doc/newstyle'
        assert search_results.results()[0].text == 'New-style Classes'

        results = search_results.results()
        assert results[0].text == 'New-style Classes'
コード例 #8
0
    def test_search_in_python(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 = pages.MainPage(self.driver)
        #Checks if the word "Python" is in title
        assert main_page.is_title_matches()
         #Sets the text of search textbox to "pycon"
        main_page.search_text_element = "pycon"
        time.sleep(5)
        main_page.click_go_button()
        search_results_page = pages.SearchResults(self.driver)
        time.sleep(5)
        #Verifies that the results page is not empty
        assert search_results_page.is_results_found(), "No Results found"
コード例 #9
0
    def test_login_compose(self):
        """
        Test actions:
        - login on main page https://mail.ru/
        - open compose window
        - compose and send email
        - check sending email
        """
        main_page = pages.MainPage(self.driver)
        main_page.login('mouse17_89', 'pass')
        auth_result = main_page.is_login_success()
        assert auth_result is True, f'Authorization failed. Error: {auth_result}.'

        inbox_page = pages.InboxPage(self.driver)
        inbox_page.click_compose_button()

        compose_window = pages.ComposeWindow(self.driver)
        assert compose_window.is_compose_window_loaded(), "Compose window is not loaded."
        compose_window.create_and_send_message('*****@*****.**', 'test message', 'Hello!')

        sent_window = pages.SentWindow(self.driver)
        assert sent_window.is_sent_window_loaded(), "Sent window is not loaded."
        assert sent_window.is_msg_sent(), "Message is not sent."
コード例 #10
0
ファイル: fixtures.py プロジェクト: mnalband/behave-tests
def get_browser(context, *args, **kwargs):
    context.browser = Chrome(*args, **kwargs)
    context.main_page = pages.MainPage(driver=context.browser)
    yield context.browser
    context.browser.quit()
コード例 #11
0
 def test_invalid_login(self):
     main_page = pages.MainPage(self.driver)
     main_page.click_entrance_button()
     failed_login_page = main_page.log_in(config.FALSE_USERNAME, config.FALSE_PASSWORD)
     assert failed_login_page.login_error_message_presence(), 'login error message is not displayed'
コード例 #12
0
 def test_login(self):
     main_page = pages.MainPage(self.driver)
     main_page.click_entrance_button()
     main_page.log_in(config.USERNAME, config.PASSWORD)
     assert main_page.user_bar_presence(), 'fail to login'
コード例 #13
0
 def login(self, login: str, password: str) -> pages.MainPage:
     self._fill_form(("login", login), ("password", password))
     self._find_visible_enabled(Tag.Input, (Param.Name, Condition.Equals, "commit")).click()
     return pages.MainPage(self._driver, login)
コード例 #14
0
 def test_entrance_window(self):
     main_page = pages.MainPage(self.driver)
     assert main_page.click_entrance_button(), 'login page is not displayed'
コード例 #15
0
 def verify_main_page_text(self, title_text, body_text):
     self.main = pages.MainPage(self.driver)
     self.assertEqual(title_text, self.main.get_page_title())
     self.assertIn(body_text, self.main.get_body_text().replace("\n", ''))
コード例 #16
0
 def open_main_page(self):
     self.main = pages.MainPage(self.driver)
     self.main.open_main_page()
コード例 #17
0
def main_page(driver):
	driver.get('https://target.my.com/')
	yield pages.MainPage(driver)
コード例 #18
0
 def open_article_by_search(self, search_term):
     self.main = pages.MainPage(self.driver)
     self.main.open_main_page()
     self.main.open_article_by_search(search_term)
コード例 #19
0
 def navigate_to_current_events_page(self):
     self.main = pages.MainPage(self.driver)
     self.main.open_main_page()
     self.main.click_left_panel_link("Current events")
コード例 #20
0
 def return_to_main(self) -> pages.MainPage:
     self._navigate("https://github.com/")
     return pages.MainPage(self._driver, self._username)
コード例 #21
0
 def test_title_of_main_page(self):
     main_page = pages.MainPage(self.driver)
     self.assertTrue(main_page.is_title_matches(), "title doesn't match.")