Skip to content

Commit e6d2ca1

Browse files
authored
Update main_test.js
1 parent 71761a7 commit e6d2ca1

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

lab4/main_test.js

+4-8
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,11 @@ const puppeteer = require('puppeteer');
1414

1515
// Type into search box
1616
await page.waitForSelector('#docsearch-input');
17+
await page.type('#docsearch-input', 'Experimental WebDriver BiDi support', { delay: 150 });
1718

18-
// Wait for search result
19-
await page.type('#docsearch-input', 'chipi chipi chapa chapa', { delay: 150 });
20-
21-
// Get the `Docs` result section
22-
await page.waitForSelector('#docsearch-item-5');
23-
24-
// Click on first result in `Docs` section
25-
await page.click('#docsearch-item-5');
19+
// Wait for search result and click on the first result
20+
await page.waitForSelector('.DocSearch-Hit-content');
21+
await page.click('.DocSearch-Hit-content');
2622

2723
// Locate the title
2824
let textSelector = await page.waitForSelector('h1');

0 commit comments

Comments
 (0)