-
Notifications
You must be signed in to change notification settings - Fork 5k
Closed
Description
Context:
- Playwright Version: 1.2.0
- Operating System: Mac
- Node version: 12.13.0
- Browser: Chromium
- Extra: using playwright-video plugin
Code Snippet
const { chromium } = require('playwright')
const { saveVideo } = require('playwright-video');
describe('user', function() {
beforeEach(async function() {
// await saveVideo(page, `/tmp/video/${this.test.ctx.currentTest.title.replace(' ', '_')}.mp4`);
})
afterEach(async function() {
await page.screenshot({ path: `/tmp/${this.test.ctx.currentTest.title}.png` })
})
describe('edit', function() {
it('user info', async function() {
...
})
})
}Describe the bug
I'm using Mocha to run my tests and I'm trying to store the screenshots taken on a tmp folder on the project root. If the folder doesn't exist, page.screenshot returns the following error:
Error: ENOENT: no such file or directory, open 'tmp/user info.png'
Note: use DEBUG=pw:api environment variable and rerun to capture Playwright logs.
-- ASYNC --
at Page.screenshot (node_modules/playwright/lib/helper.js:78:23)
at Context.<anonymous> (test/mocha/user.js:62:16)
at processImmediate (internal/timers.js:439:21)PoC
In the first run, I had saveVideo function being called, and it created the tmp folder on the root. In the second run, I commented the saveVideo line and removed the previously created folder to see if page.screenshot were able to create a new folder. Recorded a video to demonstrate the scenario. 👇
jhildenbiddle
Metadata
Metadata
Assignees
Labels
No labels