Пример #1
0
class IMDGLoginTest(IMDGBaseTest):
    def setUp(self):
        super().setUp()

    def test_001_login_with_correct_credential(self):
        #Instantiate an object of LoginPage class. When the constructor of LoginPage
        #is called, it opens up the browser and navigates to Login Page of IMDA iCheck
        #then login using provided credential
        self.loginPage = LoginPage(self.driver)
        self.loginPage.login()

        #Assert that redirect to Home page with Extract name is visible at the page
        self.assertTrue(self.loginPage.is_visible(Locators.APP_NAME))

    @unittest.skip("Not first time login")
    def test_002a_first_time_login_then_logout(self):

        self.loginPage = LoginPage(self.driver)
        self.loginPage.login()

        # Asserting that claim application list is not present
        self.homePage = HomePage(self.loginPage.driver)
        self.assertFalse(
            self.homePage.is_clickable(Locators.CLAIM_APPLICATION_ROW_2))
        self.homePage.logout()

        #Asserting redirection to Login page with Login button is visible
        self.assertTrue(self.homePage.is_visible(Locators.LOGIN_PAGE_TITLE))

    def test_002b_login_then_logout(self):
        self.loginPage = LoginPage(self.driver)
        self.loginPage.login()

        self.homePage = HomePage(self.loginPage.driver)
        self.assertTrue(
            self.homePage.is_clickable(Locators.CLAIM_APPLICATION_ROW_2))
        self.homePage.logout()

        #Asserting redirection to Login page with Login button is visible
        self.assertFalse(self.homePage.is_visible(Locators.LOGIN_PAGE_TITLE))