Ejemplo n.º 1
0
 def clickBackFromAddReviewPage(self):
     NavigationMenuPage.clickAnalytics(self)
     AnalyticsPage.clickHistoryButton(self)
     AnalyticsPage.clickHistoryBuyer(self)
     HelperTestBase.reliableClick(self, "[data-test-id='review_0']")
     self.clickBackButton()
     time.sleep(5)
    def test_clickOnHistorySeller(self):
        url = self.base_url + '/history'
        url1 = self.base_url + '/inventory-list'
        url2 = self.base_url + '/analytics'
        url3 = self.base_url + '/shopping-list'

        driver = self.driver
        driver.get(self.base_url)
        LoginPage.loginAction(self, 'SA1', 'Bizibaza111')
        time.sleep(5)
        # LoginPage.loginAction(self, 'Bob', 'Ss123456')
        self.assertEqual(url3, HelperTestBase.getURL(self))
        NavigationMenuPage.clickSellerButton(self)
        time.sleep(3)
        NavigationMenuPage.clickAnalytics(self)
        time.sleep(2)
        self.assertEqual(url2, HelperTestBase.getURL(self))
        self.assertIs(
            HelperTestBase.checkElementPresent(
                self, "[data-test-id='shoppingLink']"), True)
        AnalyticsPage.clickHistoryButton(self)
        self.assertEqual(url, HelperTestBase.getURL(self))

        ### Test scope -  check the elements on 'Seller History' page:

        self.assertIs(
            HelperTestBase.checkElementPresent(
                self, "[data-test-id='historyItem_0']"), True)
        self.assertIs(
            HelperTestBase.checkElementPresent(
                self, "[data-test-id='analyticLink']"), True)
        self.assertIs(
            HelperTestBase.checkElementPresent(
                self, "[data-test-id='sellerHistory']"), True)
        self.assertIs(
            HelperTestBase.checkElementPresent(
                self, "[data-test-id='rightDirItem_0']"), True)
        self.assertIs(
            HelperTestBase.checkElementPresent(self,
                                               "[data-test-id='qntItems']"),
            True)
        self.assertIs(
            HelperTestBase.checkElementPresent(self, "[data-test-id='total']"),
            True)

        ### Test scope -  click on  < button on 'Seller History' page => 'Analytics' page is opened:
        HelperTestBase.reliableClick(self, "[data-test-id='analyticLink']")
        # AnalyticsPage.clickBackFromHistoryAndDuties(self)
        self.assertEqual(url2, HelperTestBase.getURL(self))
        ### Test scope -  click on  < button on 'Analytics' page => Inventory list page is opened:
        HelperTestBase.reliableClick(self, "[data-test-id='shoppingLink']")
        # AnalyticsPage.clickBackFromAnalytics(self)
        self.assertEqual(url1, HelperTestBase.getURL(self))
 def test_clickOnHistoryBuyer(self):
     url = self.base_url + '/shopping-list'
     url2 = self.base_url + '/analytics'
     url3 = self.base_url + '/history'
     driver = self.driver
     driver.get(self.base_url)
     # LoginPage.loginAction(self, 'Bob', 'Ss123456')
     LoginPage.loginAction(self, 'SA1', 'Bizibaza111')
     NavigationMenuPage.clickAnalytics(self)
     AnalyticsPage.clickHistoryButton(self)
     time.sleep(2)
     self.assertEqual(url3, HelperTestBase.getURL(self))
Ejemplo n.º 4
0
 def test_clickBackFromAddReviewPage(self):
     # Test scope - Seller goes to AddReview Page, click on <, click on < = > Inventory Page is opened
     url = self.base_url + '/shopping-list'
     url2 = self.base_url + '/reviews'
     url1 = self.base_url + '/inventory-list'
     driver = self.driver
     driver.get(self.base_url)
     text1 = 'You cannot send review:'
     text2 = "You haven't bought this item yet"
     LoginPage.loginAction(self, 'SA1', 'Bizibaza111')
     NavigationMenuPage.clickSellerButton(self)
     time.sleep(5)
     ReviewsPage.clickBackFromAddReviewPage(self)
     time.sleep(3)
     AnalyticsPage.clickBackFromHistoryAndDuties(self)
     # AnalyticsPage.clickBackButton(self)
     HelperTestBase.reliableClick(self, "[data-test-id='shoppingLink']")
     HelperTestBase.waitURL(self, url1)
     self.assertEqual(url1, HelperTestBase.getURL(self))
    def test_clickOnDutiesSeller(self):
        url = self.base_url + '/duties'
        url2 = self.base_url + '/analytics'
        url1 = self.base_url + '/inventory-list'
        url3 = self.base_url + '/shopping-list'

        driver = self.driver
        driver.get(self.base_url)
        LoginPage.loginAction(self, 'SA1', 'Bizibaza111')
        NavigationMenuPage.clickSellerButton(self)
        NavigationMenuPage.clickAnalytics(self)
        # ### Test scope -  click on 'Duties' page:
        AnalyticsPage.clickDutiesButton(self)
        time.sleep(2)
        self.assertEqual(url, HelperTestBase.getURL(self))

        ### Test scope -  check the elements on 'Duties' page:

        self.assertIs(
            HelperTestBase.checkElementPresent(self,
                                               "[data-test-id='dutyItem_0']"),
            True)
        self.assertIs(
            HelperTestBase.checkElementPresent(
                self, "[data-test-id='analyticLink']"), True)
        self.assertIs(
            HelperTestBase.checkElementPresent(self,
                                               "[data-test-id='duties']"),
            True)
        self.assertIs(
            HelperTestBase.checkElementPresent(
                self, "[data-test-id='rightDirItem_0']"), True)

        ### Test scope -  click on  < button on 'Duties list' page => Analytics page is opened:
        AnalyticsPage.reliableClick(self, "[data-test-id='analyticLink']")
        self.assertEqual(url2, HelperTestBase.getURL(self))
        ### Test scope -  click on  < button on 'Analytics' page => Inventory list page is opened:
        AnalyticsPage.reliableClick(self, "[data-test-id='shoppingLink']")
        time.sleep(3)
        self.assertEqual(url1, HelperTestBase.getURL(self))
Ejemplo n.º 6
0
 def addReviewOnBuyer(self):
     NavigationMenuPage.clickAnalytics(self)
     AnalyticsPage.clickHistoryButton(self)
     AnalyticsPage.clickHistoryBuyer(self)
     HelperTestBase.clickAndWait(self, "[data-test-id='review_0']")
     self.addReviewSuccess()
Ejemplo n.º 7
0
 def goToAddReviewPage(self):
     NavigationMenuPage.clickAnalytics(self)
     AnalyticsPage.clickHistoryButton(self)
     AnalyticsPage.clickHistoryBuyer(self)
     AnalyticsPage.openProductWitchBought(self)
     ProductDetailsPage.clickReviewsButton(self)