示例#1
0
    def test_successful_login(self):
        """
        Tests a successful login attempt
        """

        #Load the logon page.
        login_page = LogonPage(self.driver)
        login_page.wait_for_load()

        #Pass in a bogus username and password
        login_page.username().set_value(Constants.testusername)
        login_page.password().set_value(Constants.testpassword)

        #Attempt to login
        login_page.click_submit_button()

        #Verify the main page is loaded and the welcome message
        main_page = MainPage(self.driver)
        main_page.wait_for_load()

        welcome_message = main_page.get_welcome_message()

        assert_equal(welcome_message, "Welcome, Art Venere")
    def test_login_failed(self):
        """
        Tests a failed login attempt
        """

        #Load the logon page.
        login_page = LogonPage(self.driver)
        login_page.wait_for_load()

        #Pass in a bogus username and password
        login_page.username().set_value("bogususername")
        login_page.password().set_value("boguspassword")

        #Attempt to login
        login_page.click_submit_button()

        #Wait for 10 seconds for the server to respond to the login attempt
        time.sleep(10)

        #Get the error message
        error_message = login_page.get_error_message()

        assert_equal(error_message, "The username and password combination is not correct")
    def test_successful_login(self):
        """
        Tests a successful login attempt
        """

        #Load the logon page.
        login_page = LogonPage(self.driver)
        login_page.wait_for_load()

        #Pass in a bogus username and password
        login_page.username().set_value(Constants.testusername)
        login_page.password().set_value(Constants.testpassword)

        #Attempt to login
        login_page.click_submit_button()

        #Verify the main page is loaded and the welcome message
        main_page = MainPage(self.driver)
        main_page.wait_for_load()

        welcome_message = main_page.get_welcome_message()

        assert_equal(welcome_message, "Welcome, Art Venere")
示例#4
0
    def test_login_failed(self):
        """
        Tests a failed login attempt
        """

        #Load the logon page.
        login_page = LogonPage(self.driver)
        login_page.wait_for_load()

        #Pass in a bogus username and password
        login_page.username().set_value("bogususername")
        login_page.password().set_value("boguspassword")

        #Attempt to login
        login_page.click_submit_button()

        #Wait for 10 seconds for the server to respond to the login attempt
        time.sleep(10)

        #Get the error message
        error_message = login_page.get_error_message()

        assert_equal(error_message,
                     "The username and password combination is not correct")
示例#5
0
 def setUp(self):
     self.driver = FootlooseWebDriver().get_driver()
     LogonPage(self.driver).login_in()
    def setUp(self):
        self.driver = FootlooseWebDriver().get_driver()

        # All test require successful login attempt
        LogonPage(self.driver).login_in()