class RegisterCoursesCSVDataTests(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        self.courses = RegisterCoursesPage(self.driver)
        self.ts = ExecutionStatus(self.driver)
        self.nav = NavigationPage(self.driver)

    def setUp(self):
        #self.driver.find_element_by_link_text("All Courses").click()
        self.driver.find_element_by_xpath(
            "//a[@class='navbar-brand header-logo']//img").click()

    @pytest.mark.run(order=1)
    @data(*getCSVData(
        "C:\\Users\\semc0\\Desktop\\letskodeit_200607\\testdata.csv"))
    @unpack
    def test_invalidEnrollment(self, courseName, ccNum, ccExp, ccCVV):
        self.courses.enterCourseName(courseName)
        time.sleep(1)
        self.courses.selectCourseToEnroll(courseName)
        time.sleep(1)
        self.courses.enrollCourse(num=ccNum, exp=ccExp, cvv=ccCVV)
        time.sleep(1)
        result = self.courses.verifyEnrollFailed()
        self.ts.markFinal("test_invalidEnrollment", result,
                          "Enrollment Failed Verification")
Ejemplo n.º 2
0
class AdvanceSearch(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        self.advSearch = AdvancedSearch(self.driver)
        self.es = ExecutionStatus(self.driver)

    #@pytest.mark.run(order=1)
    def test_1_serachedPrices(self):
        result1 = self.advSearch.verifySearchResults("0", "150")
        self.es.markFinal("test_1_serachedPrices", result1,
                          "Verification of test_1_serached Prices")
class DiscountCouponTest(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        self.dc = DiscountCoupon(self.driver)
        self.es = ExecutionStatus(self.driver)

    # @pytest.mark.run(order=1)
    def test_verifyDiscount(self):
        result = self.dc.verifyAppliedDiscount()
        self.es.markFinal("test_verifyDiscount", result,
                          "Verification of Applied Discount")


#py.test -s -v tests\mobile_items\test_09_discount_coupon.py --browser chrome --html=C:\Users\semc0\Desktop\TestReport\tp.html
class ProductPriceTest(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        self.pp = ProductPrices(self.driver)
        self.es = ExecutionStatus(self.driver)

    #@pytest.mark.run(order=1)
    def test_mobilePrices(self):
        result = self.pp.comparePrices()
        self.es.markFinal("test_mobilePrices", result,
                          "Verification of Mobile Prices")


#py.test -s -v tests\mobile_items\product_prices_test.py --browser chrome --html=C:\Users\semc0\Desktop\TestReport\tp.html
class ExportOrdersToFileTest(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        self.etf = ExportOrdersToFile(self.driver)
        self.es = ExecutionStatus(self.driver)

    #@pytest.mark.run(order=1)
    def test_1_verifySuccessfullExport(self):
        result = self.etf.validFileExport("user01", "guru99com", "CSV")
        self.es.markFinal("test_1_verifySuccessfullExport", result,
                          "Verification of File Export")


#py.test -s -v tests\mobile_items\test_10_export_orders_to_file.py --browser chrome --html=C:\Users\semc0\Desktop\TestReport\tp.html
class PurchaseAsGuestTest(unittest.TestCase):

    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        self.pag = PurchaseAsGuest(self.driver)
        self.es = ExecutionStatus(self.driver)

    #@pytest.mark.run(order=1)
    def test_verifyOrderPurchase(self):
        result = self.pag.verifyTitle()
        self.es.markFinal("test_verifyPurchase", result, "Verification of Shopping")


#py.test -s -v tests\mobile_items\test_16_purchase_as_guest.py --browser chrome --html=C:\Users\AlijanMo\Desktop\TestReport\Guru99\tp1.html
class ReviewMechanismTest(unittest.TestCase):

    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        self.rm = ReviewMechanism(self.driver)
        self.es = ExecutionStatus(self.driver)

    #@pytest.mark.run(order=1)
    def test_verifyReviewDisplay(self):
        result = self.rm.verifyReviewDisplay("Good Q&D2", "Good QD4", "almomash34", "user01", "guru99com")
        self.es.markFinal("test_verifyReviewDisplay", result, "Verification of Review Display")


#py.test -s -v tests\mobile_items\test_12_review_mechanism.py --browser chrome --html=C:\Users\semc0\Desktop\TestReport\tp.html
Ejemplo n.º 8
0
class SortInvoiceTest(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        self.si = SortInvoice(self.driver)
        self.es = ExecutionStatus(self.driver)

    #@pytest.mark.run(order=1)
    def test_verifyInvoiceSort(self):
        result = self.si.verifyInvoiceSort()
        self.es.markFinal("test_verifyInvoiceSort", result,
                          "Verification of Invoice Sort")


#py.test -s -v tests\mobile_items\test_13_sort_invoice_by_date.py --browser chrome --html=C:\Users\semc0\Desktop\TestReport\tp.html
Ejemplo n.º 9
0
class CompareProductsTest(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        self.cp = CompareProducts(self.driver)
        self.es = ExecutionStatus(self.driver)

    #@pytest.mark.run(order=1)
    def test_productsComparison(self):
        result = self.cp.verifyComparison()
        self.es.markFinal("test_productsComparison", result,
                          "Verification of Products Comparison")
        self.cp.closePopupWindow()


# py.test tests\mobile_items\compare_products_test.py --browser chrome --html=C:\Users\semc0\Desktop\TestReport\tp.html
Ejemplo n.º 10
0
class RegisterCoursesTests(unittest.TestCase):

    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        self.courses = RegisterCoursesPage(self.driver)
        self.ts = ExecutionStatus(self.driver)

    @pytest.mark.run(order=1)
    def test_invalidEnrollment(self):
        self.courses.enterCourseName("JavaScript")
        self.courses.selectCourseToEnroll("JavaScript for beginners")
        self.courses.enrollCourse(num="1234 5678 9012 3456", exp="1220", cvv="444", zip="12345")
        result = self.courses.verifyEnrollFailed()
        self.ts.markFinal("test_invalidEnrollment", result,
                          "Enrollment Failed Verification")
Ejemplo n.º 11
0
class LoginTests(unittest.TestCase):

    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        self.lp = LoginPage(self.driver)
        self.es = ExecutionStatus(self.driver)


    @pytest.mark.run(order=1)
    def test_validLogin(self):
        #self.lp.login("*****@*****.**", "abcabc")
        #result1 = self.lp.verifyLoginTitle()
        #self.es.mark(result1, "Title Verification")
        result = self.lp.verifyLoginSuccessful()
        self.es.markFinal("test_validLogin", result, "Login Verification")

    '''
Ejemplo n.º 12
0
class UpdateShoppingCartIphoneTest(unittest.TestCase):

    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        self.UCI = UpdateCartIphone(self.driver)
        self.es = ExecutionStatus(self.driver)

    #@pytest.mark.run(order=1)
    def test_2_verifySuccessfulPurchase(self):
        result = self.UCI.verifySuccessfullOrder()
        self.es.markFinal("test_2_verifySuccessfulPurchase", result, "Verification of Shopping")

    def test_1_verifyQuantity(self):
        result = self.UCI.verifyUpdatedQuantity()
        self.es.markFinal("test_1_verifyQuantity", result, "Verification of Quantity Update")


#py.test -s -v tests\mobile_items\test_18_update_cart.py --browser chrome --html=C:\Users\AlijanMo\Desktop\TestReport\Guru99\tp.html
class ExportOrdersToFileTest(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        self.pi = PrintInvoice(self.driver)
        self.es = ExecutionStatus(self.driver)

    #@pytest.mark.run(order=1)
    def test_1_verifyErrorMsg(self):
        result = self.pi.verifyErrorMsg("user01", "guru99com", "1", "4")
        self.es.markFinal("test_1_verifyErrorMsg", result,
                          "Verification of Error  Message")

    def test_2_verifyInvoiceDownload(self):
        result = self.pi.verifyinvoiceDownload("3", "4")
        self.es.markFinal("test_2_verifyInvoiceDownload", result,
                          "Verification of Invoice Download")


#py.test -s -v tests\mobile_items\test_11_print_download_invoice.py --browser chrome --html=C:\Users\semc0\Desktop\TestReport\tp.html
Ejemplo n.º 14
0
class ShoppingCartTest(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        self.sc = ShoppingCart(self.driver)
        self.es = ExecutionStatus(self.driver)

    # @pytest.mark.run(order=1)
    def test_1_invalidQuantity(self):
        result = self.sc.verifyErrorMsg()
        self.es.markFinal("test_invalidQuantity", result,
                          "Verification of size of Shopping Cart")

    # @pytest.mark.run(order=2)
    def test_2_emptyShoppingCart(self):
        result = self.sc.verifyEmptyCart()
        self.es.markFinal("test_emptyShoppingCart", result,
                          "Verification of empty Shopping Cart")


#py.test -s -v tests\mobile_items\shopping_cart_test.py --browser chrome --html=C:\Users\semc0\Desktop\TestReport\tp.html
Ejemplo n.º 15
0
class CreateAccountTest(unittest.TestCase):

    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        self.ca = CreateAccount(self.driver)
        self.es = ExecutionStatus(self.driver)

    #@pytest.mark.run(order=1)
    def test_1_confirmRegistration(self):
        self.ca.createAccount("fname15", "lname15", "*****@*****.**", "newpass20")
        result = self.ca.verifyRegistration()
        self.es.markFinal("test_confirmRegistration", result, "Verification of Registration")

    #@pytest.mark.run(order=2)
    def test_2_confirmWishlistShare(self):
        self.ca.addAndShareWishlist("*****@*****.**")
        result = self.ca.verifyWishlistShare()
        self.es.markFinal("test_confirmWishlistShare", result, "Verification of Wishlist Share")


#py.test -s -v tests\mobile_items\create_account_test.py --browser chrome --html=C:\Users\semc0\Desktop\TestReport\tp.html
Ejemplo n.º 16
0
class SortByNameTest(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        self.sbn = SortByName(self.driver)
        self.es = ExecutionStatus(self.driver)

    #@pytest.mark.run(order=1)
    def test_1_homePage(self):
        result1 = self.sbn.verifyTextOnHomePage()
        self.es.markFinal("test_homePage", result1,
                          "Verification of Text On Home Page")

    #@pytest.mark.run(order=2)
    def test_2_mobilePage(self):
        result1 = self.sbn.verifyMobilePageTitle("Mobile")
        self.es.mark(result1, "Verification of Page Title")

        result2 = self.sbn.verifySortByName()
        self.es.markFinal("test_mobilePage", result2,
                          "Verification of Product Sorting")


# py.test -s -v tests\mobile_items\test_req_01.py --browser chrome --html=C:\Users\AlijanMo\Desktop\TestReport\Guru99\tp.html
class PurchaseProductsTest(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        self.pp = PurchaseProducts(self.driver)
        self.es = ExecutionStatus(self.driver)

    #@pytest.mark.run(order=1)
    def test_1_flatrateVerification(self):
        result = self.pp.verifyFlatRate()
        self.es.markFinal("test_1_flatrateVerification", result,
                          "Verification of Flatrate")

    def test_2_grandTotalVerification(self):
        result = self.pp.verifyGrandTotal()
        self.es.markFinal("verifyGrandTotal", result,
                          "Verification of Grand Total")

    def test_3_orderConfirmation(self):
        result = self.pp.orderConfirmation()
        self.es.markFinal("test_3_orderConfirmation", result,
                          "Verification of Order Confirmation")


#py.test -s -v tests\mobile_items\purchase_products_test.py --browser chrome --html=C:\Users\semc0\Desktop\TestReport\tp.html
class SavePlacedOrderTest(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        self.spo = SavePlacedOrder(self.driver)
        self.es = ExecutionStatus(self.driver)

    #@pytest.mark.run(order=1)
    def test_1_orderNumberVerification(self):
        result = self.spo.verifyRecentOrderNumber()
        self.es.markFinal("test_1_orderNumberVerification", result,
                          "Verification of Order Number")

    def test_2_orderStatusVerification(self):
        result = self.spo.verifyRecentOrderStatus()
        self.es.markFinal("test_2_orderStatusVerification", result,
                          "Verification of Order Status")

    def test_3_orderPrintVerification(self):
        result = self.spo.verifyOrderPrint()
        self.es.markFinal("test_3_orderPrintVerification", result,
                          "Verification of Order Print")


#py.test -s -v tests\mobile_items\test_07_save_placed_order_as_pdf.py --browser chrome --html=C:\Users\semc0\Desktop\TestReport\tp.html
class ChangePlacedOrderTest(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        self.cpo = ChangePlacedOrder(self.driver)
        self.es = ExecutionStatus(self.driver)

    #@pytest.mark.run(order=1)
    def test_1_verifyGranTotals(self):
        result = self.cpo.verifyCurrentGrandTotals()
        self.es.markFinal("test_1_verifyGranTotals", result,
                          "Verification of Grand Totals")

    def test_2_verifyReorderConfirmation(self):
        result = self.cpo.verifyNewOrderConfirmation()
        self.es.markFinal("test_2_verifyReorderConfirmation", result,
                          "Verification of Reorder Confirmation")

    def test_3_VerifyNewPurchaseConfirmation(self):
        result = self.cpo.verifyNewPurchaseConfirmation()
        self.es.markFinal("test_3_VerifyNewPurchaseConfirmation", result,
                          "Verification of Purchase Confirmation")


#py.test -s -v tests\mobile_items\test_08_change_placed_order.py --browser chrome --html=C:\Users\semc0\Desktop\TestReport\tp.html