From 15f833027e3419b9ecf56b6639b7eaf6d1eed6cd Mon Sep 17 00:00:00 2001 From: REI-MORI Date: Wed, 22 Nov 2023 01:37:58 +0900 Subject: [PATCH 01/12] Configure Playwright #1451 --- .gitignore | 6 +- package-lock.json | 76 ++++++++++--------------- package.json | 3 +- playwright.config.ts | 129 +++++-------------------------------------- tests/test.ts | 4 +- 5 files changed, 53 insertions(+), 165 deletions(-) diff --git a/.gitignore b/.gitignore index 89b035d0..446213b1 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,8 @@ node_modules /coverage/ playwright/.auth /actions-runner/ -nohup.out \ No newline at end of file +nohup.out +/test-results/ +/playwright-report/ +/blob-report/ +/playwright/.cache/ diff --git a/package-lock.json b/package-lock.json index 4996d4ab..44d28ad0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,13 +34,14 @@ "winston-daily-rotate-file": "^4.7.1" }, "devDependencies": { - "@playwright/test": "^1.38.0", + "@playwright/test": "^1.40.0", "@sveltejs/adapter-node": "^1.3.1", "@sveltejs/kit": "^1.25.0", "@types/express": "^4.17.17", "@types/glob": "^8.1.0", "@types/imap-simple": "^4.2.6", "@types/morgan": "^1.9.5", + "@types/node": "^20.9.3", "@types/nodemailer": "^6.4.10", "@types/nprogress": "^0.2.0", "@types/prettier": "^2.7.3", @@ -105,7 +106,6 @@ "version": "2.2.1", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", - "dev": true, "dependencies": { "@jridgewell/gen-mapping": "^0.3.0", "@jridgewell/trace-mapping": "^0.3.9" @@ -940,7 +940,6 @@ "version": "0.3.3", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", - "dev": true, "dependencies": { "@jridgewell/set-array": "^1.0.1", "@jridgewell/sourcemap-codec": "^1.4.10", @@ -954,7 +953,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", - "dev": true, "engines": { "node": ">=6.0.0" } @@ -963,7 +961,6 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", - "dev": true, "engines": { "node": ">=6.0.0" } @@ -971,14 +968,12 @@ "node_modules/@jridgewell/sourcemap-codec": { "version": "1.4.15", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", - "dev": true + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.19", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz", "integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==", - "dev": true, "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" @@ -1040,12 +1035,12 @@ } }, "node_modules/@playwright/test": { - "version": "1.38.0", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.38.0.tgz", - "integrity": "sha512-xis/RXXsLxwThKnlIXouxmIvvT3zvQj1JE39GsNieMUrMpb3/GySHDh2j8itCG22qKVD4MYLBp7xB73cUW/UUw==", + "version": "1.40.0", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.40.0.tgz", + "integrity": "sha512-PdW+kn4eV99iP5gxWNSDQCbhMaDVej+RXL5xr6t04nbKLCBwYtA046t7ofoczHOm8u6c+45hpDKQVZqtqwkeQg==", "dev": true, "dependencies": { - "playwright": "1.38.0" + "playwright": "1.40.0" }, "bin": { "playwright": "cli.js" @@ -1084,7 +1079,7 @@ "version": "5.3.0", "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.3.0.tgz", "integrity": "sha512-3U3u/pa+QYfrV2z2rU6cBmzOZYPVEh1cXvg35PbaYFBQipFep54tp+mD9KJhlouT57pMKPERgjcPFR+UZ/BWjg==", - "dev": true, + "devOptional": true, "hasInstallScript": true }, "node_modules/@prisma/engines-version": { @@ -1487,8 +1482,7 @@ "node_modules/@types/estree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.1.tgz", - "integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==", - "dev": true + "integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==" }, "node_modules/@types/express": { "version": "4.17.17", @@ -1594,9 +1588,12 @@ } }, "node_modules/@types/node": { - "version": "20.6.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.6.0.tgz", - "integrity": "sha512-najjVq5KN2vsH2U/xyh2opaSEz6cZMR2SetLIlxlj08nOcmPOemJmUK2o4kUzfLqfrWE0PIrNeE16XhYDd3nqg==" + "version": "20.9.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.3.tgz", + "integrity": "sha512-nk5wXLAXGBKfrhLB0cyHGbSqopS+nz0BUgZkUQqSHSSgdee0kssp1IAqlQOu333bW+gMNs2QREx7iynm19Abxw==", + "dependencies": { + "undici-types": "~5.26.4" + } }, "node_modules/@types/nodemailer": { "version": "6.4.10", @@ -2058,7 +2055,6 @@ "version": "8.10.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", - "dev": true, "bin": { "acorn": "bin/acorn" }, @@ -2227,7 +2223,6 @@ "version": "5.3.0", "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz", "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==", - "dev": true, "dependencies": { "dequal": "^2.0.3" } @@ -2346,7 +2341,6 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.2.1.tgz", "integrity": "sha512-jsyHu61e6N4Vbz/v18DHwWYKK0bSWLqn47eeDSKPB7m8tqMHF9YJ+mhIk2lVteyZrY8tnSj/jHOv4YiTCuCJgg==", - "dev": true, "dependencies": { "dequal": "^2.0.3" } @@ -2939,7 +2933,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/code-red/-/code-red-1.0.4.tgz", "integrity": "sha512-7qJWqItLA8/VPVlKJlFXU+NBlo/qyfs39aJcuMT/2ere32ZqvF5OSxgdM5xOfJJ7O429gg2HM47y8v9P+9wrNw==", - "dev": true, "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.15", "@types/estree": "^1.0.1", @@ -2952,7 +2945,6 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", - "dev": true, "dependencies": { "@types/estree": "^1.0.0" } @@ -3182,7 +3174,6 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz", "integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==", - "dev": true, "dependencies": { "mdn-data": "2.0.30", "source-map-js": "^1.0.1" @@ -3395,7 +3386,6 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", - "dev": true, "engines": { "node": ">=6" } @@ -5608,8 +5598,7 @@ "node_modules/locate-character": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/locate-character/-/locate-character-3.0.0.tgz", - "integrity": "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==", - "dev": true + "integrity": "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==" }, "node_modules/locate-path": { "version": "6.0.0", @@ -5805,8 +5794,7 @@ "node_modules/mdn-data": { "version": "2.0.30", "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", - "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==", - "dev": true + "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==" }, "node_modules/media-typer": { "version": "0.3.0", @@ -6572,7 +6560,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/periscopic/-/periscopic-3.1.0.tgz", "integrity": "sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==", - "dev": true, "dependencies": { "@types/estree": "^1.0.0", "estree-walker": "^3.0.0", @@ -6583,7 +6570,6 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", - "dev": true, "dependencies": { "@types/estree": "^1.0.0" } @@ -6592,7 +6578,6 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.2.tgz", "integrity": "sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==", - "dev": true, "dependencies": { "@types/estree": "*" } @@ -6657,12 +6642,12 @@ } }, "node_modules/playwright": { - "version": "1.38.0", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.38.0.tgz", - "integrity": "sha512-fJGw+HO0YY+fU/F1N57DMO+TmXHTrmr905J05zwAQE9xkuwP/QLDk63rVhmyxh03dYnEhnRbsdbH9B0UVVRB3A==", + "version": "1.40.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.40.0.tgz", + "integrity": "sha512-gyHAgQjiDf1m34Xpwzaqb76KgfzYrhK7iih+2IzcOCoZWr/8ZqmdBw+t0RU85ZmfJMgtgAiNtBQ/KS2325INXw==", "dev": true, "dependencies": { - "playwright-core": "1.38.0" + "playwright-core": "1.40.0" }, "bin": { "playwright": "cli.js" @@ -6675,9 +6660,9 @@ } }, "node_modules/playwright-core": { - "version": "1.38.0", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.38.0.tgz", - "integrity": "sha512-f8z1y8J9zvmHoEhKgspmCvOExF2XdcxMW8jNRuX4vkQFrzV4MlZ55iwb5QeyiFQgOFCUolXiRHgpjSEnqvO48g==", + "version": "1.40.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.40.0.tgz", + "integrity": "sha512-fvKewVJpGeca8t0ipM56jkVSU6Eo0RmFvQ/MaCQNDYm+sdvKkMBBWTE1FdeMqIdumRaXXjZChWHvIzCGM/tA/Q==", "dev": true, "bin": { "playwright-core": "cli.js" @@ -7160,7 +7145,7 @@ "version": "5.3.0", "resolved": "https://registry.npmjs.org/prisma/-/prisma-5.3.0.tgz", "integrity": "sha512-eLUR2gyKk8iRLAfy1H3Jel4SZQmjauTPTYX4UFFmwrMTrPnQzipspt48s6e45H5PKYq9zT5MQ9qWbkq9Ru4EAg==", - "dev": true, + "devOptional": true, "hasInstallScript": true, "dependencies": { "@prisma/engines": "5.3.0" @@ -8304,7 +8289,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -8823,7 +8807,6 @@ "version": "4.2.0", "resolved": "https://registry.npmjs.org/svelte/-/svelte-4.2.0.tgz", "integrity": "sha512-kVsdPjDbLrv74SmLSUzAsBGquMs4MPgWGkGLpH+PjOYnFOziAvENVzgJmyOCV2gntxE32aNm8/sqNKD6LbIpeQ==", - "dev": true, "dependencies": { "@ampproject/remapping": "^2.2.1", "@jridgewell/sourcemap-codec": "^1.4.15", @@ -9082,7 +9065,6 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", - "dev": true, "dependencies": { "@types/estree": "^1.0.0" } @@ -9091,7 +9073,6 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.2.tgz", "integrity": "sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==", - "dev": true, "dependencies": { "@types/estree": "*" } @@ -9100,7 +9081,6 @@ "version": "0.30.3", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.3.tgz", "integrity": "sha512-B7xGbll2fG/VjP+SWg4sX3JynwIU0mjoTc6MPpKNuIvftk6u6vqhDnk1R80b8C2GBR6ywqy+1DcKBrevBg+bmw==", - "dev": true, "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.15" }, @@ -9706,7 +9686,6 @@ "version": "5.2.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", - "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -9741,6 +9720,11 @@ "node": ">=14.0" } }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" + }, "node_modules/universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", diff --git a/package.json b/package.json index fccfa51e..3c05799a 100644 --- a/package.json +++ b/package.json @@ -27,13 +27,14 @@ "seed": "tsx prisma/seed.ts" }, "devDependencies": { - "@playwright/test": "^1.38.0", + "@playwright/test": "^1.40.0", "@sveltejs/adapter-node": "^1.3.1", "@sveltejs/kit": "^1.25.0", "@types/express": "^4.17.17", "@types/glob": "^8.1.0", "@types/imap-simple": "^4.2.6", "@types/morgan": "^1.9.5", + "@types/node": "^20.9.3", "@types/nodemailer": "^6.4.10", "@types/nprogress": "^0.2.0", "@types/prettier": "^2.7.3", diff --git a/playwright.config.ts b/playwright.config.ts index 9efb16f3..a4048c12 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -1,67 +1,25 @@ -import type { PlaywrightTestConfig } from '@playwright/test' -import { devices } from '@playwright/test' -import dotenv from 'dotenv' +import { PlaywrightTestConfig, devices } from '@playwright/test' -dotenv.config() - -const base = '' -// const base = '/talk' - -/** - * Read environment variables from file. - * https://github.com/motdotla/dotenv - */ -// require('dotenv').config(); - -/** - * See https://playwright.dev/docs/test-configuration. - */ const config: PlaywrightTestConfig = { - testDir: './e2e', - /* Maximum time one test can run for. */ - timeout: process.env.CI ? 20 * 1000 : 10 * 1000, - expect: { - /** - * Maximum time expect() should wait for the condition to be met. - * For example in `await expect(locator).toHaveText();` - */ - timeout: 3000, + webServer: { + command: 'npm run dev', + port: 5173, + reuseExistingServer: !process.env.CI, }, - /* Run tests in files in parallel */ - fullyParallel: true, - /* Fail the build on CI if you accidentally left test.only in the source code. */ - forbidOnly: !!process.env.CI, - /* Retry on CI only */ - // retries: 0, - retries: process.env.CI ? 1 : 0, - /* Opt out of parallel tests on CI. */ - // workers: undefined, - workers: process.env.CI ? 1 : undefined, - /* Reporter to use. See https://playwright.dev/docs/test-reporters */ - reporter: [['html', { open: 'never' }]], - /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ + // webServer: { + // command: 'npm run build && npm run preview', + // port: 4173, + // }, + testDir: 'tests', + testMatch: /(.+\.)?(test|spec)\.[jt]s/, + + reporter: 'html', use: { - baseURL: `http://127.0.0.1:5173${base}/`, - - /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */ - actionTimeout: 0, - /* Base URL to use in actions like `await page.goto('/')`. */ - // baseURL: 'http://localhost:3000', - - /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ - trace: 'on-first-retry', - - // headless: false, video: 'retain-on-failure', - - contextOptions: { - permissions: ['clipboard-read', 'clipboard-write', 'accessibility-events'], - }, }, - /* Configure projects for major browsers */ projects: [ - { name: 'setup', testMatch: /[^.]{1,100}\.setup\.ts/ }, + { name: 'setup', testMatch: /.*\.setup\.ts/ }, { name: 'chromium', @@ -70,65 +28,6 @@ const config: PlaywrightTestConfig = { }, dependencies: ['setup'], }, - - // { - // name: 'firefox', - // use: { - // ...devices['Desktop Firefox'], - // }, - // }, - - // { - // name: 'webkit', - // use: { - // ...devices['Desktop Safari'], - // }, - // }, - - /* Test against mobile viewports. */ - // { - // name: 'Mobile Chrome', - // use: { - // ...devices['Pixel 5'], - // }, - // }, - // { - // name: 'Mobile Safari', - // use: { - // ...devices['iPhone 12'], - // }, - // }, - - /* Test against branded browsers. */ - // { - // name: 'Microsoft Edge', - // use: { - // channel: 'msedge', - // }, - // }, - // { - // name: 'Google Chrome', - // use: { - // channel: 'chrome', - // }, - // }, - ], - - /* Folder for test artifacts such as screenshots, videos, traces, etc. */ - // outputDir: 'test-results/', - - /* Run your local dev server before starting the tests */ - webServer: [ - { - command: 'npm run dev', - url: `http://127.0.0.1:5173${base}/`, - reuseExistingServer: !process.env.CI, - }, - // { - // command: 'npm run build && npm run preview', - // port: 4173, - // reuseExistingServer: !process.env.CI, - // }, ], } diff --git a/tests/test.ts b/tests/test.ts index 8492aef9..334c9590 100644 --- a/tests/test.ts +++ b/tests/test.ts @@ -1,6 +1,6 @@ import { expect, test } from '@playwright/test' -test('index page has expected h1', async ({ page }) => { +test('before sign in', async ({ page }) => { await page.goto('/', { waitUntil: 'networkidle' }) - expect(await page.textContent('h1')).toBe('Welcome to SvelteKit') + await expect(page).toHaveTitle('Talk') }) From f38fed5be78dff3eecf94531881ac3b0ef1b8cb8 Mon Sep 17 00:00:00 2001 From: REI-MORI Date: Fri, 24 Nov 2023 16:31:21 +0900 Subject: [PATCH 02/12] =?UTF-8?q?Configure=20Playwright=20#1451=20PR?= =?UTF-8?q?=E6=8C=87=E6=91=98=E4=BA=8B=E9=A0=85=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- playwright.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playwright.config.ts b/playwright.config.ts index a4048c12..a45df235 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -10,7 +10,7 @@ const config: PlaywrightTestConfig = { // command: 'npm run build && npm run preview', // port: 4173, // }, - testDir: 'tests', + testDir: 'e2e', testMatch: /(.+\.)?(test|spec)\.[jt]s/, reporter: 'html', From 27c0dac5885add87443fc1a9afed0331f2d7ab0f Mon Sep 17 00:00:00 2001 From: REI-MORI Date: Sat, 25 Nov 2023 10:24:52 +0900 Subject: [PATCH 03/12] Configure Playwright #1451 --- {e2e => tests}/api/log.spec.ts | 0 {e2e => tests}/auth.setup.ts | 0 {e2e => tests}/chat.spec.ts | 0 {e2e => tests}/example.spec.ts | 0 {e2e => tests}/learn.spec.ts | 0 {e2e => tests}/lib/get_pin_code_from_mail.ts | 0 {e2e => tests}/lib/setup.ts | 0 {e2e => tests}/main.spec.ts | 0 tests/test.ts | 6 ------ {e2e => tests}/translate.spec.ts | 0 10 files changed, 6 deletions(-) rename {e2e => tests}/api/log.spec.ts (100%) rename {e2e => tests}/auth.setup.ts (100%) rename {e2e => tests}/chat.spec.ts (100%) rename {e2e => tests}/example.spec.ts (100%) rename {e2e => tests}/learn.spec.ts (100%) rename {e2e => tests}/lib/get_pin_code_from_mail.ts (100%) rename {e2e => tests}/lib/setup.ts (100%) rename {e2e => tests}/main.spec.ts (100%) delete mode 100644 tests/test.ts rename {e2e => tests}/translate.spec.ts (100%) diff --git a/e2e/api/log.spec.ts b/tests/api/log.spec.ts similarity index 100% rename from e2e/api/log.spec.ts rename to tests/api/log.spec.ts diff --git a/e2e/auth.setup.ts b/tests/auth.setup.ts similarity index 100% rename from e2e/auth.setup.ts rename to tests/auth.setup.ts diff --git a/e2e/chat.spec.ts b/tests/chat.spec.ts similarity index 100% rename from e2e/chat.spec.ts rename to tests/chat.spec.ts diff --git a/e2e/example.spec.ts b/tests/example.spec.ts similarity index 100% rename from e2e/example.spec.ts rename to tests/example.spec.ts diff --git a/e2e/learn.spec.ts b/tests/learn.spec.ts similarity index 100% rename from e2e/learn.spec.ts rename to tests/learn.spec.ts diff --git a/e2e/lib/get_pin_code_from_mail.ts b/tests/lib/get_pin_code_from_mail.ts similarity index 100% rename from e2e/lib/get_pin_code_from_mail.ts rename to tests/lib/get_pin_code_from_mail.ts diff --git a/e2e/lib/setup.ts b/tests/lib/setup.ts similarity index 100% rename from e2e/lib/setup.ts rename to tests/lib/setup.ts diff --git a/e2e/main.spec.ts b/tests/main.spec.ts similarity index 100% rename from e2e/main.spec.ts rename to tests/main.spec.ts diff --git a/tests/test.ts b/tests/test.ts deleted file mode 100644 index 334c9590..00000000 --- a/tests/test.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { expect, test } from '@playwright/test' - -test('before sign in', async ({ page }) => { - await page.goto('/', { waitUntil: 'networkidle' }) - await expect(page).toHaveTitle('Talk') -}) diff --git a/e2e/translate.spec.ts b/tests/translate.spec.ts similarity index 100% rename from e2e/translate.spec.ts rename to tests/translate.spec.ts From 6823006f651ebc103d4dc00d99fb34a46ac5520f Mon Sep 17 00:00:00 2001 From: REI-MORI Date: Sat, 25 Nov 2023 10:33:53 +0900 Subject: [PATCH 04/12] Configure Playwright #1451 --- tests/auth.setup.ts | 2 +- tests/chat.spec.ts | 3 ++- tests/lib/get_pin_code_from_mail.ts | 4 ++-- tests/translate.spec.ts | 3 ++- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/auth.setup.ts b/tests/auth.setup.ts index 9a363f50..a3680435 100644 --- a/tests/auth.setup.ts +++ b/tests/auth.setup.ts @@ -40,7 +40,7 @@ setup('sign in', async ({ page }) => { await page.goto('./sign-in', { waitUntil: 'networkidle' }) - const gmail_user = process.env.GMAIL_USER ?? '' + const gmail_user = process.env['GMAIL_USER'] ?? '' // expect(gmail_user).toEqual('iam.o.sin@gmail.com') diff --git a/tests/chat.spec.ts b/tests/chat.spec.ts index a29edc93..0fae2ed7 100644 --- a/tests/chat.spec.ts +++ b/tests/chat.spec.ts @@ -1,4 +1,5 @@ -import { Page, expect, test } from '@playwright/test' +import { expect, test } from '@playwright/test' +import type { Page } from '@playwright/test' import { auth_file_path } from './lib/setup.js' test.beforeEach(async ({ page }) => { diff --git a/tests/lib/get_pin_code_from_mail.ts b/tests/lib/get_pin_code_from_mail.ts index 3c243f1a..993ae1e7 100644 --- a/tests/lib/get_pin_code_from_mail.ts +++ b/tests/lib/get_pin_code_from_mail.ts @@ -2,8 +2,8 @@ import * as imaps from 'imap-simple' export async function get_pin_code_from_mail(): Promise { - const gmail_user = process.env.GMAIL_USER ?? '' - const gmail_password = process.env.GMAIL_PASS ?? '' + const gmail_user = process.env['GMAIL_USER'] ?? '' + const gmail_password = process.env['GMAIL_PASS'] ?? '' // expect(gmail_user).toBeDefined() // expect(gmail_password).toBeDefined() diff --git a/tests/translate.spec.ts b/tests/translate.spec.ts index df4b5235..179566d0 100644 --- a/tests/translate.spec.ts +++ b/tests/translate.spec.ts @@ -1,4 +1,5 @@ -import { test, expect, Page } from '@playwright/test' +import { expect, test } from '@playwright/test' +import type { Page } from '@playwright/test' import { auth_file_path } from './lib/setup.js' test.beforeEach(async ({ page }) => { From 8c3baedf9e35d4dfb5482410c7a38dc2f253ac8f Mon Sep 17 00:00:00 2001 From: REI-MORI Date: Sat, 25 Nov 2023 10:55:59 +0900 Subject: [PATCH 05/12] Configure Playwright #1451 --- tests/lib/get_pin_code_from_mail.ts | 5 +++++ tests/translate.spec.ts | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/lib/get_pin_code_from_mail.ts b/tests/lib/get_pin_code_from_mail.ts index 993ae1e7..4f7d9580 100644 --- a/tests/lib/get_pin_code_from_mail.ts +++ b/tests/lib/get_pin_code_from_mail.ts @@ -44,7 +44,12 @@ export async function get_pin_code_from_mail(): Promise { // expect(subjects.length).toBeGreaterThan(0) const latest_subject = subjects[subjects.length - 1] + + if (!latest_subject) return '' + const pin_code = latest_subject.split(' ')[0] + if (!pin_code) return '' + return pin_code } diff --git a/tests/translate.spec.ts b/tests/translate.spec.ts index 179566d0..d6be2285 100644 --- a/tests/translate.spec.ts +++ b/tests/translate.spec.ts @@ -10,7 +10,7 @@ test.beforeEach(async ({ page }) => { await page.locator('#language_1').selectOption('en-US') await page.locator('#language_2').selectOption('ja-JP') - await page.waitForTimeout(process.env.CI ? 1000 : 500) + await page.waitForTimeout(process.env['CI'] ? 1000 : 500) }) test('before sign in', async ({ page }) => { @@ -49,7 +49,7 @@ test.describe('after sign in', () => { box_heights.push(box.height) - if (box_heights.length > 0) { + if (box_heights.length > 0 && box_heights[0] && typeof box_heights[0] === 'number') { await expect(box.height).toBeCloseTo(box_heights[0], 1) } } @@ -71,7 +71,7 @@ test.describe('after sign in', () => { box_heights.push(box.height) - if (box_heights.length > 0) { + if (box_heights.length > 0 && box_heights[0] && typeof box_heights[0] === 'number') { await expect(box.height).toBeCloseTo(box_heights[0], 1) } } From 6a0e45137bf14e31f8b2976ab6910285bf6177ca Mon Sep 17 00:00:00 2001 From: REI-MORI Date: Sat, 25 Nov 2023 11:06:34 +0900 Subject: [PATCH 06/12] Configure Playwright #1451 --- playwright.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playwright.config.ts b/playwright.config.ts index a45df235..a4048c12 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -10,7 +10,7 @@ const config: PlaywrightTestConfig = { // command: 'npm run build && npm run preview', // port: 4173, // }, - testDir: 'e2e', + testDir: 'tests', testMatch: /(.+\.)?(test|spec)\.[jt]s/, reporter: 'html', From 6066507be8751d1a6fbac0e428674b27f8bafcc8 Mon Sep 17 00:00:00 2001 From: REI-MORI Date: Sat, 25 Nov 2023 13:55:21 +0900 Subject: [PATCH 07/12] Configure Playwright #1451 --- tests/chat.spec.ts | 65 +++++++++++++++++++++++++++++------------ tests/learn.spec.ts | 14 +++++++-- tests/translate.spec.ts | 25 ++++------------ 3 files changed, 64 insertions(+), 40 deletions(-) diff --git a/tests/chat.spec.ts b/tests/chat.spec.ts index 0fae2ed7..5e11ed72 100644 --- a/tests/chat.spec.ts +++ b/tests/chat.spec.ts @@ -97,31 +97,58 @@ test.describe('after sign in', () => { return true } - test('send message', async ({ page }) => { - const input = 'Hello World!' - const output = 'Hello World!' + // test('send message', async ({ page }) => { + // const input = 'Hello World!' + // const output = 'Hello World!' - await test_send(page, input, output) - }) + // await test_send(page, input, output) + // }) - test('trim message', async ({ page }) => { - const input = '\nHello World!\n' - const output = 'Hello World!' + // test('trim message', async ({ page }) => { + // const input = '\nHello World!\n' + // const output = 'Hello World!' - await test_send(page, input, output) - }) + // await test_send(page, input, output) + // }) - test('indent message', async ({ page }) => { - const input = 'Hello World!\nHello World!' - const output = 'Hello World!\nHello World!' + // test('indent message', async ({ page }) => { + // const input = 'Hello World!\nHello World!' + // const output = 'Hello World!\nHello World!' - await test_send(page, input, output) - }) + // await test_send(page, input, output) + // }) - test('excess indentions', async ({ page }) => { - const input = 'Hello World!\n\n\n\nHello World!' - const output = 'Hello World!\n\nHello World!' + // test('excess indentions', async ({ page }) => { + // const input = 'Hello World!\n\n\n\nHello World!' + // const output = 'Hello World!\n\nHello World!' + + // await test_send(page, input, output) + // }) + + type Spec = { + description: string + input: string + output: string + } - await test_send(page, input, output) + const specs: Spec[] = [ + { description: 'send message', input: 'Hello World!', output: 'Hello World!' }, + { description: 'trim message', input: '\nHello World!\n', output: 'Hello World!' }, + { + description: 'indent message', + input: 'Hello World!\nHello World!', + output: 'Hello World!\nHello World!', + }, + { + description: 'excess indentions', + input: 'Hello World!\n\n\n\nHello World!', + output: 'Hello World!\n\nHello World!', + }, + ] + + specs.forEach(({ description, input, output }) => { + test(description, async ({ page }) => { + await test_send(page, input, output) + }) }) }) diff --git a/tests/learn.spec.ts b/tests/learn.spec.ts index 9a631cc4..1d960fa3 100644 --- a/tests/learn.spec.ts +++ b/tests/learn.spec.ts @@ -1,4 +1,5 @@ import { test, expect } from '@playwright/test' +import type { Page } from '@playwright/test' import { auth_file_path } from './lib/setup.js' test.beforeEach(async ({ page }) => { @@ -22,13 +23,22 @@ test.describe('after sign in', () => { // }) test('from locale combo box', async ({ page }) => { - await expect(page.getByRole('combobox').nth(0)).toHaveValue('en-US') + await check_combo_box_value(page, 0, 'en-US') }) test('to locale combo box', async ({ page }) => { - await expect(page.getByRole('combobox').nth(1)).toHaveValue('ja-JP') + await check_combo_box_value(page, 1, 'ja-JP') }) + async function check_combo_box_value( + page: Page, + combo_box_index: number, + expected_value: string + ): Promise { + const combo_box = page.getByRole('combobox').nth(combo_box_index) + await expect(combo_box).toHaveValue(expected_value) + } + test.describe('after sign in', () => { test.use({ storageState: auth_file_path }) diff --git a/tests/translate.spec.ts b/tests/translate.spec.ts index d6be2285..8787de9b 100644 --- a/tests/translate.spec.ts +++ b/tests/translate.spec.ts @@ -35,7 +35,7 @@ test.describe('after sign in', () => { // await expect(bottom_textarea).toHaveValue(text) // }) - test('check main box heights', async ({ page }) => { + async function check_main_box_heights(page: Page): Promise { const glass_panels = page.locator('.main-box') const count = await glass_panels.count() @@ -53,28 +53,15 @@ test.describe('after sign in', () => { await expect(box.height).toBeCloseTo(box_heights[0], 1) } } + } + + test('check main box heights', async ({ page }) => { + await check_main_box_heights(page) }) test('check main box heights on mobile', async ({ page }) => { await page.setViewportSize({ width: 375, height: 812 }) - - const glass_panels = page.locator('.main-box') - const count = await glass_panels.count() - - const box_heights: Array = [] - - for (let i = 0; i < count; i++) { - const glass_panel = glass_panels.nth(i) - const box = await glass_panel.boundingBox() - - if (!box) throw new Error('box is null') - - box_heights.push(box.height) - - if (box_heights.length > 0 && box_heights[0] && typeof box_heights[0] === 'number') { - await expect(box.height).toBeCloseTo(box_heights[0], 1) - } - } + await check_main_box_heights(page) }) test('check if having no history hides box', async ({ page }) => { From aae9ef89e01cdbbdabbdf47121cae7b05a98bcd7 Mon Sep 17 00:00:00 2001 From: REI-MORI Date: Sat, 25 Nov 2023 16:32:10 +0900 Subject: [PATCH 08/12] Configure Playwright #1451 --- tests/auth.setup.ts | 24 ------------------------ tests/chat.spec.ts | 2 +- tests/lib/get_pin_code_from_mail.ts | 2 +- tests/translate.spec.ts | 2 +- 4 files changed, 3 insertions(+), 27 deletions(-) diff --git a/tests/auth.setup.ts b/tests/auth.setup.ts index a3680435..85e30784 100644 --- a/tests/auth.setup.ts +++ b/tests/auth.setup.ts @@ -1,27 +1,7 @@ import { expect, test as setup } from '@playwright/test' import { PrismaClient } from '@prisma/client' -// import { promises as fs } from 'fs' -// import { sleep } from '../src/lib/general/system.js' -// import { get_pin_code_from_mail } from './lib/get_pin_code_from_mail.js' import { auth_file_path } from './lib/setup.js' -// async function find_auth_file(): Promise { -// try { -// await fs.access(auth_file_path, fs.constants.F_OK) -// return true -// } catch { -// return false -// } -// } - -// async function get_pin_code_from_mail(): Promise { -// await sleep(process.env.CI ? 5000 : 1000) -// const pin_code = await get_pin_code_from_mail() -// expect(pin_code).toMatch(/^\d{6}$/) - -// return pin_code -// } - async function get_pin_code_from_database(gmail_user: string): Promise { const prisma_client = new PrismaClient() @@ -36,14 +16,10 @@ async function get_pin_code_from_database(gmail_user: string): Promise { } setup('sign in', async ({ page }) => { - // if (await find_auth_file()) return - await page.goto('./sign-in', { waitUntil: 'networkidle' }) const gmail_user = process.env['GMAIL_USER'] ?? '' - // expect(gmail_user).toEqual('iam.o.sin@gmail.com') - await page.getByPlaceholder('Enter email').fill(gmail_user) await page.getByRole('button', { name: 'Continue' }).click() await page.waitForURL(/\/pin-code/) diff --git a/tests/chat.spec.ts b/tests/chat.spec.ts index 5e11ed72..58d5736e 100644 --- a/tests/chat.spec.ts +++ b/tests/chat.spec.ts @@ -70,7 +70,7 @@ test.describe('after sign in', () => { const room_id_div = page.getByTestId('room-id') const room_id = await room_id_div.innerText() - await expect(room_id).not.toContain('lobby') + expect(room_id).not.toContain('lobby') await expect(page).toHaveURL(`./chat/${room_id}`) }) diff --git a/tests/lib/get_pin_code_from_mail.ts b/tests/lib/get_pin_code_from_mail.ts index 4f7d9580..e90064b9 100644 --- a/tests/lib/get_pin_code_from_mail.ts +++ b/tests/lib/get_pin_code_from_mail.ts @@ -34,7 +34,7 @@ export async function get_pin_code_from_mail(): Promise { const subjects: string[] = messages.map((message) => { const header_part = message.parts.find((part) => part.which === 'HEADER') - if (header_part && header_part.body.subject) { + if (header_part?.body?.subject) { return header_part.body.subject[0] } diff --git a/tests/translate.spec.ts b/tests/translate.spec.ts index 8787de9b..2c667ff6 100644 --- a/tests/translate.spec.ts +++ b/tests/translate.spec.ts @@ -50,7 +50,7 @@ test.describe('after sign in', () => { box_heights.push(box.height) if (box_heights.length > 0 && box_heights[0] && typeof box_heights[0] === 'number') { - await expect(box.height).toBeCloseTo(box_heights[0], 1) + expect(box.height).toBeCloseTo(box_heights[0], 1) } } } From 35154d65860ef5431bd13102c7223ee23fbb837e Mon Sep 17 00:00:00 2001 From: REI-MORI Date: Tue, 28 Nov 2023 18:58:53 +0900 Subject: [PATCH 09/12] Configure Playwright #1451 --- tests/learn.spec.ts | 8 +++-- tests/translate.spec.ts | 78 +++++++++++++++++++---------------------- 2 files changed, 42 insertions(+), 44 deletions(-) diff --git a/tests/learn.spec.ts b/tests/learn.spec.ts index 1d960fa3..b30ad6f6 100644 --- a/tests/learn.spec.ts +++ b/tests/learn.spec.ts @@ -2,19 +2,23 @@ import { test, expect } from '@playwright/test' import type { Page } from '@playwright/test' import { auth_file_path } from './lib/setup.js' +async function run_test(page: Page, title: string): Promise { + await expect(page).toHaveTitle(title) +} + test.beforeEach(async ({ page }) => { await page.goto('./learn', { waitUntil: 'networkidle' }) }) test('before sign in', async ({ page }) => { - await expect(page).toHaveTitle('Sign in - Talk') + await run_test(page, 'Sign in - Talk') }) test.describe('after sign in', () => { test.use({ storageState: auth_file_path }) test('has title', async ({ page }) => { - await expect(page).toHaveTitle('Learn - Talk') + await run_test(page, 'Learn - Talk') }) // test('sign in button', async ({ page }) => { diff --git a/tests/translate.spec.ts b/tests/translate.spec.ts index 2c667ff6..ae9f2958 100644 --- a/tests/translate.spec.ts +++ b/tests/translate.spec.ts @@ -183,56 +183,50 @@ test.describe('after sign in', () => { await expect(button).toBeEnabled() }) - test('having no text disables tts button', async ({ page }) => { + async function setup_text_area(page: Page, text: string): Promise { await page.waitForSelector('.text-area') const from_text_area = page.locator('.text-area').first() + await from_text_area.fill(text) + await from_text_area.press(text ? 'Enter' : 'Meta+Enter') + } - await from_text_area.fill('') - await from_text_area.press('Meta+Enter') - - const button = page.getByTestId('tts_button').first().getByRole('button') - - await expect(button).toBeDisabled() - }) - - test('having text enables tts button', async ({ page }) => { - await page.waitForSelector('.text-area') - - const from_text_area = page.locator('.text-area').first() - - await from_text_area.fill('Hello') - await from_text_area.press('Enter') - - const button = page.getByTestId('tts_button').first().getByRole('button') - - await expect(button).toBeEnabled() - }) - - test('having no text disables copy button', async ({ page }) => { - await page.waitForSelector('.text-area') - - const from_text_area = page.locator('.text-area').first() - - await from_text_area.fill('') - await from_text_area.press('Meta+Enter') - - const button = page.getByTestId('copy_button').first().getByRole('button') + async function test_button_state( + page: Page, + button_test_id: string, + text: string, + should_be_enabled: boolean + ): Promise { + await setup_text_area(page, text) - await expect(button).toBeDisabled() - }) - - test('having text enables copy button', async ({ page }) => { - await page.waitForSelector('.text-area') + const button = page.getByTestId(button_test_id).first().getByRole('button') - const from_text_area = page.locator('.text-area').first() - - await from_text_area.fill('Hello') - await from_text_area.press('Enter') + if (should_be_enabled) { + await expect(button).toBeEnabled() + } else { + await expect(button).toBeDisabled() + } + } - const button = page.getByTestId('copy_button').first().getByRole('button') + interface Specs { + button_test_id: string + text: string + should_be_enabled: boolean + } - await expect(button).toBeEnabled() + const specs: Specs[] = [ + { button_test_id: 'tts_button', text: '', should_be_enabled: false }, + { button_test_id: 'tts_button', text: 'Hello', should_be_enabled: true }, + { button_test_id: 'copy_button', text: '', should_be_enabled: false }, + { button_test_id: 'copy_button', text: 'Hello', should_be_enabled: true }, + ] + + specs.forEach(({ button_test_id, text, should_be_enabled }) => { + test(`'${button_test_id}' should be ${ + should_be_enabled ? 'enabled' : 'disabled' + } with text '${text}'`, async ({ page }) => { + await test_button_state(page, button_test_id, text, should_be_enabled) + }) }) async function clear_text(page: Page): Promise { From 2352ecbd78c9fc0d7c55026998224e3cdf3214d1 Mon Sep 17 00:00:00 2001 From: REI-MORI Date: Wed, 29 Nov 2023 15:56:46 +0900 Subject: [PATCH 10/12] Configure Playwright #1451 --- tests/auth.setup.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/auth.setup.ts b/tests/auth.setup.ts index 85e30784..79817b7a 100644 --- a/tests/auth.setup.ts +++ b/tests/auth.setup.ts @@ -16,6 +16,8 @@ async function get_pin_code_from_database(gmail_user: string): Promise { } setup('sign in', async ({ page }) => { + if (process.env['CI']) return + await page.goto('./sign-in', { waitUntil: 'networkidle' }) const gmail_user = process.env['GMAIL_USER'] ?? '' From e224773c14e759daacf507c176cf792681061229 Mon Sep 17 00:00:00 2001 From: REI-MORI Date: Wed, 29 Nov 2023 16:16:19 +0900 Subject: [PATCH 11/12] Configure Playwright #1451 --- tests/chat.spec.ts | 1 + tests/translate.spec.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/chat.spec.ts b/tests/chat.spec.ts index 58d5736e..cd784c0f 100644 --- a/tests/chat.spec.ts +++ b/tests/chat.spec.ts @@ -11,6 +11,7 @@ test('before sign in', async ({ page }) => { }) test.describe('after sign in', () => { + if (process.env['CI']) return test.use({ storageState: auth_file_path }) test('has title', async ({ page }) => { diff --git a/tests/translate.spec.ts b/tests/translate.spec.ts index ae9f2958..c28692b2 100644 --- a/tests/translate.spec.ts +++ b/tests/translate.spec.ts @@ -18,6 +18,7 @@ test('before sign in', async ({ page }) => { }) test.describe('after sign in', () => { + if (process.env['CI']) return test.use({ storageState: auth_file_path }) test('has title', async ({ page }) => { From 7e88d58ef3b14a3f096e9e6cda5ccf563026f447 Mon Sep 17 00:00:00 2001 From: REI-MORI Date: Wed, 29 Nov 2023 16:21:12 +0900 Subject: [PATCH 12/12] Configure Playwright #1451 --- tests/learn.spec.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/learn.spec.ts b/tests/learn.spec.ts index b30ad6f6..1cdbfd30 100644 --- a/tests/learn.spec.ts +++ b/tests/learn.spec.ts @@ -15,6 +15,7 @@ test('before sign in', async ({ page }) => { }) test.describe('after sign in', () => { + if (process.env['CI']) return test.use({ storageState: auth_file_path }) test('has title', async ({ page }) => {