Browse Source

fix sleep to debug false

vdiez-devweb 1 year ago
parent
commit
a871d8c507
1 changed files with 4 additions and 1 deletions
  1. 4 1
      test_saucedemo.py

+ 4 - 1
test_saucedemo.py

@@ -8,7 +8,7 @@ from selenium.webdriver.support.ui import WebDriverWait
 from selenium.webdriver.support import expected_conditions as EC
 from selenium.common.exceptions import TimeoutException
 
-debug = True
+debug = False
 
 def slip(secondes):
     if debug:
@@ -257,6 +257,7 @@ def test_click_button_add_to_cart():
 
     # Vérification clic button "add to cart" change de texte vers "remove"
     button_add = driver.find_element(By.ID,"add-to-cart-sauce-labs-backpack")
+    slip(2)
     button_add.click()
     log.info("click sur 'add to cart' change button and add a badge on icon cart")
     badge_panier = driver.find_element(By.CLASS_NAME,"shopping_cart_badge")
@@ -269,6 +270,7 @@ def test_click_button_add_to_cart():
 
     # Vérification clic button "remove" change de texte vers "add to cart"
     button_remove = driver.find_element(By.ID,"remove-sauce-labs-backpack")
+    slip(2)
     button_remove.click()
     log.info("click sur 'Remove' change button and remove the badge on icon cart")
     assert True == exists_element_by_id(driver,"add-to-cart-sauce-labs-backpack")
@@ -276,4 +278,5 @@ def test_click_button_add_to_cart():
     # Vérification button "cart" a un badge supprimé car 0 articles dans le panier
     assert False == exists_element_by_classname(driver,"shopping_cart_badge")
 
+    slip(2)
     driver.quit()