We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 11ffa5d commit 7b741dfCopy full SHA for 7b741df
lab4/main_test.js
@@ -17,8 +17,13 @@ const puppeteer = require('puppeteer');
17
await page.type('#docsearch-input', 'Experimental WebDriver BiDi support', { delay: 150 });
18
19
// Wait for search result and click on the first result
20
- await page.waitForSelector('.DocSearch-Hit-content', { timeout: 60000 });
21
- await page.click('.DocSearch-Hit-content');
+ await page.waitForSelector('.DocSearch-Hits', { timeout: 60000 });
+ const hits = await page.$$('.DocSearch-Hit');
22
+ if (hits.length > 0) {
23
+ await hits[0].click();
24
+ } else {
25
+ throw new Error('No search results found');
26
+ }
27
28
// Locate the title
29
let textSelector = await page.waitForSelector('h1', { timeout: 60000 });
0 commit comments