Skip to content

Commit 36657fa

Browse files
Added Playwright calls for assertions
1 parent ac9b9de commit 36657fa

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/test_search.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ def test_basic_duckduckgo_search(page):
1313
page.click('#search_button_homepage')
1414

1515
# Then the search result query is the phrase
16+
assert 'panda' == page.input_value('#search_form_input')
17+
1618
# And the search result links pertain to the phrase
19+
page.locator('.result__title a.result__a >> nth=4').wait_for()
20+
titles = page.locator('.result__title a.result__a').all_text_contents()
21+
matches = [t for t in titles if 'panda' in t.lower()]
22+
assert len(matches) > 0
23+
1724
# And the search result title contains the phrase
18-
pass
25+
assert 'panda' in page.title()

0 commit comments

Comments
 (0)