Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
test: interception breaks remote importScripts (#5953)
Ross Wollman01208967719c
diff --git a/test/assets/worker/import-me.js b/test/assets/worker/import-me.jsnew file mode 100644index 0000000000..5831faf120--- /dev/null+++ b/test/assets/worker/import-me.js@@ -0,0 +1 @@+console.log("hello from import-me.js");diff --git a/test/assets/worker/worker-http-import.html b/test/assets/worker/worker-http-import.htmlnew file mode 100644index 0000000000..7e539d1021--- /dev/null+++ b/test/assets/worker/worker-http-import.html@@ -0,0 +1,14 @@+<!DOCTYPE html>+<html>+ <head>+ <title>Remote importScripts Test</title>+ </head>+ <html>+ <div id="status">-</div>+ <script>+ new Worker('worker-http-import.js').addEventListener("message", ({ data }) => {+ document.getElementById("status").innerText = data;+ });+ </script>+ </html>+</html>diff --git a/test/assets/worker/worker-http-import.js b/test/assets/worker/worker-http-import.jsnew file mode 100644index 0000000000..e18612705e--- /dev/null+++ b/test/assets/worker/worker-http-import.js@@ -0,0 +1,4 @@+console.log("hello from worker-http-import.js");+importScripts("./import-me.js")+console.log("successfully imported");+self.postMessage("finished");diff --git a/test/interception.spec.ts b/test/interception.spec.tsindex d4fbb237d5..d830944376 100644--- a/test/interception.spec.ts+++ b/test/interception.spec.ts@@ -146,3 +146,13 @@ it('should work with regular expression passed from a different context', asyncexpect(response.ok()).toBe(true);expect(intercepted).toBe(true);});++it('should not break remote worker importScripts', (test, { browserName }) => {+ test.fail(browserName === 'chromium');+}, async ({ page, server, context }) => {+ context.route('**', async request => {+ await request.continue();+ });+ await page.goto(server.PREFIX + '/worker/worker-http-import.html');+ await page.waitForSelector("#status:has-text('finished')");+});