Exemplo n.º 1
0
class AppleOrderTest(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def objectsetup(self):
        self.apo = AppleOrder(self.driver)
        self.ts = ResultStatus(self.driver)

    def test_appleorder(self):
        self.apo.orderapple()
        time.sleep(1)
        result = self.apo.verifyapplesuccessfully()
        self.ts.markFinal("Testing Apple Order", result,
                          'Verify order successfully added')
class RegisterCoursesTests(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def classSetup(self):
        self.rcp = RegisterCoursesPage(self.driver)
        self.ts = ResultStatus(self.driver)

    @pytest.mark.run(order=1)
    def test_invalid_enrollment(self):
        self.rcp.enterCourseName("Javascript")
        self.rcp.enrollCourse("9856 2365 5213 2201", "12 / 20", "562")
        result = self.rcp.verifyEnrollFailed()
        self.ts.markFinal("test_invalid_enrollment", result,
                          "Enrollment failed verification")
Exemplo n.º 3
0
class AccountRegisterTest(unittest.TestCase):

    @pytest.fixture(autouse=True)
    def objectsetup(self,oneTimeSetUp):
        self.account = RegisterAccount(self.driver)
        self.ts = ResultStatus(self.driver)

    @data(*getCSVData("/Users/Abilash/PycharmProjects/AT/accountdata.csv"))
    # @data(*readAndWrite("/Users/Abilash/PycharmProjects/AT/accountdata.csv"))
    @unpack
    def test_registerAccount(self,FName,LName,Email,Teleophone,Password,ConfirmPassword):
        self.account.registerAccount(FName,LName,Email,Teleophone,Password,ConfirmPassword)
        result = self.account.verifyaccountCreatedSuccessfully()
        self.ts.markFinal("New Account Creation",result,"Successfull")
Exemplo n.º 4
0
class DesktopOrderTest(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def objectsetup(self, oneTimeSetUp):
        self.dtop = DesktopOrder(self.driver)
        self.rs = ResultStatus(self.driver)

    @data(*getCSVData("/Users/Abilash/PycharmProjects/AT/sonyorderdata.csv"))
    @unpack
    def test_desktop(self, FirstName, LastName, Address1, City, Postalcode):
        self.dtop.orderDesktop()
        res1 = self.dtop.verifydesktopadddedsuccessfully()
        self.rs.mark(result=res1, resultMessage='Added to cart')
        self.dtop.opencart(FirstName, LastName, Address1, City, Postalcode)
        result2 = self.dtop.verifyorderSuccessfull()
        self.rs.markFinal('Verifying the order placed successfully', result2,
                          'Order Verification')
class RegisterMultipleCoursesTests(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def classSetup(self):
        self.rcp = RegisterCoursesPage(self.driver)
        self.ts = ResultStatus(self.driver)

    @pytest.mark.run(order=1)
    @data(
        ("JavaScript for beginners", "9856 2365 5213 2201", "12 / 20", "562"),
        ("Rest API Automation With Rest Assured", "6856 2395 5213 2201",
         "12 / 22", "986"))
    @unpack
    def test_invalid_enrollment(self, courseName, ccNum, ccExp, ccCVV):
        self.rcp.enterCourseName(courseName)
        self.rcp.selectCourseToEnroll()
        self.rcp.fullCourseName(courseName)
        self.rcp.enrollCourse(ccNum, ccExp, ccCVV)
        result = self.rcp.verifyEnrollFailed()
        self.ts.markFinal("test_invalid_enrollment", result,
                          "Enrollment failed verification")
        self.driver.find_element_by_xpath("//*[@id='navbar-inverse-collapse']//a[contains(text(),'ALL COURSES')]")\
            .click()
Exemplo n.º 6
0
class LoginTests(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def classSetup(self, oneTimeSetUp):
        self.lp = LoginPage(self.driver)
        self.ts = ResultStatus(self.driver)

    @pytest.mark.run(order=2)
    def test_valid_login(self):
        self.lp.login("*****@*****.**", "abcabc")
        result1 = self.lp.verifyLoginTitle()
        self.ts.mark(result1, "Title is incorrect")
        result2 = self.lp.verifyLoginSuccess()
        self.ts.markFinal("test_valid_login", result2,
                          "Login was not successful")

    @pytest.mark.run(order=1)
    def test_invalid_login(self):
        self.lp.logout()
        self.lp.signIn()
        self.lp.login("*****@*****.**", "abcabca")
        result = self.lp.verifyLoginFailed()
        assert result == True
class RegisterCoursesCSVDataTests(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def classSetup(self):
        self.rcp = RegisterCoursesPage(self.driver)
        self.ts = ResultStatus(self.driver)
        self.np = NavigationPage(self.driver)

    def setUp(self):
        self.np.navigateToAllCourses()

    @pytest.mark.run(order=1)
    @data(*getCSVData(
        "C:\\Users\\dcthofic07\\workspace_python\\automation_framework_1\\testdata.csv"
    ))
    @unpack
    def test_invalid_enrollment(self, courseName, ccNum, ccExp, ccCVV):
        self.rcp.enterCourseName(courseName)
        self.rcp.selectCourseToEnroll()
        self.rcp.fullCourseName(courseName)
        self.rcp.enrollCourse(ccNum, ccExp, ccCVV)
        result = self.rcp.verifyEnrollFailed()
        self.ts.markFinal("test_invalid_enrollment", result,
                          "Enrollment failed verification")
 def classSetup(self):
     self.rcp = RegisterCoursesPage(self.driver)
     self.ts = ResultStatus(self.driver)
Exemplo n.º 9
0
 def objectsetup(self):
     self.apo = AppleOrder(self.driver)
     self.ts = ResultStatus(self.driver)
Exemplo n.º 10
0
 def objectsetup(self, oneTimeSetUp):
     self.dtop = DesktopOrder(self.driver)
     self.rs = ResultStatus(self.driver)
Exemplo n.º 11
0
 def classSetup(self, oneTimeSetUp):
     self.lp = LoginPage(self.driver)
     self.ts = ResultStatus(self.driver)
Exemplo n.º 12
0
 def objectsetup(self,oneTimeSetUp):
     self.account = RegisterAccount(self.driver)
     self.ts = ResultStatus(self.driver)