diff options
author | Hui Lan <lanhui@zjnu.edu.cn> | 2021-02-11 18:34:54 +0800 |
---|---|---|
committer | Hui Lan <lanhui@zjnu.edu.cn> | 2021-02-11 18:34:54 +0800 |
commit | ccb7bce2da5efaace604a7b80c18ca9dcc9bb4dc (patch) | |
tree | d265f9e1462ae3e701788d05c6c42113885d1419 | |
parent | a092115806844e50cb413089328dcf2b0f9ad770 (diff) |
app/test/test_add_word.py and app/test/test_add_word.py: move to the matched word before taking the screenshot.
-rw-r--r-- | app/test/test_add_word.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/test/test_add_word.py b/app/test/test_add_word.py index 9c87e1c..4613dff 100644 --- a/app/test/test_add_word.py +++ b/app/test/test_add_word.py @@ -62,14 +62,15 @@ def test_add_word(): elem.click() elems = driver.find_elements_by_xpath("//p[@class='new-word']") - elems[0].location_once_scrolled_into_view - driver.save_screenshot('./app/test/test_add_word_pic3.png') found = 0 for elem in elems: if word in elem.text: found = 1 break + + elem.location_once_scrolled_into_view + driver.save_screenshot('./app/test/test_add_word_pic3.png') assert found == 1 finally: |