瀏覽代碼

Co-authored-by: AHMAD Abbas <abbasaliwehbeahmad@gmail.com>

Gogs 1 年之前
父節點
當前提交
b54783a480
共有 3 個文件被更改,包括 474 次插入3 次删除
  1. 431 0
      rapporDeTest.html
  2. 40 0
      test_main.py
  3. 3 3
      test_sauce_demo_class.py

File diff suppressed because it is too large
+ 431 - 0
rapporDeTest.html


+ 40 - 0
test_main.py

@@ -0,0 +1,40 @@
+##### IMPORT
+import pytest
+import logging as log
+import time
+from selenium import webdriver
+from selenium.webdriver.common.by import By
+from selenium.webdriver.common.keys import Keys
+from selenium.webdriver.support import expected_conditions as EC
+from selenium.common.exceptions import TimeoutException
+from selenium.webdriver.support.ui import WebDriverWait
+from selenium.webdriver.support.ui import Select
+from selenium.webdriver.firefox.options import Options
+from test_saucedemo import writeInInput
+
+
+def connexion_saucedemo(username, passwd, arg="--headless"):
+    log.info("Test du Login avec succès")
+    options = webdriver.FirefoxOptions()
+    options.add_argument(arg)
+
+    driver = webdriver.Firefox(options=options)
+    driver.get("https://www.saucedemo.com/")
+
+    username = driver.find_element(By.ID, "user-name")
+    password = driver.find_element(By.ID, "password")
+    login = driver.find_element(By.ID, "login-button")
+
+    writeInInput(inputElement=username, text=username)
+    writeInInput(password, text=passwd)
+    login.click()
+    log.info("")
+
+
+##### MANEL
+    
+    
+##### MATTHIEU
+
+
+##### TIFF

+ 3 - 3
test_sauce_demo_class.py

@@ -46,7 +46,7 @@ class TestSauceDemo():
     def teardown_method(self, method):
         log.info("Methode de TEARDOWN APRES CHAQUE TEST")
         self.driver.quit()
-    
+
     def login(self):
         username = self.driver.find_element(By.ID, "user-name")
         password = self.driver.find_element(By.ID, "password")
@@ -59,7 +59,7 @@ class TestSauceDemo():
     def logout(self):
         burger = self.driver.find_element(By.ID, "react-burger-menu-btn")
         burger.click()
-        logout=  self.driver.find_element(By.ID, "logout_sidebar_link")
+        logout = self.driver.find_element(By.ID, "logout_sidebar_link")
         logout.click()
 
 
@@ -90,4 +90,4 @@ class TestSauceDemo():
         
 
 ##### TIFF
-        
+        

Some files were not shown because too many files changed in this diff