From 4025600be51b5a15abc54469aa50c012e5616e77 Mon Sep 17 00:00:00 2001 From: Hui Lan Date: Wed, 10 Feb 2021 18:06:35 +0800 Subject: app/test/test_add_word.py: locate the correct form. --- app/test/test_add_word.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/test/test_add_word.py b/app/test/test_add_word.py index 4ff5a75..e37683c 100644 --- a/app/test/test_add_word.py +++ b/app/test/test_add_word.py @@ -41,14 +41,13 @@ def test_add_word(): elem = driver.find_element_by_id('text-content') essay_content = elem.text - # click Next elem = driver.find_element_by_id('selected-words') word = random.choice(essay_content.split()) while 'font>' in word or 'br>' in word or 'p>' in word or len(word) < 5 or has_punctuation(word): word = random.choice(essay_content.split()) elem.send_keys(word) driver.save_screenshot('./app/test/test_add_word_pic1.png') - elem = driver.find_element_by_xpath('//form[1]//input[1]') # 找到get所有词频按钮 + elem = driver.find_element_by_xpath('//form[2]//input[1]') # 找到get所有词频按钮 elem.click() elems = driver.find_elements_by_xpath("//input[@type='checkbox']") -- cgit v1.2.1