forked from mrlan/EnglishPal
更新 app/test/test_bug551_DingZeYu.py
parent
d97743649a
commit
9afd38a09a
|
@ -23,11 +23,14 @@ def test_bug551(driver, URL):
|
|||
actions.release()
|
||||
actions.perform()
|
||||
|
||||
# 获取选中部分的单词所应用的 CSS 样式
|
||||
highlighted_word_font_weight = article.value_of_css_property("font-weight")
|
||||
# 获取选中部分的单词的HTML元素
|
||||
highlighted_words = driver.find_elements(By.CLASS_NAME, 'highlighted')
|
||||
|
||||
# 验证高亮显示的 CSS 样式是否符合预期
|
||||
expected_highlighted_word_font_weight = "300"
|
||||
assert highlighted_word_font_weight == expected_highlighted_word_font_weight, f"选中部分的单词的字体样式错误"
|
||||
# 验证选中部分的单词是否同时应用了需求样式
|
||||
expected_font_weight = "400"
|
||||
|
||||
for word in highlighted_words:
|
||||
font_weight = word.value_of_css_property("font-weight")
|
||||
assert font_weight == expected_font_weight, f"选中部分的单词的字体样式错误"
|
||||
|
||||
time.sleep(5)
|
Loading…
Reference in New Issue