class LoginTests(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def classSetup(self, oneTimeSetUp):
        self.lp = LoginPage(self.driver)
        self.ts = TestStatus(self.driver)

    @pytest.mark.run(order=1)
    def test_validLogin(self):
        self.lp.login("*****@*****.**", "Today123")
        result1 = self.lp.verifyTitle()
        self.ts.mark(result1, "Title Verified")
        result2 = self.lp.verifyLoginSuccessful()
        self.ts.markFinal("test_validLogin", result2, "Login was successful")

    @pytest.mark.run(order=2)
    def test_invalidLogin(self):
        self.lp.login("*****@*****.**", "abcabcabc")
        result = self.lp.verifyLoginFailed()
        self.ts.markFinal("test_invalidLogin", result,
                          "Login was unsuccessful")
class LoginTests(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def classSetUp(self, OneTimeSetUP):
        self.lp = LoginPage(self.driver)
        self.tc = TestStatus(self.driver)

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

        self.driver.implicitly_wait(5)

        self.lp.login('*****@*****.**', 'abcabc')

        result1 = self.lp.verifyLoginTitle()
        # assert result1 == True
        self.tc.mark(result1, " Title is not correct")

        result2 = self.lp.verifyLoginSuccessful()
        # assert result2 == True
        self.tc.markFinal("test_ValidLogin", result2,
                          " Element not present here")

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

        self.driver.implicitly_wait(10)

        # INVALID DATA OPTIONS
        self.lp.logout()
        sleep(3)

        self.lp.login('test.email@com', 'qwe')

        #self.lp.login()
        #self.lp.login(username='******')
        #self.lp.login(userpassword='******')

        result = self.lp.verifyLiginFailed()
        assert result == True