I have the following unit test written in python,When i try to run this code, i am getting an attribute error in the console that AttributeError: 'testLogin' object has no attribute 'lp' I am very new to python and i would like to get some insight on this attribute issue
Is there any issues that needs to be fixed. Your help us highly recommended.
from utilities.teststatus import TestStatus as ts
import unittest
import pytest
@pytest.mark.usefixtures("oneTimeSetup", "setUp")
class testLogin(unittest.TestCase):
@pytest.fixture(autouse=True)
def classSetup(self,oneTimeSetup):
self.lp = LoginPage(self.driver)
@pytest.mark.order1
def test_validLogin(self):
self.lp.login("test@email.com", "abcabc")
userIcon = self.lp.verifyLoginSuccessful()
title = self.lp.verifyPageTitle()
ts.markFinal(title,"Login not successful")
assert userIcon == True
When i try to run this unittest, i am getting the error as AttributeError: 'testLogin' object has no attribute 'lp'
Can some one please help to fix it ?