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 index b8367b26b4..03d42ee974 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,3 @@ -# .txt files must be lf for golden file tests to work +# text files must be lf for golden file tests to work *.txt eol=lf - +*.json eol=lf diff --git a/.github/workflows/chromium-linux.yml b/.github/workflows/chromium-linux.yml index 18fccf8865..7043d9bc4b 100644 --- a/.github/workflows/chromium-linux.yml +++ b/.github/workflows/chromium-linux.yml @@ -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 index 45a11fb240..bfc8f08a5f 100644 --- a/.github/workflows/chromium-windows.yml +++ b/.github/workflows/chromium-windows.yml @@ -27,6 +27,6 @@ jobs: - name: npm install, and test run: | npm install - npm run unit + npm run ctest env: CI: true diff --git a/.github/workflows/firefox-linux.yml b/.github/workflows/firefox-linux.yml index 8e2e1375fd..bf6a1548b2 100644 --- a/.github/workflows/firefox-linux.yml +++ b/.github/workflows/firefox-linux.yml @@ -30,6 +30,6 @@ jobs: - name: npm install, build, and test run: | npm install - 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 index 03b9e12321..0fc413be63 100644 --- a/.github/workflows/firefox-windows.yml +++ b/.github/workflows/firefox-windows.yml @@ -27,6 +27,6 @@ jobs: - name: npm install, and test run: | npm install - npm run funit + npm run ftest env: CI: true diff --git a/.github/workflows/webkit-linux.yml b/.github/workflows/webkit-linux.yml index e8dc4a9495..c7ec50b0f3 100644 --- a/.github/workflows/webkit-linux.yml +++ b/.github/workflows/webkit-linux.yml @@ -35,6 +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 - 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 index abd1ee65ef..93523b0eff 100644 --- a/.github/workflows/webkit-windows.yml +++ b/.github/workflows/webkit-windows.yml @@ -27,6 +27,6 @@ jobs: - name: npm install, and test run: | npm install - npm run wunit + 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 1befbb03b1..1ba88369cf 100644 --- a/package.json +++ b/package.json @@ -13,18 +13,18 @@ "webkit_revision": "1113" }, "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..327947ab2a 100644 --- a/test/chromium/headful.spec.js +++ b/test/chromium/headful.spec.js @@ -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 f0fe24fa46..c5cd1c5ee2 100644 --- a/test/launcher.spec.js +++ b/test/launcher.spec.js @@ -26,7 +26,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; @@ -342,8 +342,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);