Exemplo n.º 1
0
class ProductButtonCSVDataTests(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        self.product = ProductButtonsCheck(self.driver)
        self.ts = TestStatus(self.driver)
        self.nav = NavigationPage(self.driver)

    def setUp(self):
        """
        naviage to practice page after every test .
        :return:
        """
        self.nav.navigateToPracticePage()

    @pytest.mark.run(order=1)
    @data(*getCSVData(
        "C:\\Users\\vadim\PycharmProjects\\automationPracticeStore.com\\option.csv"
    ))
    @unpack
    def test_product_tag_sofa(self, option):
        self.product.check_tag(option)
        result = self.product.check_elements_text(option)
        self.ts.mark(
            result,
            "######### PRODUCT {} TEST DID NOT PASSED .".format(option))
        self.ts.markFinal("######## PRODUCT {} TEST .".format(option))
Exemplo n.º 2
0
class ClickItemsCSVDataTests(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        self.items = ClickItems(self.driver)
        self.ts = TestStatus(self.driver)
        self.nav = NavigationPage(self.driver)

    def setUp(self):
        """
        after every test -> the web page will be navigate to practice page -> main page .
        :return:
        """
        self.nav.navigateToPracticePage()

    @pytest.mark.run(order=1)
    @data(*getCSVData(
        "C:\\Users\\vadim\PycharmProjects\\automationPracticeStore.com\\datafile.csv"
    ))
    @unpack
    def test_click_on_item(self, item, amount):
        """
        using ddt and get the items from 'datafile.csv' file .
        :param item: the item the automation will be checking .
        :param amount: amount of time this item will be added to the cart .
        :return:
        """
        self.items.click_on_item(item=item)
        self.items.add_to_cart(amount=amount)
        result1 = self.items.verify_item_added_successfully(amount=amount)
        self.ts.mark(result1, "######### ITEM DID NOT ADDED SUCCESSFULLY .")
        self.ts.markFinal("##### ADD ITEM AND TOTAL PRICE TEST CHECK")
Exemplo n.º 3
0
class SearchBoxCSVDataTests(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        self.search = SearchBox(self.driver)
        self.ts = TestStatus(self.driver)
        self.nav = NavigationPage(self.driver)

    def setUp(self):
        self.nav.navigateToPracticePage()

    @pytest.mark.run(order=1)
    @data(*getCSVData(
        "C:\\Users\\vadim\PycharmProjects\\automationPracticeStore.com\\itemsToSearch.csv"
    ))
    @unpack
    def test_search_box(self, item):
        self.search.search_item(item=item)
        result = self.search.check_search(item=item)
        self.ts.mark(result,
                     "######### ITEM IS ON THE LIST AND LOCATOR FOUND .")
        self.ts.markFinal("######## SEARCH BOX TEST PASSED .")