Example #1
0
class TestHomePage(TestBase):
    def test_home_page_title(self):
        self.loginpage = LoginPage(self.driver)
        homepage = self.loginpage.do_login(TestData.USERNAME,
                                           TestData.PASSWORD)
        actual_title = homepage.get_home_page_title()
        assert actual_title == TestData.HOME_PAGE_TITLE

    def test_home_page_welcome_text(self):
        self.loginpage = LoginPage(self.driver)
        homepage = self.loginpage.do_login(TestData.USERNAME,
                                           TestData.PASSWORD)
        welcome_text = homepage.get_welcome_name_text()
        assert "Welcome" in welcome_text

    def test_home_page_tabs(self):
        self.loginpage = LoginPage(self.driver)
        homepage = self.loginpage.do_login(TestData.USERNAME,
                                           TestData.PASSWORD)
        actual_tabs = homepage.get_home_page_tab_names()
        assert actual_tabs == TestData.HOME_PAGE_TABS

    def test_home_page_subscribe_is_available(self):
        self.loginpage = LoginPage(self.driver)
        homepage = self.loginpage.do_login(TestData.USERNAME,
                                           TestData.PASSWORD)
        assert homepage.is_subscribe_available()

    def test_home_page_header_text(self):
        self.loginpage = LoginPage(self.driver)
        homepage = self.loginpage.do_login(TestData.USERNAME,
                                           TestData.PASSWORD)
        header_text = homepage.get_header_name()
        assert header_text == TestData.HOME_HEADER_NAME
class Test_Home(BaseTests):
    def test_home_page_title(self):
        """I will get title of this page after login so lets create object of LoginPage"""
        self.loginPage = LoginPage(self.driver)
        homePage = self.loginPage.do_login(TestData.USER_NAME,
                                           TestData.PASS_WORD)
        title = homePage.get_home_page_title(TestData.HOME_PAGE_TITLE)
        assert title == TestData.HOME_PAGE_TITLE

    def test_homepage_header(self):
        self.loginPage = LoginPage(self.driver)
        homePage = self.loginPage.do_login(TestData.USER_NAME,
                                           TestData.PASS_WORD)
        header = homePage.get_header_value()
        assert header == TestData.HOME_PAGE_HEADER

    def test_homepage_account_name(self):
        self.loginPage = LoginPage(self.driver)
        homePage = self.loginPage.do_login(TestData.USER_NAME,
                                           TestData.PASS_WORD)
        account_name = homePage.get_account_name_value()
        assert account_name == TestData.ACCOUNT_NAME

    def test_homepage_help_icon(self):
        self.loginPage = LoginPage(self.driver)
        homePage = self.loginPage.do_login(TestData.USER_NAME,
                                           TestData.PASS_WORD)
        assert homePage.is_help_icon_exist()

    def test_hover(self):
        self.loginPage = LoginPage(self.driver)
        homePage = self.loginPage.do_login(TestData.USER_NAME,
                                           TestData.PASS_WORD)
        assert homePage.do_hover()
class TestLogin(BaseLoginTest):
    def test_login(self):
        self.loginPage = LoginPage(self.driver)
        self.loginPage.do_login(TestData.STANDARD_USER_NAME, TestData.PASSWORD)
        self.homePage = HomePage(self.driver)
        assert self.homePage.get_products_title() == "Products"
        self.sidebar = SideBarPage(self.driver)
        self.sidebar.do_logout()

    def test_logininvalidpassword(self):
        self.loginPage = LoginPage(self.driver)
        self.loginPage.do_login(TestData.STANDARD_USER_NAME, "InvalidPassword")
        assert self.loginPage.get_error_message() == "Epic sadface: Username and password do " \
                                                     "not match any user in this service"

    def test_loginlockeduser(self):
        self.loginPage = LoginPage(self.driver)
        self.loginPage.do_login(TestData.LOCKED_USER_NAME, TestData.PASSWORD)
        assert self.loginPage.get_error_message(
        ) == "Epic sadface: Sorry, this user has been locked out."

    def test_loginwithnousername(self):
        self.loginPage = LoginPage(self.driver)
        self.loginPage.do_login("", TestData.PASSWORD)
        assert self.loginPage.get_error_message(
        ) == "Epic sadface: Username is required"

    def test_loginwithnopassword(self):
        self.loginPage = LoginPage(self.driver)
        self.loginPage.do_login(TestData.STANDARD_USER_NAME, "")
        assert self.loginPage.get_error_message(
        ) == "Epic sadface: Password is required"
