Skip to content

Commit

Permalink
fix: screenshots for sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
kobenguyent committed Jan 17, 2025
1 parent 117c6c1 commit 4ed055c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/helper/WebDriver.js
Original file line number Diff line number Diff line change
Expand Up @@ -1788,14 +1788,14 @@ class WebDriver extends Helper {

if (browser) {
this.debug(`Screenshot of ${sessionName} session has been saved to ${outputFile}`)
return browser.saveScreenshot(outputFile)
await browser.saveScreenshot(outputFile)
}
}
}

if (!fullPage) {
this.debug(`Screenshot has been saved to ${outputFile}`)
return this.browser.saveScreenshot(outputFile)
await this.browser.saveScreenshot(outputFile)
}

const originalWindowSize = await this.browser.getWindowSize()
Expand Down
2 changes: 1 addition & 1 deletion test/acceptance/session_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Scenario('Different cookies for different sessions @Playwright @Puppeteer', asyn
I.expectNotEqual(cookies.john, cookies.mary)
})

Scenario('should save screenshot for sessions @Puppeteer @Playwright', async function ({ I }) {
Scenario('should save screenshot for sessions @Puppeteer @Playwright @WebDriver', async function ({ I }) {
await I.amOnPage('/form/bug1467')
await I.saveScreenshot('original.png')
await I.amOnPage('/')
Expand Down

0 comments on commit 4ed055c

Please sign in to comment.