From f7629f4d1ca2b1fcda24278575503652b7f709f6 Mon Sep 17 00:00:00 2001 From: Zjh-jc Date: Thu, 17 Jun 2021 09:41:33 +0800 Subject: [PATCH] Test the page position after clicking the Familiar or Unfamiliar button. --- app/test/test_page_position.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/test/test_page_position.py b/app/test/test_page_position.py index 4a3282f..284c5ed 100644 --- a/app/test/test_page_position.py +++ b/app/test/test_page_position.py @@ -21,7 +21,7 @@ def test_by_random(text): try: location = driver.find_element_by_xpath('//a[@name="aaa"]').location # 点击后单词次数≥1 roll_height = get_scrollTop() # 获取滚动条的位置 - assert int(location - roll_height) == 0 # 差值小于1 + assert int(location['y'] - roll_height) == 0 # 差值小于1 except NoSuchElementException: # 点击后单词消失,scrollTop=0,页面回到最上面 roll_height = get_scrollTop() assert roll_height == 0