Beispiel #1
0
class Test_ContactUs():
    def setup(self):
        self.links = Links()
        self.functions = Functions(self.driver)
        self.contact_page = ContactUs(self.driver)

        self.driver.get(self.links.contact_us)

    @pytest.mark.smoke
    @pytest.mark.sanity
    @allure.title("Send form")
    @allure.severity("Critical")
    def test_send_form(self):
        with allure.step("Send contact us form"):
            self.contact_page.send_form("Test", "*****@*****.**", "89999999999",
                                        "Hello")
            self.contact_page.submit_button_click()
            self.functions.WaitLocate(Locator.YANDEX_PAGE)
            self.functions.getScreenshot("form_sent")

    @pytest.mark.sanity
    @allure.title("Required_fields")
    @allure.severity("Minor")
    def test_required_fields(self):
        with allure.step("Checking required fields on contact form"):
            self.contact_page.submit_button_click()
            self.functions.WaitLocate(Locator.R_FIELD)
            self.functions.getScreenshot("req_fields")

    @pytest.mark.sanity
    @allure.title("Name field checking")
    @allure.severity("Minor")
    def test_name_field(self):

        with allure.step("Checking Name field"):
            self.contact_page.name_field_send_text("         ")

        with allure.step("Enter the remaining fields"):
            self.contact_page.email_field_send_text("*****@*****.**")
            self.contact_page.phone_field_send_text("8999999999999")
            self.contact_page.comment_field_send_text("Hello test")

        with allure.step("Send incorrect form"):
            self.contact_page.submit_button_click()

        with allure.step("Checking name field again"):
            self.functions.WaitLocate(Locator.R_FIELD)
            self.functions.ElementSelection(Locator.R_FIELD)

        with allure.step("Take screenshot"):
            self.functions.getScreenshot("invalid_name")

    @pytest.mark.sanity
    @allure.title("Phone field checking")
    @allure.severity("Minor")
    def test_phone_field(self):

        with allure.step("Checking Phone field"):
            self.contact_page.phone_field_send_text("899999")

        with allure.step("Enter the remaining fields"):
            self.contact_page.email_field_send_text("*****@*****.**")
            self.contact_page.name_field_send_text("Hello")
            self.contact_page.comment_field_send_text("Hello test")

        with allure.step("Send incorrect form"):
            self.contact_page.submit_button_click()

        with allure.step("Checking name field again"):
            self.functions.WaitLocate(Locator.INVALID_NUMBER)
            self.functions.ElementSelection(Locator.INVALID_NUMBER)

        with allure.step("Take screenshot"):
            self.functions.getScreenshot("invalid_nimber")
Beispiel #2
0
class Test_SignUp():

    def setup(self):
        self.links = Links()
        self.functions = Functions(self.driver)
        self.signup_page = SignUpPage(self.driver)
        self.yandex_page = YandexLogin(self.driver)

        self.driver.get(self.links.sign_up)

    @pytest.mark.sanity
    @pytest.mark.smoke
    @allure.title("Successful registration")
    @allure.severity("Critical")
    def test_signup(self):

        with allure.step("Title checking"):
            self.functions.TitleCheck("Registration Page - SimpleTollFree")

        with allure.step("Enter Customer Information"):
            self.signup_page.enter_customer_info()
            self.functions.getScreenshot("CustomerInfo")

        with allure.step("Enter Customer Address"):
            self.signup_page.enter_customer_address()
            self.functions.getScreenshot("CustomerAddress")

        with allure.step("Enter Card Information"):
            self.signup_page.enter_card_information()
            self.functions.getScreenshot("CardInfo")

        with allure.step("Click submit"):
            self.signup_page.submit_click()

        with allure.step("Successful registration"):
            self.functions.WaitLocate(Locator.THANK_YOU)
            self.functions.TitleCheck("Account Information - SimpleTollFree")
            self.functions.getScroll("200")
            self.signup_page.take_data_for_login()
            self.functions.getScreenshot("registration")

        with allure.step("Checking letter"):
            self.yandex_page.Autorization(Data.TEST_LOGIN, Data.TEST_PASSWORD)
            self.yandex_page.CheckLetter()
            self.functions.getScroll("400")
            self.signup_page.checking_information()
            self.signup_page.create_file_with_subscriptions()
        with allure.step("Clear email"):
            self.yandex_page.EmptyEmail()

    @pytest.mark.sanity
    @allure.title("Required fields")
    @allure.severity("Minor")
    def test_required_fields(self):

        with allure.step("Title checking"):
            self.functions.TitleCheck("Registration Page - SimpleTollFree")

        with allure.step("Required fields"):
            self.signup_page.required_fields()
            self.functions.getScreenshot("required_fields")
