class Test_LoginPage(): def setup(self): self.links = Links() self.locators = Locator() self.functions = Functions(self.driver) self.login_page = LoginPage(self.driver) self.driver.get(self.links.login) @pytest.mark.smoke @pytest.mark.lol @pytest.mark.sanity @allure.title("Correct login") @allure.severity("Critical") def test_login(self): with allure.step("Login in account"): self.login_page.login_in_account() self.functions.getScreenshot("Login") with allure.step("Account page title checking"): self.functions.TitleCheck(Locator.ACCOUNT_INFO)
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")
class Test_Home(): def setup(self): self.links = Links() self.locators = Locator() self.functions = Functions(self.driver) self.home = Home(self.driver) self.driver.get(self.links.home) @pytest.mark.smoke @pytest.mark.sanity @allure.title("Header menu checking") @allure.severity("Critical") def test_header_menu(self): # Here is wroten open test, because of we have got a problem with HTTPConnection when we try to click on the header's button in turn with allure.step("Checking about us button"): self.functions.getClick(self.locators.ABOUT_US) self.functions.TitleCheck("About Us - SimpleTollFree") self.driver.back() with allure.step("Checking contact us button"): self.functions.getClick(self.locators.CONTACT_US) self.functions.TitleCheck("Contact Us - SimpleTollFree") self.driver.back() with allure.step("Checking faq button"): self.functions.getClick(self.locators.FAQ) self.functions.TitleCheck("FAQ - SimpleTollFree") self.driver.back() with allure.step("Checking home button"): self.functions.getClick(self.locators.HOME) self.functions.TitleCheck("Toll Free Conferencing – Simple Toll Free Conferencing") self.driver.back() @pytest.mark.smoke @pytest.mark.sanity @allure.title("Bottom menu checking") @allure.severity("Critical") def test_bottom_menu(self): with allure.step("Checking about us bottom button"): self.home.click_on_about_us_bottom_button() with allure.step("Checking contact us bottom button"): self.home.click_on_contact_us_bottom_button() with allure.step("Checking faq bottom button"): self.home.click_on_faq_bottom_button() with allure.step("Checking home bottom button"): self.home.click_on_home_bottom_button() @pytest.mark.smoke @pytest.mark.sanity @allure.title("Sign up button checking") @allure.severity("Critical") def test_sign_up_button_checking(self): with allure.step("Click on sign up button checking"): self.home.click_on_sign_up_button() @pytest.mark.smoke @pytest.mark.sanity @allure.title("Login button checking") @allure.severity("Critical") def test_login_button_checking(self): with allure.step("Click on login button"): self.home.click_on_login_button() @pytest.mark.smoke @pytest.mark.sanity @allure.title("Logo link checking") @allure.severity("Minor") def test_logo_link_checking(self): with allure.step("Click on sign up button"): self.home.click_on_sign_up_button() with allure.step("Click on login button checking"): self.home.click_on_logo_link()