@@ -6,7 +6,7 @@ describe('search', async function () {
66 this . timeout ( 10000 ) ;
77 let driver ;
88
9- if ( ! fs . existsSync ( './screenshots' ) ) {
9+ if ( ! fs . existsSync ( './screenshots' ) ) {
1010 fs . mkdirSync ( './screenshots' ) ;
1111 }
1212
@@ -15,26 +15,25 @@ describe('search', async function () {
1515 // Automate DuckDuckGo search
1616 await driver . get ( 'https://duckduckgo.com/' ) ;
1717 const searchBox = await driver . findElement (
18- By . id ( 'search_form_input_homepage ' ) ) ;
18+ By . id ( 'searchbox_input ' ) ) ;
1919 await searchBox . sendKeys ( term , Key . ENTER ) ;
2020
2121 // Wait until the result page is loaded
22- await driver . wait ( until . elementLocated ( By . css ( '#links .result ' ) ) ) ;
22+ await driver . wait ( until . elementLocated ( By . css ( '#more-results ' ) ) ) ;
2323
2424 // Return page content
25- const body = await driver . findElement ( By . tagName ( 'body' ) ) ;
26- return await body . getText ( ) ;
25+ return await driver . getPageSource ( ) ;
2726 } ;
2827
2928 // Make sure the BROWSER env variable is set
30- before ( async function ( ) {
29+ before ( async function ( ) {
3130 if ( ! process . env . BROWSER ) {
3231 throw new Error ( 'No BROWSER environment variable set' )
3332 }
3433 } ) ;
3534
3635 // Before each test, initialize Selenium and launch the browser
37- beforeEach ( async function ( ) {
36+ beforeEach ( async function ( ) {
3837 // Microsoft uses a longer name for Edge
3938 let browser = process . env . BROWSER ;
4039 if ( browser == 'edge' ) {
0 commit comments