Beispiel #3
0
class Test_History():

    def setup(self):
        self.links = Links()
        self.locators = Locator()
        self.functions = Functions(self.driver)
        self.login_page = LoginPage(self.driver)
        self.history_page = History(self.driver)

        self.driver.get(self.links.login)
        self.login_page.login_in_account()
        self.driver.get(Links.recordings)

    @pytest.mark.smoke
    @pytest.mark.player1
    @pytest.mark.sanity
    @allure.title("Player checking")
    @allure.severity("Critical")
    @allure.link(url="https://testlink.int/linkto.php?tprojectPrefix=SM&item=testcase&id=STF",
                 name="Test Link")  # Write link on test-case in Test Link
    def test_player_checking(self):

        # with allure.step("Opening recording"):
        #     self.history_page.open_recording()
        #     self.functions.getScreenshot("open_recording")

        with allure.step("Opening recording"):
            self.history_page.play_recording()
            self.functions.getScreenshot("play_screenshot")

        with allure.step("Assertion of recording work"):
            self.history_page.assert_of_recording_work()
            self.functions.getScreenshot("playingRec")

        with allure.step("Click on pause button"):
            self.history_page.click_on_pause_button()
            self.functions.getScreenshot("Pause_button")

        with allure.step("Click on stop button"):
            self.history_page.click_on_stop_button()
            self.functions.getScreenshot("click_on_stop_button")

        with allure.step("Click on mute button"):
            self.history_page.click_on_mute_button()
            self.functions.getScreenshot("click_on_mute_button")

        with allure.step("Click on unmute button"):
            self.history_page.click_on_unmute_button()
            self.functions.getScreenshot("click_on_unmute_button")

        with allure.step("Click on repeat button"):
            self.history_page.click_on_repeat_button()
            self.functions.getScreenshot("click_on_repeat_button")

        with allure.step("Click on repeat off button"):
            self.history_page.click_on_repeat_off_button()
            self.functions.getScreenshot("click_on_repeat_off_button")

        with allure.step("Click on download pdf button"):
            self.history_page.click_on_download_pdf_button()

        # with allure.step("Close recording"):
        #     self.history_page.close_recording()



    @pytest.mark.smoke # Declare a marker to run as a Smoke test
    @pytest.mark.sanity # Declare a marker to run as a Sanity test
    @allure.title("Positive filtering") # Set the name of the test
    @allure.description("") # We describe the test if necessary (depending on the complexity of the script)
    @allure.severity("Critical") # Set test priority
    @allure.link(url="https://testlink.int/linkto.php?tprojectPrefix=SM&item=testcase&id=STF", name="Test Link") # Write link on test-case in Test Link
    def test_positive_filtering(self): # Give a clear name to the class of our test

        with allure.step("Enter start date"): # In this string we set the name of the step
            self.history_page.enter_start_date() # Call the desired method from Page, with clear content and class name

        with allure.step("Enter end date"):
            self.history_page.enter_end_date()

        with allure.step("Click on search button"):
            self.history_page.click_on_search_button()

        with allure.step("Wait for opening recording"):
            self.functions.WaitLocate(Locator.OPEN_RECORDING)