class Test_Login_Logout(BaseTest):
    """Login Test"""
    def test_forgot_pwd_link_visible(self):
        self.loginPage = LoginPage(self.driver)
        flag = self.loginPage.is_forgot_pwd_link_visible()
        assert flag

    def test_login_page_title(self):
        self.loginPage = LoginPage(self.driver)
        title = self.loginPage.get_login_page_title(TestData.LOGIN_PAGE_TITLE)
        assert title == TestData.LOGIN_PAGE_TITLE

    def test_login(self):
        self.loginPage = LoginPage(self.driver)
        self.loginPage.do_login(TestData.USERNAME, TestData.PASSWORD)

    """Logout Test"""

    def test_dashboard_tab_visible(self):
        self.homePage = HomePage(self.driver)
        flag = self.homePage.is_dashboard_tab_visible()
        assert flag

    def test_home_page_title(self):
        self.homePage = HomePage(self.driver)
        title = self.homePage.get_home_page_title(TestData.HOME_PAGE_TITLE)
        assert title == TestData.LOGIN_PAGE_TITLE

    def test_logout(self):
        self.homePage = HomePage(self.driver)
        self.homePage.do_logout()
Example #5
0
class TestLogin(Basic_test):
    def test_page_title(self):
        self.loginpage = LoginPage(self.driver)
        title_driver_gettitle = self.loginpage.get_title_of_page(
            TestData.TITLE_PROJECT
        )  # here we are reciveing title via driver.title and sending actual title to LoginPage get_title_of_page
        assert title_driver_gettitle == TestData.TITLE_PROJECT

    def test_text_on_page(self):
        self.loginpage = LoginPage(self.driver)
        assert TestData.TEXT in self.loginpage.is_text_visible().text

    def test_name_text_box(self):
        self.loginpage = LoginPage(self.driver)
        flag = self.loginpage.is_name_visible()
        assert flag

    def test_email_text_box(self):
        self.loginpage = LoginPage(self.driver)
        flag = self.loginpage.is_email_visible()
        assert flag

    def test_check_box_display(self):
        self.loginpage = LoginPage(self.driver)
        flag = self.loginpage.is_checkbox_visble()
        assert flag

    def test_submit_button(self):
        self.loginpage = LoginPage(self.driver)
        flag = self.loginpage.is_submit_visible()
        assert flag

    def test_successfull_login(self):
        self.loginpage = LoginPage(self.driver)
        self.loginpage.do_login(TestData.USER_NAME, TestData.EMAIL)
Example #6
0
class TestLoginPage(TestBase):
    def test_login_page_title(self):
        self.loginpage = LoginPage(self.driver)
        actual_title = self.loginpage.get_login_page_title()
        assert actual_title == TestData.LOGIN_PAGE_TITLE

    def test_forgot_password_availability(self):
        self.loginpage = LoginPage(self.driver)
        flag = self.loginpage.forgot_password_link_available()
        assert flag

    def test_login_orange_hrm(self):
        self.loginpage = LoginPage(self.driver)
        self.loginpage.do_login(TestData.USERNAME, TestData.PASSWORD)
Example #7
0
class Test_Login(BaseTest):
    def test_signup_link_visible(self):
        self.loginPage = LoginPage(self.driver)
        flag = self.loginPage.is_signup_link_exist()
        assert flag

    def test_login_page_title(self):
        self.loginPage = LoginPage(self.driver)
        title = self.loginPage.get_title(TestData.LOGIN_PAGE_TITLE)
        assert title == TestData.LOGIN_PAGE_TITLE

    def test_login(self):
        self.loginPage = LoginPage(self.driver)
        self.loginPage.do_login(TestData.USER_NAME, TestData.PASSWORD)
