|
@@ -14,16 +14,13 @@ from test_saucedemo import writeInInput
|
|
|
import os
|
|
|
|
|
|
|
|
|
-
|
|
|
-class TestSauceDemo():
|
|
|
-
|
|
|
-
|
|
|
- def is_windows():
|
|
|
+class TestSauceDemo:
|
|
|
+ def is_windows(self):
|
|
|
res = False
|
|
|
- if os.name == 'nt':
|
|
|
+ if os.name == "nt":
|
|
|
res == True
|
|
|
return res
|
|
|
-
|
|
|
+
|
|
|
def writeInInput(self, inputElement, text):
|
|
|
assert inputElement.is_displayed(), "Le champ texte n'est pas affiché"
|
|
|
assert inputElement.is_enabled(), "Le champ texte n'est pas activé"
|
|
@@ -31,7 +28,7 @@ class TestSauceDemo():
|
|
|
inputElement.send_keys(text)
|
|
|
|
|
|
def setup_method(self, method):
|
|
|
- log.info("Methode de SETUP AVANT CHAQUE TEST")
|
|
|
+ log.info("Methode de SETUP AVANT CHAQUE TEST")
|
|
|
|
|
|
if self.is_windows():
|
|
|
self.driver = webdriver.Firefox()
|
|
@@ -41,7 +38,9 @@ class TestSauceDemo():
|
|
|
self.driver = webdriver.Firefox(options=options)
|
|
|
|
|
|
self.driver.get("http://www.saucedemo.com")
|
|
|
- assert (self.driver.current_url == "https://www.saucedemo.com/"), "Nous ne somme pas sur la bonne page"
|
|
|
+ assert (
|
|
|
+ self.driver.current_url == "https://www.saucedemo.com/"
|
|
|
+ ), "Nous ne somme pas sur la bonne page"
|
|
|
|
|
|
def teardown_method(self, method):
|
|
|
log.info("Methode de TEARDOWN APRES CHAQUE TEST")
|
|
@@ -62,8 +61,6 @@ class TestSauceDemo():
|
|
|
logout = self.driver.find_element(By.ID, "logout_sidebar_link")
|
|
|
logout.click()
|
|
|
|
|
|
-
|
|
|
-
|
|
|
def test_saucedemo_boutenbout(self):
|
|
|
self.login()
|
|
|
self.logout()
|
|
@@ -76,18 +73,13 @@ class TestSauceDemo():
|
|
|
self.login()
|
|
|
self.logout()
|
|
|
|
|
|
+ ##### MANEL
|
|
|
|
|
|
-##### MANEL
|
|
|
-
|
|
|
-
|
|
|
+ ##### MATTHIEU
|
|
|
|
|
|
-
|
|
|
-##### MATTHIEU
|
|
|
-
|
|
|
def go_to_checkout(self):
|
|
|
checkout = self.driver.find_element(By.CSS_SELECTOR, "#checkout")
|
|
|
checkout.click()
|
|
|
-
|
|
|
+
|
|
|
|
|
|
##### TIFF
|
|
|
-
|