class LoginTest(unittest.TestCase): @pytest.yield_fixture(autouse=True) def ClassSetup(self, BrowserSetUp): self.loginPage = LoginPage(self.driver) yield self.driver.quit() @data(*getCsvData('data/login/valid_login_test.csv')) @unpack def test_valid_login(self, url, username, password): self.loginPage.goToPage(url) self.loginPage.SelectFromLogin("loginForm") self.loginPage.Login(username, password) self.loginPage.markFinal("test_valid_login", self.loginPage.IsLogged(), "Login was successfull")
class LoginTest(unittest.TestCase): @pytest.yield_fixture(autouse=True) def ClassSetup(self, BrowserSetUp): self.loginPage = LoginPage(self.driver) yield self.driver.quit() @data(*DataHandler.GetGoogleData('Automated Tests', 'Login')) def test_valid_login(self, info): import os self.loginPage.GoToPage(info['url']) self.loginPage.SelectFromLogin("loginForm") self.loginPage.Login(info['username'], info['password']) self.loginPage.MarkFinal("test_valid_login", self.loginPage.IsLogged(), "Login was successful")