From 2ee854285c5f8eb4cb2ab8a090d3d440ef8c9e82 Mon Sep 17 00:00:00 2001 From: Zjh-jc Date: Thu, 17 Jun 2021 09:51:53 +0800 Subject: [PATCH] Test the page position after clicking the Familiar or Unfamiliar button. --- app/test/test_page_position.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/test/test_page_position.py b/app/test/test_page_position.py index 284c5ed..21a6722 100644 --- a/app/test/test_page_position.py +++ b/app/test/test_page_position.py @@ -15,7 +15,7 @@ driver.implicitly_wait(10) HOME_PAGE = 'http://121.4.94.30:91/' -def test_by_random(text): +def click_by_random(text): elements = driver.find_elements_by_link_text(text) # 点击单词表中的第一个单词的熟悉按钮 elements[randint(0, len(elements) - 1)].click() try: @@ -47,13 +47,13 @@ def test_page_position(): driver.find_element_by_xpath('//form[1]/p[3]/input[1]').click() # 找到登录按钮 # 这里随机测试三个单词,点击熟悉 - test_by_random('熟悉') - test_by_random('熟悉') - test_by_random('熟悉') + click_by_random('熟悉') + click_by_random('熟悉') + click_by_random('熟悉') # 这里随机测试三个单词,点击不熟悉 - test_by_random('不熟悉') - test_by_random('不熟悉') - test_by_random('不熟悉') + click_by_random('不熟悉') + click_by_random('不熟悉') + click_by_random('不熟悉') finally: driver.quit()