@web/test-runner-chrome
Advanced tools
Comparing version 0.4.0 to 0.4.1
# @web/test-runner-chrome | ||
## 0.4.1 | ||
### Patch Changes | ||
- 45a2f21: add ability to run HTML tests | ||
## 0.4.0 | ||
@@ -4,0 +10,0 @@ |
@@ -5,5 +5,3 @@ "use strict"; | ||
const puppeteer_core_1 = require("puppeteer-core"); | ||
const test_runner_core_1 = require("@web/test-runner-core"); | ||
const findExecutablePath_1 = require("./findExecutablePath"); | ||
const { PARAM_SESSION_ID, PARAM_DEBUG } = test_runner_core_1.constants; | ||
function chromeLauncher({ executablePath: customExecutablePath, puppeteer, args, } = {}) { | ||
@@ -13,7 +11,4 @@ const executablePath = customExecutablePath !== null && customExecutablePath !== void 0 ? customExecutablePath : findExecutablePath_1.findExecutablePath(); | ||
const inactivePages = []; | ||
let config; | ||
let serverAddress; | ||
let browser; | ||
let debugBrowser = undefined; | ||
const createUrl = (session) => `${serverAddress}?${PARAM_SESSION_ID}=${session.id}`; | ||
function launchBrowser(options = {}) { | ||
@@ -28,6 +23,4 @@ if (puppeteer) { | ||
return { | ||
async start(_config) { | ||
config = _config; | ||
async start() { | ||
browser = await launchBrowser(); | ||
serverAddress = `${config.address}:${config.port}/`; | ||
return ['Chrome']; | ||
@@ -43,3 +36,3 @@ }, | ||
}, | ||
async startSession(session) { | ||
async startSession(session, url) { | ||
if (!browser.isConnected()) { | ||
@@ -56,3 +49,3 @@ throw new Error('Browser is closed'); | ||
activePages.set(session.id, page); | ||
await page.goto(createUrl(session)); | ||
await page.goto(url); | ||
}, | ||
@@ -66,3 +59,3 @@ stopSession(session) { | ||
}, | ||
async startDebugSession(session) { | ||
async startDebugSession(session, url) { | ||
if (debugBrowser === null || debugBrowser === void 0 ? void 0 : debugBrowser.isConnected()) { | ||
@@ -73,3 +66,3 @@ await debugBrowser.close(); | ||
const page = await debugBrowser.newPage(); | ||
await page.goto(`${createUrl(session)}&${PARAM_DEBUG}=true`); | ||
await page.goto(url); | ||
}, | ||
@@ -76,0 +69,0 @@ }; |
{ | ||
"name": "@web/test-runner-chrome", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"publishConfig": { | ||
@@ -43,5 +43,5 @@ "access": "public" | ||
"devDependencies": { | ||
"@web/test-runner-mocha": "^0.2.0", | ||
"@web/test-runner-server": "^0.4.1" | ||
"@web/test-runner-mocha": "^0.2.1", | ||
"@web/test-runner-server": "^0.4.2" | ||
} | ||
} |
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
10724
119