Exemplo n.º 1
0
class LoginTests(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def classSetup(self, oneTimeSetUp):
        self.lp = LoginPage(self.driver)
        self.ts = CheckStatus(self.driver)

    @pytest.mark.run(order=2)
    def test_validLogin(self):
        self.lp.login("*****@*****.**", "abcabc")
        result1 = self.lp.verifyLoginTitle()
        self.ts.mark(result1, "Title Verification")
        result2 = self.lp.verifyLoginSuccessful()
        self.ts.markFinal("test_validLogin", result2, "Login Verification")

    @pytest.mark.run(order=1)
    def test_InvalidLogin(self):
        self.lp.logout()
        self.lp.login("*****@*****.**", "abcabcabc")
        result = self.lp.verifyLoginFailed()
        assert result == True
Exemplo n.º 2
0
class LoginTests(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def classLevelSetup(self, oneTimeSetUp):
        self.lp = LoginPage(self.driver)
        self.ts = CheckStatus(self.driver)

    @pytest.mark.run(order=2)
    def test_validLogin(self):

        self.lp.login("*****@*****.**", "abcabc")
        result1 = self.lp.verifyTitle()
        self.ts.mark(result1, "Title is incorrect")

        result2 = self.lp.verifyLoginSuccessful()
        self.ts.markFinal("test_ValidLogin", result2,
                          "Some problem with test_Valid Login")

    @pytest.mark.run(order=1)
    def test_InvalidLogin(self):

        #self.driver.get(self.baseURL)
        self.lp.login("*****@*****.**", "353abcabc")
        result = self.lp.verifyLoginFailed()
        self.ts.mark(result, " Login is unsuccessfull")