class Test_Login(BaseTest):

    def test_signup_link_visible(self):
        self.loginPage = LoginPage(self.driver)
        flag = self.loginPage.is_signUp_link_exist()
        assert flag

    def test_login_page_title(self):
        self.loginPage = LoginPage(self.driver)
        title = "CRMPRO  - CRM software for customer relationship management, sales, and support."
        # self.loginPage.get_title(TestData.LOGIN_PAGE_TITLE)
        assert title == TestData.LOGIN_PAGE_TITLE

    def test_login(self):
        self.loginPage = LoginPage(self.driver)
        self.loginPage.do_login(TestData.USER_NAME, TestData.PASSWORD)
Example #9
0
class Test_Login(BaseTest):
    data = ReadExcelData(file_location="../testData/testdata_sites.xlsx",
                         sheet_name="Websites").get_data()
    print(len(data))

    @pytest.mark.parametrize('arg1', data)
    def test_login(self, arg1):
        self.loginpage = LoginPage(self.driver)
        self.loginpage.do_login(arg1['Site URL'], arg1['email'])
        self.results_page = ResultsPage(self.driver)
        scores = self.results_page.get_results()
        final_result = self.results_page.validate_score(scores)
        if final_result == False:
            self.driver.save_screenshot(f"../screenshots/" + arg1['Testcase'] +
                                        ".png")
        assert final_result
Example #10
0
class Test_Login(BaseTests):
    def test_forgot_password_visible(self):
        """ Create object of LoginPage class """
        self.loginPage = LoginPage(self.driver)
        """With this reference I will call all the methods which are in LoginPage class"""
        flag = self.loginPage.is_forgot_password_exist(
        )  # store in a boolean lets call it flag
        assert flag

    def test_login_page_title(self):
        self.loginPage = LoginPage(self.driver)
        title = self.loginPage.get_title(TestData.LOGIN_PAGE_TITLE)
        assert title == TestData.LOGIN_PAGE_TITLE

    def test_login(self):
        self.loginPage = LoginPage(self.driver)
        self.loginPage.do_login(TestData.USER_NAME, TestData.PASS_WORD)
Example #11
0
class Test_Login(BaseTest):
    def test_signup_link_visible(self):
        # Create the Object of LoginPage Class
        self.loginPage = LoginPage(self.driver)

        # With the help of self.loginPage, call all the methods in LoginPage Class
        flag = self.loginPage.is_signup_link_exist()
        assert flag

    def test_login_page_title(self):
        self.loginPage = LoginPage(self.driver)
        title = self.loginPage.get_title(TestData.LOGIN_PAGE_TITLE)
        assert title == TestData.LOGIN_PAGE_TITLE

    def test_login(self):
        self.loginPage = LoginPage(self.driver)
        self.loginPage.do_login(TestData.USER_NAME, TestData.PASSWORD)
Example #12
0
class TestLogin(BaseTest):
    def test_login_page_title(self):
        self.loginPage = LoginPage(self.driver)
        title = self.loginPage.get_title(TestData.LOGIN_PAGE_TITLE)
        assert title == TestData.LOGIN_PAGE_TITLE

    def test_login(self):
        self.loginPage = LoginPage(self.driver)
        self.loginPage.do_login(TestData.USER_NAME, TestData.PASSWORD)
        self.loginPage.is_visible(HomePage.WELCOME_LINK)

    def test_login_invalid_username_and_an_invalid_password(self):
        self.loginPage = LoginPage(self.driver)
        self.loginPage.do_login(TestData.USER_NAME_INVALID,
                                TestData.PASSWORD_INVALID)
        self.loginPage.is_visible(LoginPage.ERROR_MSG)

    def test_login_valid_username_and_empty_password(self):
        self.loginPage = LoginPage(self.driver)
        self.loginPage.do_login_empty_password(TestData.USER_NAME)
        self.loginPage.is_invisible(HomePage.WELCOME_LINK)
