@web/test-runner-playwright
Advanced tools
Comparing version 0.4.4 to 0.4.5
# @web/test-runner-playwright | ||
## 0.4.5 | ||
### Patch Changes | ||
- 1d6d498: allow changing viewport in tests | ||
- Updated dependencies [1d6d498] | ||
- @web/test-runner-core@0.6.5 | ||
## 0.4.4 | ||
@@ -4,0 +12,0 @@ |
@@ -19,2 +19,3 @@ "use strict"; | ||
const activePages = new Map(); | ||
const debugPages = new Map(); | ||
const inactivePages = []; | ||
@@ -71,2 +72,3 @@ let config; | ||
activePages.set(session.id, page); | ||
await page.setViewportSize({ height: 600, width: 800 }); | ||
await page.goto(url); | ||
@@ -96,4 +98,16 @@ }, | ||
const page = await browser.newPage(); | ||
debugPages.set(session.id, page); | ||
page.on('close', () => { | ||
debugPages.delete(session.id); | ||
}); | ||
await page.goto(url); | ||
}, | ||
setViewport(session, viewport) { | ||
const page = activePages.get(session.id); | ||
const debugPage = debugPages.get(session.id); | ||
if (!page && !debugPage) { | ||
throw new Error(`Cannot set viewport for inactive session: ${session.id}`); | ||
} | ||
return (page || debugPage).setViewportSize(viewport); | ||
}, | ||
}; | ||
@@ -100,0 +114,0 @@ } |
{ | ||
"name": "@web/test-runner-playwright", | ||
"version": "0.4.4", | ||
"version": "0.4.5", | ||
"publishConfig": { | ||
@@ -39,3 +39,3 @@ "access": "public" | ||
"dependencies": { | ||
"@web/test-runner-core": "^0.6.4", | ||
"@web/test-runner-core": "^0.6.5", | ||
"@web/test-runner-coverage-v8": "^0.0.2", | ||
@@ -46,4 +46,4 @@ "playwright": "^1.2.0" | ||
"@web/test-runner-mocha": "^0.2.6", | ||
"@web/test-runner-server": "^0.5.7" | ||
"@web/test-runner-server": "^0.5.8" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13661
118
Updated@web/test-runner-core@^0.6.5