0
0
Fork 0

我又将tangxinyuan小组的测试代码改回去了,我改完我的测试代码之后,只有使用未经我修改的tangxinyuan小组的测试代码才能通过。

Bug545-HuangHuiLing
1994836463@qq.com 2024-05-27 14:26:54 +08:00
parent 101c359596
commit 4a42c5c22c
1 changed files with 1 additions and 3 deletions

View File

@ -2,7 +2,6 @@ import random
import string import string
import time import time
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support import expected_conditions as EC
@ -39,8 +38,7 @@ def test_save_selected_word(driver, URL):
stored_words = driver.execute_script('return localStorage.getItem("selectedWords");') stored_words = driver.execute_script('return localStorage.getItem("selectedWords");')
assert word == stored_words, "Selected word not saved to localStorage correctly" assert word == stored_words, "Selected word not saved to localStorage correctly"
# 退出并重新登录以检查存储的单词 # 退出并重新登录以检查存储的单词
action_chains = ActionChains(driver) driver.find_element(By.LINK_TEXT, '退出').click()
action_chains.click(driver.find_element(By.LINK_TEXT, '退出')).perform()
driver.execute_script("window.open('');window.close();") driver.execute_script("window.open('');window.close();")
# 等待一会儿,让浏览器有足够的时间关闭标签页 # 等待一会儿,让浏览器有足够的时间关闭标签页