forked from mrlan/EnglishPal
更新 app/test/test_bug551_DingZeYu.py
parent
0301c39cf0
commit
b2a53a0e40
|
@ -6,14 +6,31 @@ from selenium.webdriver.common.by import By
|
||||||
from selenium.webdriver.common.alert import Alert
|
from selenium.webdriver.common.alert import Alert
|
||||||
from selenium.webdriver.support import expected_conditions as EC
|
from selenium.webdriver.support import expected_conditions as EC
|
||||||
from selenium.webdriver.support.wait import WebDriverWait
|
from selenium.webdriver.support.wait import WebDriverWait
|
||||||
from helper import signup
|
|
||||||
|
|
||||||
def test_bug551():
|
def test_bug551():
|
||||||
driver = webdriver.Edge()
|
driver = webdriver.Edge()
|
||||||
driver.maximize_window()
|
driver.maximize_window()
|
||||||
driver.get("http://127.0.0.1:5000/")
|
driver.get("http://127.0.0.1:5000/")
|
||||||
|
|
||||||
username, password = signup("http://127.0.0.1:5000/", driver)
|
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
|
||||||
|
|
||||||
article = driver.find_element(By.ID, 'article')
|
article = driver.find_element(By.ID, 'article')
|
||||||
actions = ActionChains(driver)
|
actions = ActionChains(driver)
|
||||||
|
@ -23,4 +40,4 @@ def test_bug551():
|
||||||
actions.move_by_offset(450, 200)
|
actions.move_by_offset(450, 200)
|
||||||
actions.release()
|
actions.release()
|
||||||
actions.perform()
|
actions.perform()
|
||||||
time.sleep(5)
|
time.sleep(5)
|
Loading…
Reference in New Issue