From 54c8053323689e018f45f6a829e871f5ee43cb5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriela=20Pa=C5=82ka?= Date: Sun, 19 Jan 2020 20:07:30 +0100 Subject: [PATCH] Add simple tests --- selenium/test.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/selenium/test.py b/selenium/test.py index 02e5bc0..c9e88ad 100755 --- a/selenium/test.py +++ b/selenium/test.py @@ -21,6 +21,28 @@ class ClearBowlTest(unittest.TestCase): self.driver.find_element_by_xpath("//button[@class='ivu-btn ivu-btn-primary']").click() self.driver.find_element_by_xpath(f"//div[contains(text(),'Witaj, {email}')]") + def test_recipes(self): + self.driver.get(f'{self.base_url}/recipes') + self.driver.find_element_by_xpath("//div[@class='ivu-table-wrapper ivu-table-wrapper-with-border']") + self.driver.find_element_by_xpath("//div[@class='ivu-table-header']") + self.driver.find_element_by_xpath("//div[@class='ivu-table-body']") + self.driver.find_element_by_xpath("//span[contains(text(),'Prosty przepis na pyszne nale')]") + + def test_recipe_card(self): + self.driver.get(f'{self.base_url}/recipes/8') + self.driver.find_element_by_xpath("//p[contains(text(),'niki')]") + self.driver.find_element_by_xpath("//b[contains(text(),'ywcze:')]") + self.driver.find_element_by_xpath("//b[contains(text(),'adniki:')]") + self.driver.find_element_by_xpath("//p[contains(text(),'Prosty przepis na pyszne nale')]") + self.driver.find_element_by_xpath("//span[contains(text(),'adko ciasto. Doda')]") + + def test_products(self): + self.driver.get(f'{self.base_url}/products') + self.driver.find_element_by_xpath("//div[@class='ivu-table-wrapper ivu-table-wrapper-with-border']") + self.driver.find_element_by_xpath("//div[@class='ivu-table-header']") + self.driver.find_element_by_xpath("//div[@class='ivu-table-body']") + self.driver.find_element_by_xpath("//span[contains(text(),'Agrest')]") + # options for running within Jenkins @staticmethod def set_chrome():