class HomeTest(unittest.TestCase): @pytest.fixture(autouse=True) def classSetup(self, oneTimeSetUp): self.lp = LoginPage(self.driver) self.ts = TestStatus(self.driver) self.hp = HomePage(self.driver) # @pytest.mark.run(order=1) # @data(("*****@*****.**", "amazonapps", "iphone 7")) # @unpack # def test_validLogin(self,email,password,search): # self.lp.login(email, password) # # Online Shopping site in India: Shop Online for Mobiles, Books, Watches, Shoes and More - Amazon.in # title = self.lp.verifyTitle("Online Shopping site in India: Shop Online for Mobiles, Books, Watches, Shoes and More - Amazon.in") # self.ts.mark(title, "Title mismatch!") # result = self.lp.verifyLoginSuccessful() # self.ts.markFinal("test_validLogin",result,"Login was not successful") # self.hp.search(search) @pytest.mark.run(order=1) # * -- means mutiple args @data(*getCSVData( "/Users/aravindanathdm/Documents/Simple_Pom_py_fw/testdata.csv")) @unpack def test_validLogin(self, email, password, search): self.lp.login(email, password) # Online Shopping site in India: Shop Online for Mobiles, Books, Watches, Shoes and More - Amazon.in title = self.lp.verifyTitle( "Online Shopping site in India: Shop Online for Mobiles, Books, Watches, Shoes and More - Amazon.in" ) self.ts.mark(title, "Title mismatch!") result = self.lp.verifyLoginSuccessful() self.ts.markFinal("test_validLogin", result, "Login was not successful") self.hp.search(search)
class AddressTests(unittest.TestCase): @pytest.fixture(autouse=True) def classSetup(self): self.lp = LoginPage(self.driver) self.ts = TestStatus(self.driver) self.hp = HomePage(self.driver) self.ad = AddressPage(self.driver) # @pytest.mark.run(order=1) # # @data(*getCSVData("/Users/aravindanathdm/Documents/Simple_Pom_py_fw/testdata.csv")) # @data("*****@*****.**","auto2018","aravinda") # @unpack # def test_addAddress(self,email,password,fullname): # self.lp.login(email, password) # # Online Shopping site in India: Shop Online for Mobiles, Books, Watches, Shoes and More - Amazon.in # # title = self.lp.verifyTitle("Online Shopping site in India: Shop Online for Mobiles, Books, Watches, Shoes and More - Amazon.in") # # self.ts.mark(title, "Title mismatch!") # # result = self.lp.verifyLoginSuccessful() # # self.ts.markFinal("test_addAddress",result,"Login was not successful") # self.ad.addNewAddress(fullname) @pytest.mark.run(order=1) # * -- means mutiple args @data(*getCSVData("/Users/aravindanathdm/Documents/Simple_Pom_py_fw/testdata.csv")) @unpack def test_addAddress(self,email,password,search): self.lp.login(email, password) # Online Shopping site in India: Shop Online for Mobiles, Books, Watches, Shoes and More - Amazon.in self.hp.search(search)
class LoginTests(unittest.TestCase): @pytest.fixture(autouse=True) def classSetup(self, oneTimeSetUp): self.lp = LoginPage(self.driver) self.ts = TestStatus(self.driver) self.hp = HomePage(self.driver) # self.ap = AddressPage(self.driver) @pytest.mark.run(order=1) def test_validLogin(self): self.lp.login("*****@*****.**", "amazonapps") # Online Shopping site in India: Shop Online for Mobiles, Books, Watches, Shoes and More - Amazon.in title = self.lp.verifyTitle("Online Shopping site in India: Shop Online for Mobiles, Books, Watches, Shoes and More - Amazon.in") self.ts.mark(title, "Title mismatch!") result = self.lp.verifyLoginSuccessful() self.ts.markFinal("test_validLogin",result,"Login was not successful") self.hp.search("iphone 7")