I am on a website where you login, then search for course, click on course and then it lands on the Credit card page, since its just one course and is common and I am just trying to run DDT on CC section and not search section this is what I did.
On the test page this is how my code looks like:
@pytest.mark.usefixtures("oneTimeSetUp","setUp")
@ddt
class SendformTest(unittest.TestCase):
@pytest.fixture(autouse=True)
def classSetup(self,oneTimeSetUp):
self.sf = SendForms(self.driver)
self.ts = TestStatus(self.driver)
def setUp(self): ############ I want this method to run just once after login, this method searches for course and then clicks and land on cc page
self.sf.navigateToCCForms("img")
@pytest.mark.run(order = 1)
@data(*getCSVData("testRegular.csv"))
@unpack
def test_cc_Form(self,ccNum, ccExp, ccCVV):
result = self.sf.verifyOnCCforms()
self.ts.mark(result,"On Send Form Page")
self.sf.ccdetails(ccNum, ccExp, ccCVV)
result1 = self.sf.sentSuccessMsg()
self.ts.markFinal("test_sending_Form", result1, "this is test")
Right now this runs once fine and then just sits there, it wont enter data multiple times on the CC page. how do I make setUp method run just once. I tried:
@classmethod
def setUpClass(self):
#super(SendformTest, self).setUpClass()
self.sf.navigateToSendforms("img")
but getting the:
AttributeError: type object 'SendformTest' has no attribute 'sf'