Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

chore: windows bots via github actions (#678)

Joel Einbinder184b25ff7b39
diff --git a/.cirrus.yml b/.cirrus.yml
index 41ac3430a9..b7f0975466 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -29,7 +29,7 @@ task:
dockerfile: .ci/node8/Dockerfile.linux
xvfb_start_background_script: Xvfb :99 -ac -screen 0 1024x768x24
install_script: npm install --unsafe-perm
- test_script: npm run funit
+ test_script: npm run ftest
task:
osx_instance:
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000000..03d42ee974
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,3 @@
+# text files must be lf for golden file tests to work
+*.txt eol=lf
+*.json eol=lf
diff --git a/.github/workflows/chromium.yml b/.github/workflows/chromium-linux.yml
similarity index 88%
rename from .github/workflows/chromium.yml
rename to .github/workflows/chromium-linux.yml
index fc2e6240de..7043d9bc4b 100644
--- a/.github/workflows/chromium.yml
+++ b/.github/workflows/chromium-linux.yml
@@ -1,4 +1,4 @@
-name: Chromium Tests
+name: Chromium Linux Tests
on:
push:
@@ -31,6 +31,6 @@ jobs:
run: |
npm install
npm run build
- xvfb-run --auto-servernum npm run unit
+ xvfb-run --auto-servernum npm run ctest
env:
CI: true
diff --git a/.github/workflows/chromium-windows.yml b/.github/workflows/chromium-windows.yml
new file mode 100644
index 0000000000..bfc8f08a5f
--- /dev/null
+++ b/.github/workflows/chromium-windows.yml
@@ -0,0 +1,32 @@
+name: Chromium Windows Tests
+
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+ branches:
+ - master
+
+jobs:
+ build:
+
+ runs-on: windows-latest
+
+ strategy:
+ matrix:
+ node-version: [12.x]
+
+ steps:
+ - uses: actions/checkout@v1
+ - name: Use Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v1
+ with:
+ node-version: ${{ matrix.node-version }}
+
+ - name: npm install, and test
+ run: |
+ npm install
+ npm run ctest
+ env:
+ CI: true
diff --git a/.github/workflows/firefox.yml b/.github/workflows/firefox-linux.yml
similarity index 86%
rename from .github/workflows/firefox.yml
rename to .github/workflows/firefox-linux.yml
index 463a704761..bf6a1548b2 100644
--- a/.github/workflows/firefox.yml
+++ b/.github/workflows/firefox-linux.yml
@@ -1,4 +1,4 @@
-name: Firefox Tests
+name: Firefox Linux Tests
on:
push:
@@ -30,7 +30,6 @@ jobs:
- name: npm install, build, and test
run: |
npm install
- npm run build
- xvfb-run --auto-servernum npm run funit
+ xvfb-run --auto-servernum npm run ftest
env:
CI: true
diff --git a/.github/workflows/firefox-windows.yml b/.github/workflows/firefox-windows.yml
new file mode 100644
index 0000000000..0fc413be63
--- /dev/null
+++ b/.github/workflows/firefox-windows.yml
@@ -0,0 +1,32 @@
+name: Firefox Windows Tests
+
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+ branches:
+ - master
+
+jobs:
+ build:
+
+ runs-on: windows-latest
+
+ strategy:
+ matrix:
+ node-version: [12.x]
+
+ steps:
+ - uses: actions/checkout@v1
+ - name: Use Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v1
+ with:
+ node-version: ${{ matrix.node-version }}
+
+ - name: npm install, and test
+ run: |
+ npm install
+ npm run ftest
+ env:
+ CI: true
diff --git a/.github/workflows/webkit.yml b/.github/workflows/webkit-linux.yml
similarity index 91%
rename from .github/workflows/webkit.yml
rename to .github/workflows/webkit-linux.yml
index 361306d567..c7ec50b0f3 100644
--- a/.github/workflows/webkit.yml
+++ b/.github/workflows/webkit-linux.yml
@@ -1,4 +1,4 @@
-name: WebKit Tests
+name: WebKit Linux Tests
on:
push:
@@ -35,7 +35,6 @@ jobs:
# The following logs LDD status of all webkit-wpe shared objects and executables.
# pushd .local-webkit/$(ls .local-webkit)/minibrowser-wpe; ls -1 | grep -v pw_run.sh | LD_LIBRARY_PATH=$PWD xargs ldd; popd
- npm run build
- xvfb-run --auto-servernum npm run wunit
+ xvfb-run --auto-servernum npm run wtest
env:
CI: true
diff --git a/.github/workflows/webkit-windows.yml b/.github/workflows/webkit-windows.yml
new file mode 100644
index 0000000000..93523b0eff
--- /dev/null
+++ b/.github/workflows/webkit-windows.yml
@@ -0,0 +1,32 @@
+name: WebKit Windows Tests
+
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+ branches:
+ - master
+
+jobs:
+ build:
+
+ runs-on: windows-latest
+
+ strategy:
+ matrix:
+ node-version: [12.x]
+
+ steps:
+ - uses: actions/checkout@v1
+ - name: Use Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v1
+ with:
+ node-version: ${{ matrix.node-version }}
+
+ - name: npm install, and test
+ run: |
+ npm install
+ npm run wtest
+ env:
+ CI: true
diff --git a/.travis.yml b/.travis.yml
index 0b08c3755b..9d37092630 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -25,11 +25,10 @@ cache:
directories:
- node_modules
script:
- - "npm run build"
- "npm run lint"
- - "xvfb-run --auto-servernum npm run unit"
- - "xvfb-run --auto-servernum npm run funit"
- - "xvfb-run --auto-servernum npm run wunit"
+ - "xvfb-run --auto-servernum npm run ctest"
+ - "xvfb-run --auto-servernum npm run ftest"
+ - "xvfb-run --auto-servernum npm run wtest"
jobs:
include:
- node_js: "12"
diff --git a/package.json b/package.json
index b6eb8a56ce..55675dbe62 100644
--- a/package.json
+++ b/package.json
@@ -13,18 +13,18 @@
"webkit_revision": "1120"
},
"scripts": {
- "unit": "node test/test.js",
- "funit": "cross-env BROWSER=firefox node test/test.js",
- "wunit": "cross-env BROWSER=webkit node test/test.js",
- "debug-unit": "node --inspect-brk test/test.js",
+ "ctest": "cross-env BROWSER=chromium node test/test.js",
+ "ftest": "cross-env BROWSER=firefox node test/test.js",
+ "wtest": "cross-env BROWSER=webkit node test/test.js",
+ "debug-test": "node --inspect-brk test/test.js",
"test-doclint": "node utils/doclint/check_public_api/test/test.js && node utils/doclint/preprocessor/test.js",
"test": "npm run lint --silent && npm run coverage && npm run test-doclint && node utils/testrunner/test/test.js",
"prepare": "node prepare.js",
"lint": "([ \"$CI\" = true ] && eslint --quiet -f codeframe --ext js,ts ./src || eslint --ext js,ts ./src) && npm run tsc && npm run doc",
"doc": "node utils/doclint/cli.js",
- "coverage": "cross-env COVERAGE=true npm run unit",
- "fcoverage": "cross-env COVERAGE=true BROWSER=firefox npm run unit",
- "wcoverage": "cross-env COVERAGE=true BROWSER=webkit npm run unit",
+ "ccoverage": "cross-env COVERAGE=true npm run ctest",
+ "fcoverage": "cross-env COVERAGE=true BROWSER=firefox node test/test.js",
+ "wcoverage": "cross-env COVERAGE=true BROWSER=webkit node test/test.js",
"tsc": "tsc -p .",
"clean": "rimraf lib",
"build": "node utils/runWebpack.js --mode='development' && tsc -p .",
diff --git a/test/chromium/headful.spec.js b/test/chromium/headful.spec.js
index 15ea7ca6f2..4aa4b9a574 100644
--- a/test/chromium/headful.spec.js
+++ b/test/chromium/headful.spec.js
@@ -24,7 +24,7 @@ const mkdtempAsync = util.promisify(fs.mkdtemp);
const TMP_FOLDER = path.join(os.tmpdir(), 'pw_tmp_folder-');
-module.exports.describe = function({testRunner, expect, playwright, defaultBrowserOptions, FFOX, CHROMIUM, WEBKIT}) {
+module.exports.describe = function({testRunner, expect, playwright, defaultBrowserOptions, FFOX, CHROMIUM, WEBKIT, WIN}) {
const {describe, xdescribe, fdescribe} = testRunner;
const {it, fit, xit, dit} = testRunner;
const {beforeAll, beforeEach, afterAll, afterEach} = testRunner;
@@ -67,7 +67,8 @@ module.exports.describe = function({testRunner, expect, playwright, defaultBrows
expect(pages).toEqual(['about:blank']);
await browser.close();
});
- it('headless should be able to read cookies written by headful', async({server}) => {
+ // see https://github.com/microsoft/playwright/issues/717
+ it.skip(WIN && CHROMIUM)('headless should be able to read cookies written by headful', async({server}) => {
const userDataDir = await mkdtempAsync(TMP_FOLDER);
// Write a cookie in headful chrome
const headfulBrowser = await playwright.launch(Object.assign({userDataDir}, headfulOptions));
diff --git a/test/launcher.spec.js b/test/launcher.spec.js
index 3f859c20c6..413be7f249 100644
--- a/test/launcher.spec.js
+++ b/test/launcher.spec.js
@@ -25,7 +25,7 @@ const mkdtempAsync = util.promisify(fs.mkdtemp);
const TMP_FOLDER = path.join(os.tmpdir(), 'pw_tmp_folder-');
-module.exports.describe = function({testRunner, expect, defaultBrowserOptions, playwright, playwrightPath, product, CHROMIUM, FFOX, WEBKIT}) {
+module.exports.describe = function({testRunner, expect, defaultBrowserOptions, playwright, playwrightPath, product, CHROMIUM, FFOX, WEBKIT, WIN}) {
const {describe, xdescribe, fdescribe} = testRunner;
const {it, fit, xit, dit} = testRunner;
const {beforeAll, beforeEach, afterAll, afterEach} = testRunner;
@@ -317,8 +317,8 @@ module.exports.describe = function({testRunner, expect, defaultBrowserOptions, p
// This might throw. See https://github.com/GoogleChrome/puppeteer/issues/2778
await rmAsync(userDataDir).catch(e => {});
});
- // This mysteriously fails on Windows on AppVeyor. See https://github.com/GoogleChrome/puppeteer/issues/4111
- it.skip(FFOX)('userDataDir option should restore cookies', async({server}) => {
+ // See https://github.com/microsoft/playwright/issues/717
+ it.skip(FFOX || (WIN && CHROMIUM))('userDataDir option should restore cookies', async({server}) => {
const userDataDir = await mkdtempAsync(TMP_FOLDER);
const options = Object.assign({userDataDir}, defaultBrowserOptions);
const browser = await playwright.launch(options);