|
@@ -135,4 +135,116 @@ def test_login_OK_logout_saucedemo():
|
|
|
assert driver.current_url==url_sauce_demo, "L'url de la page ouverte ("+ driver.current_url+") n'est pas égal à "+url_sauce_demo
|
|
|
|
|
|
time.sleep(5)
|
|
|
- driver.quit()
|
|
|
+ driver.quit()
|
|
|
+
|
|
|
+#@pytest.mark.skip("JE VEUX PAS LE FAIRE")
|
|
|
+def test_Filtrer_par_Name_acendant():
|
|
|
+ #driver = webdriver.Chrome()
|
|
|
+ #driver.get("https://www.saucedemo.com/")
|
|
|
+
|
|
|
+ log.info("Test du Login avec succès")
|
|
|
+ options = webdriver.FirefoxOptions()
|
|
|
+ options.add_argument('--headless')
|
|
|
+ driver = webdriver.Firefox(options=options)
|
|
|
+
|
|
|
+ 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="standard_user")
|
|
|
+ writeInInput(password, text="secret_sauce")
|
|
|
+ login.click()
|
|
|
+
|
|
|
+ # button_login = driver.find_element(By.CLASS_NAME, "product_sort_container")
|
|
|
+
|
|
|
+ #log.info(button_login.get_attribute('value'))
|
|
|
+
|
|
|
+ Filter_List = Select(driver.find_element(By.CLASS_NAME, "product_sort_container"))
|
|
|
+ Filter_List.select_by_value("az")
|
|
|
+ driver.quit()
|
|
|
+
|
|
|
+#@pytest.mark.skip("JE VEUX PAS LE FAIRE")
|
|
|
+def test_Filtrer_par_Name_decendant():
|
|
|
+ #driver = webdriver.Chrome()
|
|
|
+ #driver.get("https://www.saucedemo.com/")
|
|
|
+
|
|
|
+ log.info("Test du Login avec succès")
|
|
|
+ options = webdriver.FirefoxOptions()
|
|
|
+ options.add_argument('--headless')
|
|
|
+ driver = webdriver.Firefox(options=options)
|
|
|
+
|
|
|
+ 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="standard_user")
|
|
|
+ writeInInput(password, text="secret_sauce")
|
|
|
+ login.click()
|
|
|
+
|
|
|
+ # button_login = driver.find_element(By.CLASS_NAME, "product_sort_container")
|
|
|
+
|
|
|
+ #log.info(button_login.get_attribute('value'))
|
|
|
+
|
|
|
+ Filter_List = Select(driver.find_element(By.CLASS_NAME, "product_sort_container"))
|
|
|
+ Filter_List.select_by_value("za")
|
|
|
+ driver.quit()
|
|
|
+
|
|
|
+#@pytest.mark.skip("JE VEUX PAS LE FAIRE")
|
|
|
+def test_Filtrer_par_Price_high_to_low():
|
|
|
+ #driver = webdriver.Chrome()
|
|
|
+ #driver.get("https://www.saucedemo.com/")
|
|
|
+
|
|
|
+ log.info("Test du Login avec succès")
|
|
|
+ options = webdriver.FirefoxOptions()
|
|
|
+ options.add_argument('--headless')
|
|
|
+ driver = webdriver.Firefox(options=options)
|
|
|
+
|
|
|
+ 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="standard_user")
|
|
|
+ writeInInput(password, text="secret_sauce")
|
|
|
+ login.click()
|
|
|
+
|
|
|
+ # button_login = driver.find_element(By.CLASS_NAME, "product_sort_container")
|
|
|
+
|
|
|
+ #log.info(button_login.get_attribute('value'))
|
|
|
+
|
|
|
+ Filter_List = Select(driver.find_element(By.CLASS_NAME, "product_sort_container"))
|
|
|
+ time.sleep(5)
|
|
|
+ Filter_List.select_by_value("hilo")
|
|
|
+ time.sleep(10)
|
|
|
+ #log.info(button_login.get_attribute('value'))
|
|
|
+
|
|
|
+ driver.quit()
|
|
|
+
|
|
|
+#@pytest.mark.skip("JE VEUX PAS LE FAIRE")
|
|
|
+def test_Filtrer_par_Price_low_to_high():
|
|
|
+ #driver = webdriver.Chrome()
|
|
|
+ #driver.get("https://www.saucedemo.com/")
|
|
|
+
|
|
|
+ log.info("Test du Login avec succès")
|
|
|
+ options = webdriver.FirefoxOptions()
|
|
|
+ options.add_argument('--headless')
|
|
|
+ driver = webdriver.Firefox(options=options)
|
|
|
+
|
|
|
+ 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="standard_user")
|
|
|
+ writeInInput(password, text="secret_sauce")
|
|
|
+ login.click()
|
|
|
+
|
|
|
+ # button_login = driver.find_element(By.CLASS_NAME, "product_sort_container")
|
|
|
+
|
|
|
+ #log.info(button_login.get_attribute('value'))
|
|
|
+
|
|
|
+ Filter_List = Select(driver.find_element(By.CLASS_NAME, "product_sort_container"))
|
|
|
+ time.sleep(5)
|
|
|
+ Filter_List.select_by_value("lohi")
|
|
|
+ time.sleep(10)
|
|
|
+ #log.info(button_login.get_attribute('value'))
|
|
|
+
|
|
|
+ driver.quit()
|