diff --git a/.npmrc b/.npmrc new file mode 100644 index 00000000..c9e722c3 --- /dev/null +++ b/.npmrc @@ -0,0 +1,5 @@ +// SPDX-FileCopyrightText: 2022 The Manyverse Authors +// +// SPDX-License-Identifier: Unlicense + +PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 diff --git a/package-lock.json b/package-lock.json index c35fdd19..5ecfcdd3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6846,14 +6846,6 @@ "optional": true, "requires": { "follow-redirects": "^1.14.8" - }, - "dependencies": { - "follow-redirects": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", - "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", - "optional": true - } } }, "babel-runtime": { @@ -7911,7 +7903,8 @@ "follow-redirects": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.1.tgz", - "integrity": "sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg==" + "integrity": "sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg==", + "optional": true }, "forever-agent": { "version": "0.6.1", @@ -21510,7 +21503,7 @@ "node-dir": { "version": "0.1.17", "resolved": "https://registry.npmjs.org/node-dir/-/node-dir-0.1.17.tgz", - "integrity": "sha1-X1Zl2TNRM1yqvvjxxVRRbPXx5OU=", + "integrity": "sha512-tmPX422rYgofd4epzrNoOXiE8XFZYOcCq1vD7MAXCDO+O+zndlA2ztdKKMa+EeuBG5tHETpr4ml4RGgpqDCCAg==", "requires": { "minimatch": "^3.0.2" } @@ -21699,7 +21692,7 @@ "normalize-css-color": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/normalize-css-color/-/normalize-css-color-1.0.2.tgz", - "integrity": "sha512-jPJ/V7Cp1UytdidsPqviKEElFQJs22hUUgK5BOPHTwOonNCk7/2qOxhhqzEajmFrWJowADFfOFh1V+aWkRfy+w==" + "integrity": "sha1-Apkel8zOxmI/5XOvu/Deah8+n40=" }, "normalize-package-data": { "version": "2.4.0", @@ -22699,6 +22692,15 @@ } } }, + "playwright": { + "version": "1.28.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.28.1.tgz", + "integrity": "sha512-92Sz6XBlfHlb9tK5UCDzIFAuIkHHpemA9zwUaqvo+w7sFMSmVMGmvKcbptof/eJObq63PGnMhM75x7qxhTR78Q==", + "dev": true, + "requires": { + "playwright-core": "1.28.1" + } + }, "playwright-core": { "version": "1.28.1", "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.28.1.tgz", diff --git a/package.json b/package.json index ea07725b..3c56df4c 100644 --- a/package.json +++ b/package.json @@ -202,6 +202,7 @@ "node-gyp-build": "4.3.0", "ora": "^5.4.1", "patch-package": "6.4.7", + "playwright": "^1.28.1", "playwright-core": "1.28.1", "prettier": "~2.5.1", "pretty-quick": "~3.1.3", diff --git a/test/e2e/desktop/utils.ts b/test/e2e/desktop/utils.ts index 7dc6dde4..9ed3cc0d 100644 --- a/test/e2e/desktop/utils.ts +++ b/test/e2e/desktop/utils.ts @@ -26,7 +26,10 @@ export default function setup(subtest?: string) { const appInfo = parseElectronApp(latestBuild); console.log = originalConsoleLog; if (!appInfo.arch) appInfo.arch = 'x64'; - if (!appInfo.executable.endsWith('/manyverse')) { + if ( + appInfo.platform === 'linux' && + !appInfo.executable.endsWith('/manyverse') + ) { appInfo.executable += '/manyverse'; } diff --git a/tools/test-e2e-desktop b/tools/test-e2e-desktop index 5ff00082..d6179a75 100755 --- a/tools/test-e2e-desktop +++ b/tools/test-e2e-desktop @@ -6,7 +6,7 @@ function cleanUp { if [ -f "appium-server.pid" ]; then - if ps -p $(cat appium-server.pid)> /dev/null; then + if ps -p $(cat appium-server.pid) >/dev/null; then kill -KILL $(cat appium-server.pid) fi rm appium-server.pid @@ -25,14 +25,21 @@ function onFailure() { exit 1 } -FILE=desktop/outputs/linux-unpacked/manyverse -if [[ -f "$FILE" ]]; then - echo "Desktop build already exists" +if [[ "$OSTYPE" == "darwin"* ]]; then + RELEASE_DESKTOP_SUFFIX="macos" + EXECUTABLE_FILE=desktop/outputs/mac/Manyverse.app/Contents/MacOS/Manyverse else - echo "Desktop build does not exist, building now" - EB_PUBLISH=never npm run release-desktop-linux + RELEASE_DESKTOP_SUFFIX="linux" + EXECUTABLE_FILE=desktop/outputs/linux-unpacked/manyverse fi -rm -rf /tmp/manyverse-e2e-test +if [[ -f "$EXECUTABLE_FILE" ]]; then + echo "Desktop build already exists" +else + echo "Desktop build does not exist, building now" + EB_PUBLISH=never npm run release-desktop-"$RELEASE_DESKTOP_SUFFIX" +fi + +rm -rf "$TMPDIR/manyverse-e2e-test" $(npm bin)/playwright test