Example #13
0
class TestForm(Basic_test):

    def test_title_Page(self):
        self.projectpage = ProjectPage(self.driver)
        self.loginpage= LoginPage(self.driver)
        self.loginpage.do_login(TestData.USER_NAME,TestData.EMAIL)
        self.formpage = self.projectpage.goto_form_page()
        title_driver_gettitle = self.formpage.get_page_title(TestData.TITELE_ANGULAR)
        assert title_driver_gettitle == TestData.TITELE_ANGULAR

    def test_file_form(self):
        self.projectpage = ProjectPage(self.driver)
        self.loginpage = LoginPage(self.driver)
        self.loginpage.do_login(TestData.USER_NAME, TestData.EMAIL)
        self.formpage = self.projectpage.goto_form_page()
        self.formpage.submitForm()
        flag = self.formpage.getSuccessMessage().text
        assert flag

    def test_read_success_message(self):
        self.projectpage = ProjectPage(self.driver)
        self.loginpage = LoginPage(self.driver)
        self.loginpage.do_login(TestData.USER_NAME, TestData.EMAIL)
        self.formpage = self.projectpage.goto_form_page()
        self.formpage.submitForm()
        assert "success" in self.formpage.readSuccessMessage().text
Example #14
0
class Test_Send_Message(BaseTest):
    @pytest.fixture(scope='class')
    def setup_module(self):
        self.login = LoginPage(self.driver)
        self.login.do_login(TestData.EMAIL, TestData.PASSWORD)
        self.pinSetUp = PinSetUpPage(self.driver)
        self.pinSetUp.setup_pin(TestData.PIN)
        yield
        self.logout = Helpers(self.driver)
        self.logout.logout()

    def test_message_is_available(self, setup_module):
        self.viewMessage = SendMessage(self.driver)
        flag = self.viewMessage.message_exists()
        assert flag

    def test_send_message(self, setup_module):
        self.viewMessage = SendMessage(self.driver)
        self.viewMessage.click_message()
        self.viewMessage.send_message(TestData.MESSAGE)
        sent_message = self.viewMessage.verify_message_sent()
        print("Result is", sent_message)
Example #15
0
class Test_Home(BaseTest):

    def test_home_page_titele(self):
        """
        For verifying the Home Page Title, first we need to login into application
        For logging in, already defined the credentials and required methods, we need to call the same
        We need to create the instance of Login Class and make use of it
        """

        self.logiPage = LoginPage(self.driver)
        # Login page constructor will be called and request for the driver
        # The driver will be provided to the Parent class constructor
        # After getting the login page reference, we can call all the methods of Login page

        homePage = self.logiPage.do_login(TestData.USER_NAME, TestData.PASSWORD)
        pageTitle = homePage.get_home_page_title(TestData.AUTH_PAGE_TITLE)
        assert pageTitle == TestData.AUTH_PAGE_TITLE

    def test_loging_auth_code_validate(self):
        self.logiPage = LoginPage(self.driver)
        homePage = self.logiPage.do_login(TestData.USER_NAME, TestData.PASSWORD)
        header = homePage.get_header_value()
        assert header == TestData.AUTH_PAGE_HEADER
class Test_PinSetup(BaseTest):
    def test_setUp_Pin(self):
        self.loginPage = LoginPage(self.driver)
        self.loginPage.do_login(TestData.EMAIL, TestData.PASSWORD)
        self.pinSetUp = PinSetUpPage(self.driver)
        self.pinSetUp.setup_pin(TestData.PIN)
 def test_login(self, init_driver):
     login = LoginPage(init_driver)
     login.do_login(LoginTestData.email, LoginTestData.password)
Example #18
0
 def test_h1_home_page_title_check(self):
     loginpage = LoginPage(self.driver)
     loginpage.do_login(TestData.USERNAME, TestData.PASSWORD)
     homepage = HomePage(self.driver)
     title = homepage.get_home_page_title(TestData.HOME_PAGE_TITLE)
     assert title == TestData.HOME_PAGE_TITLE