From 7fe3feae9aa54f22536dc15400c1061dffe4ab94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=81=E6=99=9F=E6=99=94?= <759539128@qq.com> Date: Sat, 18 May 2024 09:23:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20app/test/test=5Fbug551=5FD?= =?UTF-8?q?ingZeYu.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/test/test_bug551_DingZeYu.py | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/app/test/test_bug551_DingZeYu.py b/app/test/test_bug551_DingZeYu.py index 05fedcc..9fdb24f 100644 --- a/app/test/test_bug551_DingZeYu.py +++ b/app/test/test_bug551_DingZeYu.py @@ -6,31 +6,14 @@ from selenium.webdriver.common.by import By from selenium.webdriver.common.alert import Alert from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.wait import WebDriverWait - +from helper import signup def test_bug551(): driver = webdriver.Edge() driver.maximize_window() driver.get("http://127.0.0.1:5000/") - driver.find_element(By.CSS_SELECTOR, 'a[href="/login"]').click() - driver.find_element(By.ID, 'username').send_keys('dzy') - driver.find_element(By.ID, 'password').send_keys('123456') - driver.find_element(By.CLASS_NAME, 'btn').click() - - try: - alert = WebDriverWait(driver, 10).until(EC.alert_is_present()) - alert.accept() - driver.find_element(By.CSS_SELECTOR, 'a[href="/signup"]').click() - driver.find_element(By.ID, 'username').send_keys('dzy') - driver.find_element(By.ID, 'password').send_keys('123456') - driver.find_element(By.ID, 'password2').send_keys('123456') - driver.find_element(By.CLASS_NAME, 'btn').click() - alert = WebDriverWait(driver, 10).until(EC.alert_is_present()) - alert.accept() - - except: - pass + username, password = signup("http://127.0.0.1:5000/", driver) article = driver.find_element(By.ID, 'article') actions = ActionChains(driver)