diff --git a/.github/workflows/e2e-apps.yml b/.github/workflows/e2e-apps.yml index 56e163c3bb..f1ffd2c114 100644 --- a/.github/workflows/e2e-apps.yml +++ b/.github/workflows/e2e-apps.yml @@ -31,12 +31,9 @@ on: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - cypress-run: + e2e-run: + timeout-minutes: 30 runs-on: ubuntu-latest - container: - image: cypress/browsers:node-20.14.0-chrome-126.0.6478.114-1-ff-127.0.1-edge-126.0.2592.61-1 - options: --user 1001 - strategy: fail-fast: false matrix: @@ -67,33 +64,24 @@ jobs: cache: 'yarn' cache-dependency-path: yarn.lock - # Set up GitHub Actions caching for Wireit. - # - uses: google/wireit@setup-github-actions-caching/v1.0.2 - - # - run: echo '${{ toJSON(steps.setup_node_id.outputs) }}' - # - if: ${{ steps.setup_node_id.outputs.cache-hit != 'true' }} - name: yarn install run: yarn --frozen-lockfile + - name: Install Playwright Browsers + run: yarn playwright install --with-deps + - name: Build dependencies run: yarn zz:wsrun-stages --recursive -p @noshiro/${{ matrix.app_name }} -c build - - name: Cypress run on Chrome - uses: cypress-io/github-action@v6.7.1 + - name: Run Playwright tests + run: yarn workspace @noshiro/${{ matrix.app_name }} e2e + + - uses: actions/upload-artifact@v4 + if: ${{ !cancelled() }} with: - browser: chrome - install: false - working-directory: packages/apps/${{ matrix.app_name }}/cypress - spec: cypress/e2e/**/*.cy.ts - start: yarn start:dev-server - wait-on: 'http://[::1]:5180' - wait-on-timeout: 120 - # headless: true - env: - CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} - # Recommended: pass the GitHub token lets this action correctly - # determine the unique run id necessary to re-run the checks - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + name: playwright-report + path: packages/apps/{{ matrix.app_name }}/playwright-report/ + retention-days: 30 e2e-event-schedule-app: timeout-minutes: 30 diff --git a/docs/updating-packages.md b/docs/updating-packages.md index c98cf9f990..7b01deda46 100644 --- a/docs/updating-packages.md +++ b/docs/updating-packages.md @@ -29,7 +29,6 @@ $ yarn add --dev -W \ ```sh $ yarn add --dev -W \ eslint-plugin-jest@latest \ - cypress@latest \ jest@latest \ jest-environment-jsdom@latest \ jest-fetch-mock@latest \ diff --git a/experimental/lambda-calculus-interpreter-solid/cypress/.eslintrc.cjs b/experimental/lambda-calculus-interpreter-solid/cypress/.eslintrc.cjs deleted file mode 100644 index 2e6240ff1e..0000000000 --- a/experimental/lambda-calculus-interpreter-solid/cypress/.eslintrc.cjs +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; -// @ts-check - -/** @typedef { import("eslint").Linter.Config } LinterConfig */ - -/** @type {LinterConfig} */ -const config = { - extends: '../../../../config/eslintrc/.eslintrc.cypress.js', - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: __dirname, - }, -}; - -module.exports = config; diff --git a/experimental/lambda-calculus-interpreter-solid/cypress/e2e/add.cy.ts b/experimental/lambda-calculus-interpreter-solid/cypress/e2e/add.cy.ts deleted file mode 100644 index f9b79a7914..0000000000 --- a/experimental/lambda-calculus-interpreter-solid/cypress/e2e/add.cy.ts +++ /dev/null @@ -1,91 +0,0 @@ -import failOnConsoleError from 'cypress-fail-on-console-error'; - -failOnConsoleError(); - -const e = (selector: string): string => `[data-cy="${selector}"]`; - -describe('add', () => { - it('4 + 5 = 9', () => { - cy.visit('/'); - - cy.get(e('input-area')).clear().type('((+ 4) 5)'); - - cy.get(e('output-area')).should( - 'have.value', - [ - '0. ((+ 4) 5)', - '1. ((λn.(λs.(λz.((4 s) ((n s) z))))) 5)', - '2. (λs.(λz.((4 s) ((5 s) z))))', - '3. (λs.(λz.((λz.(s (s (s (s z))))) ((5 s) z))))', - '4. (λs.(λz.(s (s (s (s ((5 s) z)))))))', - '5. (λs.(λz.(s (s (s (s ((λz.(s (s (s (s (s z)))))) z)))))))', - '6. 9', - ].join('\n'), - ); - }); - - it('0 + 0 = 0', () => { - cy.visit('/'); - - cy.get(e('input-area')).clear().type('((+ 0) 0)'); - - cy.get(e('output-area')).should( - 'have.value', - [ - '0. ((+ 0) 0)', - '1. ((λn.(λs.(λz.((0 s) ((n s) z))))) 0)', - '2. (λs.(λz.((0 s) ((0 s) z))))', - '3. (λs.(λz.((λz.z) ((0 s) z))))', - '4. (λs.(λz.((0 s) z)))', - '5. (λs.(λz.((λz.z) z)))', - '6. 0', - ].join('\n'), - ); - }); - - it('0 + 3 = 3', () => { - cy.visit('/'); - - cy.get(e('input-area')).clear().type('((+ 0) 3)'); - - cy.get(e('output-area')).should( - 'have.value', - [ - '0. ((+ 0) 3)', - '1. ((λn.(λs.(λz.((0 s) ((n s) z))))) 3)', - '2. (λs.(λz.((0 s) ((3 s) z))))', - '3. (λs.(λz.((λz.z) ((3 s) z))))', - '4. (λs.(λz.((3 s) z)))', - '5. (λs.(λz.((λz.(s (s (s z)))) z)))', - '6. 3', - ].join('\n'), - ); - }); - - it('3 + 0 = 3', () => { - cy.visit('/'); - - cy.get(e('input-area')).clear().type('((+ 3) 0)'); - - cy.get(e('output-area')).should( - 'have.value', - [ - '0. ((+ 3) 0)', - '1. ((λn.(λs.(λz.((3 s) ((n s) z))))) 0)', - '2. (λs.(λz.((3 s) ((0 s) z))))', - '3. (λs.(λz.((λz.(s (s (s z)))) ((0 s) z))))', - '4. (λs.(λz.(s (s (s ((0 s) z))))))', - '5. (λs.(λz.(s (s (s ((λz.z) z))))))', - '6. 3', - ].join('\n'), - ); - }); - - it('parse error', () => { - cy.visit('/'); - - cy.get(e('input-area')).clear().type('((+ 0) 0))'); - - cy.get(e('output-area')).should('have.value', 'Parse error.'); - }); -}); diff --git a/experimental/lambda-calculus-interpreter-solid/cypress/fixtures/example.json b/experimental/lambda-calculus-interpreter-solid/cypress/fixtures/example.json deleted file mode 100644 index 02e4254378..0000000000 --- a/experimental/lambda-calculus-interpreter-solid/cypress/fixtures/example.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "Using fixtures to represent data", - "email": "hello@cypress.io", - "body": "Fixtures are a great way to mock data for responses to routes" -} diff --git a/experimental/lambda-calculus-interpreter-solid/cypress/index.ts b/experimental/lambda-calculus-interpreter-solid/cypress/index.ts deleted file mode 100644 index 66cb8e2fc6..0000000000 --- a/experimental/lambda-calculus-interpreter-solid/cypress/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* eslint-disable @typescript-eslint/triple-slash-reference */ - -/// -/// - -/// - -export {}; diff --git a/experimental/lambda-calculus-interpreter-solid/cypress/memo.md b/experimental/lambda-calculus-interpreter-solid/cypress/memo.md deleted file mode 100644 index 5a0d456b22..0000000000 --- a/experimental/lambda-calculus-interpreter-solid/cypress/memo.md +++ /dev/null @@ -1 +0,0 @@ -https://docs.cypress.io/api/commands/click diff --git a/experimental/lambda-calculus-interpreter-solid/cypress/support/commands.ts b/experimental/lambda-calculus-interpreter-solid/cypress/support/commands.ts deleted file mode 100644 index 915eae01a0..0000000000 --- a/experimental/lambda-calculus-interpreter-solid/cypress/support/commands.ts +++ /dev/null @@ -1,38 +0,0 @@ -/// -// *********************************************** -// This example commands.ts shows you how to -// create various custom commands and overwrite -// existing commands. -// -// For more comprehensive examples of custom -// commands please read more here: -// https://on.cypress.io/custom-commands -// *********************************************** -// -// -// -- This is a parent command -- -// Cypress.Commands.add('login', (email, password) => { ... }) -// -// -// -- This is a child command -- -// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... }) -// -// -// -- This is a dual command -- -// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... }) -// -// -// -- This will overwrite an existing command -- -// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) -// -// declare global { -// namespace Cypress { -// interface Chainable { -// login(email: string, password: string): Chainable -// drag(subject: string, options?: Partial): Chainable -// dismiss(subject: string, options?: Partial): Chainable -// visit(originalFn: CommandOriginalFn, url: string, options: Partial): Chainable -// } -// } -// } -export {}; diff --git a/experimental/lambda-calculus-interpreter-solid/cypress/support/e2e.ts b/experimental/lambda-calculus-interpreter-solid/cypress/support/e2e.ts deleted file mode 100644 index c946d73f09..0000000000 --- a/experimental/lambda-calculus-interpreter-solid/cypress/support/e2e.ts +++ /dev/null @@ -1,21 +0,0 @@ -// *********************************************************** -// This example support/e2e.ts is processed and -// loaded automatically before your test files. -// -// This is a great place to put global configuration and -// behavior that modifies Cypress. -// -// You can change the location of this file or turn off -// automatically serving support files with the -// 'supportFile' configuration option. -// -// You can read more here: -// https://on.cypress.io/configuration -// *********************************************************** - -// Import commands.js using ES2015 syntax: -// eslint-disable-next-line import/no-unassigned-import -import './commands'; - -// Alternatively you can use CommonJS syntax: -// require('./commands') diff --git a/experimental/lambda-calculus-interpreter-solid/cypress/tsconfig.json b/experimental/lambda-calculus-interpreter-solid/cypress/tsconfig.json deleted file mode 100644 index a09ef8580e..0000000000 --- a/experimental/lambda-calculus-interpreter-solid/cypress/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../../../config/tsconfig/tsconfig.base.nolib.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["./**/*.ts"] -} diff --git a/package.json b/package.json index 1cbc189311..05e66c4809 100644 --- a/package.json +++ b/package.json @@ -99,7 +99,6 @@ "cross-env": "^7.0.3", "cspell": "^8.14.2", "css-loader": "^6.2.0", - "cypress": "^13.10.0", "dotenv": "^16.0.3", "esbuild": "^0.20.2", "file-loader": "^6.2.0", diff --git a/packages/apps/algo-app/.gitignore b/packages/apps/algo-app/.gitignore deleted file mode 100644 index 7abd081cd5..0000000000 --- a/packages/apps/algo-app/.gitignore +++ /dev/null @@ -1 +0,0 @@ -cypress/cypress/videos diff --git a/packages/apps/algo-app/configs/playwright.config.ts b/packages/apps/algo-app/configs/playwright.config.ts new file mode 100644 index 0000000000..ecbed1f7e2 --- /dev/null +++ b/packages/apps/algo-app/configs/playwright.config.ts @@ -0,0 +1,16 @@ +import { toThisDir } from '@noshiro/mono-utils'; +import path from 'node:path'; +import { definePlaywrightConfig } from '../../../../configs/define-playwright-config.mjs'; + +const thisDir = toThisDir(import.meta.url); + +export default definePlaywrightConfig({ + baseURL: 'http://localhost:5180', + testDir: path.resolve(thisDir, '..', 'e2e'), + webServer: [ + { + url: 'http://localhost:5180', + command: 'yarn start:dev-server', + }, + ], +}); diff --git a/packages/apps/algo-app/cypress/cypress.config.ts b/packages/apps/algo-app/cypress/cypress.config.ts deleted file mode 100644 index a73b149016..0000000000 --- a/packages/apps/algo-app/cypress/cypress.config.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { defineConfig } from 'cypress'; - -export default defineConfig({ - projectId: 'fgu6f1', - viewportWidth: 375, - viewportHeight: 667, - modifyObstructiveCode: false, - pageLoadTimeout: 120_000, - e2e: { - setupNodeEvents(_on, _config) { - // implement node event listeners here - }, - baseUrl: 'http://localhost:5180', - // specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}', - }, -}); diff --git a/packages/apps/algo-app/cypress/cypress/e2e/main.cy.ts b/packages/apps/algo-app/cypress/cypress/e2e/main.cy.ts deleted file mode 100644 index 9c112c749b..0000000000 --- a/packages/apps/algo-app/cypress/cypress/e2e/main.cy.ts +++ /dev/null @@ -1,10 +0,0 @@ -const e = (selector: string): string => `[data-cy="${selector}"]`; - -describe('main', { testIsolation: false }, () => { - it('visit', () => { - cy.visit('/'); - cy.get(e('root')).should('be.visible'); - }); -}); - -export {}; diff --git a/packages/apps/algo-app/cypress/cypress/fixtures/example.json b/packages/apps/algo-app/cypress/cypress/fixtures/example.json deleted file mode 100644 index 02e4254378..0000000000 --- a/packages/apps/algo-app/cypress/cypress/fixtures/example.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "Using fixtures to represent data", - "email": "hello@cypress.io", - "body": "Fixtures are a great way to mock data for responses to routes" -} diff --git a/packages/apps/algo-app/cypress/cypress/index.ts b/packages/apps/algo-app/cypress/cypress/index.ts deleted file mode 100644 index 5ed18ab535..0000000000 --- a/packages/apps/algo-app/cypress/cypress/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// - -export {}; diff --git a/packages/apps/algo-app/cypress/cypress/support/commands.ts b/packages/apps/algo-app/cypress/cypress/support/commands.ts deleted file mode 100644 index 915eae01a0..0000000000 --- a/packages/apps/algo-app/cypress/cypress/support/commands.ts +++ /dev/null @@ -1,38 +0,0 @@ -/// -// *********************************************** -// This example commands.ts shows you how to -// create various custom commands and overwrite -// existing commands. -// -// For more comprehensive examples of custom -// commands please read more here: -// https://on.cypress.io/custom-commands -// *********************************************** -// -// -// -- This is a parent command -- -// Cypress.Commands.add('login', (email, password) => { ... }) -// -// -// -- This is a child command -- -// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... }) -// -// -// -- This is a dual command -- -// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... }) -// -// -// -- This will overwrite an existing command -- -// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) -// -// declare global { -// namespace Cypress { -// interface Chainable { -// login(email: string, password: string): Chainable -// drag(subject: string, options?: Partial): Chainable -// dismiss(subject: string, options?: Partial): Chainable -// visit(originalFn: CommandOriginalFn, url: string, options: Partial): Chainable -// } -// } -// } -export {}; diff --git a/packages/apps/algo-app/cypress/cypress/support/e2e.ts b/packages/apps/algo-app/cypress/cypress/support/e2e.ts deleted file mode 100644 index c946d73f09..0000000000 --- a/packages/apps/algo-app/cypress/cypress/support/e2e.ts +++ /dev/null @@ -1,21 +0,0 @@ -// *********************************************************** -// This example support/e2e.ts is processed and -// loaded automatically before your test files. -// -// This is a great place to put global configuration and -// behavior that modifies Cypress. -// -// You can change the location of this file or turn off -// automatically serving support files with the -// 'supportFile' configuration option. -// -// You can read more here: -// https://on.cypress.io/configuration -// *********************************************************** - -// Import commands.js using ES2015 syntax: -// eslint-disable-next-line import/no-unassigned-import -import './commands'; - -// Alternatively you can use CommonJS syntax: -// require('./commands') diff --git a/packages/apps/algo-app/cypress/cypress/tsconfig.json b/packages/apps/algo-app/cypress/cypress/tsconfig.json deleted file mode 100644 index 53cf38609d..0000000000 --- a/packages/apps/algo-app/cypress/cypress/tsconfig.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "../../../../../configs/tsconfig/tsconfig.type-check.json", - "include": ["./**/*.ts"] -} diff --git a/packages/apps/algo-app/cypress/eslint.config.js b/packages/apps/algo-app/cypress/eslint.config.js deleted file mode 100644 index a29ec42885..0000000000 --- a/packages/apps/algo-app/cypress/eslint.config.js +++ /dev/null @@ -1,26 +0,0 @@ -/** @typedef {import('@noshiro/eslint-configs').FlatConfig} FlatConfig */ - -import { - eslintFlatConfigForCypress, - eslintFlatConfigForTypeScript, -} from '@noshiro/eslint-configs'; -import { toThisDir } from '@noshiro/mono-utils'; -import * as nodePath from 'node:path'; - -/** @type {string} */ -const thisDir = toThisDir(import.meta.url); - -/** @type {readonly FlatConfig[]} */ -const configs = [ - ...eslintFlatConfigForTypeScript({ - packageDirs: [ - nodePath.resolve(thisDir, '../../../..'), - nodePath.resolve(thisDir, '..'), - ], - tsconfigFileName: './tsconfig.json', - tsconfigRootDir: thisDir, - }), - eslintFlatConfigForCypress(), -]; - -export default configs; diff --git a/packages/apps/algo-app/cypress/memo.md b/packages/apps/algo-app/cypress/memo.md deleted file mode 100644 index 5a0d456b22..0000000000 --- a/packages/apps/algo-app/cypress/memo.md +++ /dev/null @@ -1 +0,0 @@ -https://docs.cypress.io/api/commands/click diff --git a/packages/apps/algo-app/cypress/package.json b/packages/apps/algo-app/cypress/package.json deleted file mode 100644 index 2df12ab6a7..0000000000 --- a/packages/apps/algo-app/cypress/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "@noshiro/algo-app-cypress", - "version": "0.0.0", - "license": "MIT", - "type": "module", - "scripts": { - "cy:open": "cypress open", - "cy:record": "cypress run --record --key ${CYPRESS_RECORD_KEY}", - "cy:run:chrome": "cypress run --headed --browser chrome ", - "cy:run:firefox": "cypress run --headed --browser firefox ", - "start:dev-server": "yarn workspace @noshiro/algo-app start:dev-server", - "start:emulators": "yarn workspace @noshiro/algo-app start:emulators", - "start:emulators:e2e": "yarn workspace @noshiro/algo-app start:emulators:e2e" - } -} diff --git a/packages/apps/algo-app/cypress/tsconfig.json b/packages/apps/algo-app/cypress/tsconfig.json deleted file mode 100644 index 47d9af6bd4..0000000000 --- a/packages/apps/algo-app/cypress/tsconfig.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "../../../../configs/tsconfig/tsconfig.type-check.json", - "include": ["./cypress.config.ts", "./cypress"] -} diff --git a/packages/apps/algo-app/e2e/main-page.spec.ts b/packages/apps/algo-app/e2e/main-page.spec.ts new file mode 100644 index 0000000000..981f1e6b2c --- /dev/null +++ b/packages/apps/algo-app/e2e/main-page.spec.ts @@ -0,0 +1,7 @@ +import { expect, test } from '@playwright/test'; + +test('visit main page', async ({ page }) => { + await page.goto('/'); + + await expect.soft(page.getByTestId('root')).toBeVisible(); +}); diff --git a/packages/apps/algo-app/eslint.config.js b/packages/apps/algo-app/eslint.config.js index 60622ed21f..b0d5a8910e 100644 --- a/packages/apps/algo-app/eslint.config.js +++ b/packages/apps/algo-app/eslint.config.js @@ -1,6 +1,7 @@ /** @typedef {import('@noshiro/eslint-configs').FlatConfig} FlatConfig */ import { + eslintFlatConfigForPlaywright, eslintFlatConfigForPreact, eslintFlatConfigForTypeScript, eslintFlatConfigForVitest, @@ -26,8 +27,9 @@ const defineConfig = async () => { tsconfigFileName: './tsconfig.json', packageDirs: [nodePath.resolve(thisDir, '../../..'), thisDir], }), - eslintFlatConfigForVitest(), - ...eslintFlatConfigForPreact(), + eslintFlatConfigForVitest(['src/**/*']), + ...eslintFlatConfigForPreact(['src/**/*']), + eslintFlatConfigForPlaywright(['e2e/**/*']), { rules: { diff --git a/packages/apps/algo-app/package.json b/packages/apps/algo-app/package.json index 4dbd121ccb..5252fb35c6 100644 --- a/packages/apps/algo-app/package.json +++ b/packages/apps/algo-app/package.json @@ -14,10 +14,8 @@ "clean:build": "rimraf build", "clean:firebase": "rimraf .firebase", "clean:wireit": "rimraf .wireit/**", - "cy:open": "yarn workspace @noshiro/algo-app-cypress cy:open", - "cy:record": "yarn workspace @noshiro/algo-app-cypress cy:record", - "cy:run:chrome": "yarn workspace @noshiro/algo-app-cypress cy:run:chrome", - "cy:run:firefox": "yarn workspace @noshiro/algo-app-cypress cy:run:firefox", + "e2e": "playwright test --config configs/playwright.config.ts", + "e2e:ui": "yarn e2e --ui", "fb": "firebase", "fb:deploy": "wireit", "fb:deploy:hosting": "wireit", @@ -40,13 +38,11 @@ "testw": "yarn zz:vitest watch", "tsc": "yarn type-check", "tscw": "tsc --noEmit --watch", - "type-check": "run-p type-check:src type-check:e2e", - "type-check:e2e": "tsc --noEmit -p ./cypress/tsconfig.json", - "type-check:src": "wireit", + "type-check": "wireit", "z:setup": "run-p z:setup:gen-global-dts", "z:setup:gen-global-dts": "node ./scripts/gen-global-dts.mjs", "zz:eslint": "ESLINT_USE_FLAT_CONFIG=true TIMING=1 eslint", - "zz:eslint:e2e": "yarn zz:eslint --config ./cypress/eslint.config.js './cypress/**/*.ts'", + "zz:eslint:e2e": "yarn zz:eslint --config eslint.config.js './e2e/**/*.ts'", "zz:eslint:print-config": "yarn zz:eslint --print-config src/main.tsx", "zz:eslint:src": "yarn zz:eslint --config eslint.config.js './src/**/*'", "zz:prettier": "prettier --cache --cache-strategy content --ignore-path ../../../.prettierignore --write", @@ -97,7 +93,7 @@ "@noshiro/ts-utils": "*" }, "wireit": { - "type-check:src": { + "type-check": { "dependencies": [ "z:setup:gen-global-dts" ], diff --git a/packages/apps/algo-app/src/components/root.tsx b/packages/apps/algo-app/src/components/root.tsx index 50f19188bd..83a2b6294c 100644 --- a/packages/apps/algo-app/src/components/root.tsx +++ b/packages/apps/algo-app/src/components/root.tsx @@ -49,7 +49,7 @@ export const Root = memoNamed('Root', () => { }); return ( -
+
{/* simple routing */} {showMain ? ( diff --git a/packages/apps/algo-app/tsconfig.json b/packages/apps/algo-app/tsconfig.json index 072fca8009..6325be57c8 100644 --- a/packages/apps/algo-app/tsconfig.json +++ b/packages/apps/algo-app/tsconfig.json @@ -5,5 +5,11 @@ "../../../configs/tsconfig/tsconfig.vite.json", "../../../configs/tsconfig/tsconfig.absolute-path.json" ], - "include": ["./src", "./configs", "./scripts"] + "include": [ + "./src", + "./configs", + "./scripts", + "./e2e", + "./playwright.config.ts" + ] } diff --git a/packages/apps/annotation-tool/.gitignore b/packages/apps/annotation-tool/.gitignore deleted file mode 100644 index 7abd081cd5..0000000000 --- a/packages/apps/annotation-tool/.gitignore +++ /dev/null @@ -1 +0,0 @@ -cypress/cypress/videos diff --git a/packages/apps/annotation-tool/configs/playwright.config.ts b/packages/apps/annotation-tool/configs/playwright.config.ts new file mode 100644 index 0000000000..ecbed1f7e2 --- /dev/null +++ b/packages/apps/annotation-tool/configs/playwright.config.ts @@ -0,0 +1,16 @@ +import { toThisDir } from '@noshiro/mono-utils'; +import path from 'node:path'; +import { definePlaywrightConfig } from '../../../../configs/define-playwright-config.mjs'; + +const thisDir = toThisDir(import.meta.url); + +export default definePlaywrightConfig({ + baseURL: 'http://localhost:5180', + testDir: path.resolve(thisDir, '..', 'e2e'), + webServer: [ + { + url: 'http://localhost:5180', + command: 'yarn start:dev-server', + }, + ], +}); diff --git a/packages/apps/annotation-tool/cypress/cypress.config.ts b/packages/apps/annotation-tool/cypress/cypress.config.ts deleted file mode 100644 index 398941784b..0000000000 --- a/packages/apps/annotation-tool/cypress/cypress.config.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { defineConfig } from 'cypress'; - -export default defineConfig({ - projectId: 'mympjv', - viewportWidth: 375, - viewportHeight: 667, - modifyObstructiveCode: false, - pageLoadTimeout: 120_000, - e2e: { - setupNodeEvents(_on, _config) { - // implement node event listeners here - }, - baseUrl: 'http://localhost:5180', - // specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}', - }, -}); diff --git a/packages/apps/annotation-tool/cypress/cypress/e2e/main.cy.ts b/packages/apps/annotation-tool/cypress/cypress/e2e/main.cy.ts deleted file mode 100644 index 9c112c749b..0000000000 --- a/packages/apps/annotation-tool/cypress/cypress/e2e/main.cy.ts +++ /dev/null @@ -1,10 +0,0 @@ -const e = (selector: string): string => `[data-cy="${selector}"]`; - -describe('main', { testIsolation: false }, () => { - it('visit', () => { - cy.visit('/'); - cy.get(e('root')).should('be.visible'); - }); -}); - -export {}; diff --git a/packages/apps/annotation-tool/cypress/cypress/fixtures/example.json b/packages/apps/annotation-tool/cypress/cypress/fixtures/example.json deleted file mode 100644 index 02e4254378..0000000000 --- a/packages/apps/annotation-tool/cypress/cypress/fixtures/example.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "Using fixtures to represent data", - "email": "hello@cypress.io", - "body": "Fixtures are a great way to mock data for responses to routes" -} diff --git a/packages/apps/annotation-tool/cypress/cypress/index.ts b/packages/apps/annotation-tool/cypress/cypress/index.ts deleted file mode 100644 index 5ed18ab535..0000000000 --- a/packages/apps/annotation-tool/cypress/cypress/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// - -export {}; diff --git a/packages/apps/annotation-tool/cypress/cypress/support/commands.ts b/packages/apps/annotation-tool/cypress/cypress/support/commands.ts deleted file mode 100644 index 915eae01a0..0000000000 --- a/packages/apps/annotation-tool/cypress/cypress/support/commands.ts +++ /dev/null @@ -1,38 +0,0 @@ -/// -// *********************************************** -// This example commands.ts shows you how to -// create various custom commands and overwrite -// existing commands. -// -// For more comprehensive examples of custom -// commands please read more here: -// https://on.cypress.io/custom-commands -// *********************************************** -// -// -// -- This is a parent command -- -// Cypress.Commands.add('login', (email, password) => { ... }) -// -// -// -- This is a child command -- -// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... }) -// -// -// -- This is a dual command -- -// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... }) -// -// -// -- This will overwrite an existing command -- -// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) -// -// declare global { -// namespace Cypress { -// interface Chainable { -// login(email: string, password: string): Chainable -// drag(subject: string, options?: Partial): Chainable -// dismiss(subject: string, options?: Partial): Chainable -// visit(originalFn: CommandOriginalFn, url: string, options: Partial): Chainable -// } -// } -// } -export {}; diff --git a/packages/apps/annotation-tool/cypress/cypress/support/e2e.ts b/packages/apps/annotation-tool/cypress/cypress/support/e2e.ts deleted file mode 100644 index c946d73f09..0000000000 --- a/packages/apps/annotation-tool/cypress/cypress/support/e2e.ts +++ /dev/null @@ -1,21 +0,0 @@ -// *********************************************************** -// This example support/e2e.ts is processed and -// loaded automatically before your test files. -// -// This is a great place to put global configuration and -// behavior that modifies Cypress. -// -// You can change the location of this file or turn off -// automatically serving support files with the -// 'supportFile' configuration option. -// -// You can read more here: -// https://on.cypress.io/configuration -// *********************************************************** - -// Import commands.js using ES2015 syntax: -// eslint-disable-next-line import/no-unassigned-import -import './commands'; - -// Alternatively you can use CommonJS syntax: -// require('./commands') diff --git a/packages/apps/annotation-tool/cypress/cypress/tsconfig.json b/packages/apps/annotation-tool/cypress/cypress/tsconfig.json deleted file mode 100644 index 53cf38609d..0000000000 --- a/packages/apps/annotation-tool/cypress/cypress/tsconfig.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "../../../../../configs/tsconfig/tsconfig.type-check.json", - "include": ["./**/*.ts"] -} diff --git a/packages/apps/annotation-tool/cypress/eslint.config.js b/packages/apps/annotation-tool/cypress/eslint.config.js deleted file mode 100644 index a29ec42885..0000000000 --- a/packages/apps/annotation-tool/cypress/eslint.config.js +++ /dev/null @@ -1,26 +0,0 @@ -/** @typedef {import('@noshiro/eslint-configs').FlatConfig} FlatConfig */ - -import { - eslintFlatConfigForCypress, - eslintFlatConfigForTypeScript, -} from '@noshiro/eslint-configs'; -import { toThisDir } from '@noshiro/mono-utils'; -import * as nodePath from 'node:path'; - -/** @type {string} */ -const thisDir = toThisDir(import.meta.url); - -/** @type {readonly FlatConfig[]} */ -const configs = [ - ...eslintFlatConfigForTypeScript({ - packageDirs: [ - nodePath.resolve(thisDir, '../../../..'), - nodePath.resolve(thisDir, '..'), - ], - tsconfigFileName: './tsconfig.json', - tsconfigRootDir: thisDir, - }), - eslintFlatConfigForCypress(), -]; - -export default configs; diff --git a/packages/apps/annotation-tool/cypress/memo.md b/packages/apps/annotation-tool/cypress/memo.md deleted file mode 100644 index 5a0d456b22..0000000000 --- a/packages/apps/annotation-tool/cypress/memo.md +++ /dev/null @@ -1 +0,0 @@ -https://docs.cypress.io/api/commands/click diff --git a/packages/apps/annotation-tool/cypress/package.json b/packages/apps/annotation-tool/cypress/package.json deleted file mode 100644 index 2350ec4f33..0000000000 --- a/packages/apps/annotation-tool/cypress/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "@noshiro/annotation-tool-cypress", - "version": "0.0.0", - "license": "MIT", - "type": "module", - "scripts": { - "cy:open": "cypress open", - "cy:record": "cypress run --record --key ${CYPRESS_RECORD_KEY}", - "cy:run:chrome": "cypress run --headed --browser chrome ", - "cy:run:firefox": "cypress run --headed --browser firefox ", - "start:dev-server": "yarn workspace @noshiro/annotation-tool start:dev-server", - "start:emulators": "yarn workspace @noshiro/annotation-tool start:emulators", - "start:emulators:e2e": "yarn workspace @noshiro/annotation-tool start:emulators:e2e" - } -} diff --git a/packages/apps/annotation-tool/cypress/tsconfig.json b/packages/apps/annotation-tool/cypress/tsconfig.json deleted file mode 100644 index 47d9af6bd4..0000000000 --- a/packages/apps/annotation-tool/cypress/tsconfig.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "../../../../configs/tsconfig/tsconfig.type-check.json", - "include": ["./cypress.config.ts", "./cypress"] -} diff --git a/packages/apps/annotation-tool/e2e/main-page.spec.ts b/packages/apps/annotation-tool/e2e/main-page.spec.ts new file mode 100644 index 0000000000..981f1e6b2c --- /dev/null +++ b/packages/apps/annotation-tool/e2e/main-page.spec.ts @@ -0,0 +1,7 @@ +import { expect, test } from '@playwright/test'; + +test('visit main page', async ({ page }) => { + await page.goto('/'); + + await expect.soft(page.getByTestId('root')).toBeVisible(); +}); diff --git a/packages/apps/annotation-tool/eslint.config.js b/packages/apps/annotation-tool/eslint.config.js index cd169bf343..5365067ee1 100644 --- a/packages/apps/annotation-tool/eslint.config.js +++ b/packages/apps/annotation-tool/eslint.config.js @@ -1,6 +1,7 @@ /** @typedef {import('@noshiro/eslint-configs').FlatConfig} FlatConfig */ import { + eslintFlatConfigForPlaywright, eslintFlatConfigForReact, eslintFlatConfigForTypeScript, eslintFlatConfigForVitest, @@ -26,8 +27,9 @@ const defineConfig = async () => { tsconfigFileName: './tsconfig.json', packageDirs: [nodePath.resolve(thisDir, '../../..'), thisDir], }), - eslintFlatConfigForVitest(), - ...eslintFlatConfigForReact(), + eslintFlatConfigForVitest(['src/**/*']), + ...eslintFlatConfigForReact(['src/**/*']), + eslintFlatConfigForPlaywright(['e2e/**/*']), { rules: { diff --git a/packages/apps/annotation-tool/package.json b/packages/apps/annotation-tool/package.json index 6f4a19db46..9329dcddc8 100644 --- a/packages/apps/annotation-tool/package.json +++ b/packages/apps/annotation-tool/package.json @@ -14,10 +14,8 @@ "clean:build": "rimraf build", "clean:firebase": "rimraf .firebase", "clean:wireit": "rimraf .wireit/**", - "cy:open": "yarn workspace @noshiro/annotation-tool-cypress cy:open", - "cy:record": "yarn workspace @noshiro/annotation-tool-cypress cy:record", - "cy:run:chrome": "yarn workspace @noshiro/annotation-tool-cypress cy:run:chrome", - "cy:run:firefox": "yarn workspace @noshiro/annotation-tool-cypress cy:run:firefox", + "e2e": "playwright test --config configs/playwright.config.ts", + "e2e:ui": "yarn e2e --ui", "fb": "firebase", "fb:deploy": "wireit", "fb:deploy:hosting": "wireit", @@ -40,13 +38,11 @@ "testw": "yarn zz:vitest watch", "tsc": "yarn type-check", "tscw": "tsc --noEmit --watch", - "type-check": "run-p type-check:src type-check:e2e", - "type-check:e2e": "tsc --noEmit -p ./cypress/tsconfig.json", - "type-check:src": "wireit", + "type-check": "wireit", "z:setup": "run-p z:setup:gen-global-dts", "z:setup:gen-global-dts": "node ./scripts/gen-global-dts.mjs", "zz:eslint": "ESLINT_USE_FLAT_CONFIG=true TIMING=1 eslint", - "zz:eslint:e2e": "yarn zz:eslint --config ./cypress/eslint.config.js './cypress/**/*.ts'", + "zz:eslint:e2e": "yarn zz:eslint --config eslint.config.js './e2e/**/*.ts'", "zz:eslint:print-config": "yarn zz:eslint --print-config src/main.tsx", "zz:eslint:src": "yarn zz:eslint --config eslint.config.js './src/**/*'", "zz:prettier": "prettier --cache --cache-strategy content --ignore-path ../../../.prettierignore --write", @@ -99,7 +95,7 @@ "@noshiro/ts-utils": "*" }, "wireit": { - "type-check:src": { + "type-check": { "dependencies": [ "z:setup:gen-global-dts" ], diff --git a/packages/apps/annotation-tool/src/app/app.tsx b/packages/apps/annotation-tool/src/app/app.tsx index 8696944bd9..5ffbf143c1 100644 --- a/packages/apps/annotation-tool/src/app/app.tsx +++ b/packages/apps/annotation-tool/src/app/app.tsx @@ -25,7 +25,7 @@ export const App = memoNamed('App', () => { height: 100vh; display: flex; `} - data-cy={'root'} + data-e2e={'root'} >
`[data-cy="${selector}"]`; - -describe('main', { testIsolation: false }, () => { - it('visit', () => { - cy.visit('/'); - cy.get(e('root')).should('be.visible'); - }); -}); - -export {}; diff --git a/packages/apps/blueprintjs-playground-styled/cypress/cypress/fixtures/example.json b/packages/apps/blueprintjs-playground-styled/cypress/cypress/fixtures/example.json deleted file mode 100644 index 02e4254378..0000000000 --- a/packages/apps/blueprintjs-playground-styled/cypress/cypress/fixtures/example.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "Using fixtures to represent data", - "email": "hello@cypress.io", - "body": "Fixtures are a great way to mock data for responses to routes" -} diff --git a/packages/apps/blueprintjs-playground-styled/cypress/cypress/index.ts b/packages/apps/blueprintjs-playground-styled/cypress/cypress/index.ts deleted file mode 100644 index 5ed18ab535..0000000000 --- a/packages/apps/blueprintjs-playground-styled/cypress/cypress/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// - -export {}; diff --git a/packages/apps/blueprintjs-playground-styled/cypress/cypress/support/commands.ts b/packages/apps/blueprintjs-playground-styled/cypress/cypress/support/commands.ts deleted file mode 100644 index 915eae01a0..0000000000 --- a/packages/apps/blueprintjs-playground-styled/cypress/cypress/support/commands.ts +++ /dev/null @@ -1,38 +0,0 @@ -/// -// *********************************************** -// This example commands.ts shows you how to -// create various custom commands and overwrite -// existing commands. -// -// For more comprehensive examples of custom -// commands please read more here: -// https://on.cypress.io/custom-commands -// *********************************************** -// -// -// -- This is a parent command -- -// Cypress.Commands.add('login', (email, password) => { ... }) -// -// -// -- This is a child command -- -// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... }) -// -// -// -- This is a dual command -- -// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... }) -// -// -// -- This will overwrite an existing command -- -// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) -// -// declare global { -// namespace Cypress { -// interface Chainable { -// login(email: string, password: string): Chainable -// drag(subject: string, options?: Partial): Chainable -// dismiss(subject: string, options?: Partial): Chainable -// visit(originalFn: CommandOriginalFn, url: string, options: Partial): Chainable -// } -// } -// } -export {}; diff --git a/packages/apps/blueprintjs-playground-styled/cypress/cypress/support/e2e.ts b/packages/apps/blueprintjs-playground-styled/cypress/cypress/support/e2e.ts deleted file mode 100644 index c946d73f09..0000000000 --- a/packages/apps/blueprintjs-playground-styled/cypress/cypress/support/e2e.ts +++ /dev/null @@ -1,21 +0,0 @@ -// *********************************************************** -// This example support/e2e.ts is processed and -// loaded automatically before your test files. -// -// This is a great place to put global configuration and -// behavior that modifies Cypress. -// -// You can change the location of this file or turn off -// automatically serving support files with the -// 'supportFile' configuration option. -// -// You can read more here: -// https://on.cypress.io/configuration -// *********************************************************** - -// Import commands.js using ES2015 syntax: -// eslint-disable-next-line import/no-unassigned-import -import './commands'; - -// Alternatively you can use CommonJS syntax: -// require('./commands') diff --git a/packages/apps/blueprintjs-playground-styled/cypress/cypress/tsconfig.json b/packages/apps/blueprintjs-playground-styled/cypress/cypress/tsconfig.json deleted file mode 100644 index 53cf38609d..0000000000 --- a/packages/apps/blueprintjs-playground-styled/cypress/cypress/tsconfig.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "../../../../../configs/tsconfig/tsconfig.type-check.json", - "include": ["./**/*.ts"] -} diff --git a/packages/apps/blueprintjs-playground-styled/cypress/eslint.config.js b/packages/apps/blueprintjs-playground-styled/cypress/eslint.config.js deleted file mode 100644 index a29ec42885..0000000000 --- a/packages/apps/blueprintjs-playground-styled/cypress/eslint.config.js +++ /dev/null @@ -1,26 +0,0 @@ -/** @typedef {import('@noshiro/eslint-configs').FlatConfig} FlatConfig */ - -import { - eslintFlatConfigForCypress, - eslintFlatConfigForTypeScript, -} from '@noshiro/eslint-configs'; -import { toThisDir } from '@noshiro/mono-utils'; -import * as nodePath from 'node:path'; - -/** @type {string} */ -const thisDir = toThisDir(import.meta.url); - -/** @type {readonly FlatConfig[]} */ -const configs = [ - ...eslintFlatConfigForTypeScript({ - packageDirs: [ - nodePath.resolve(thisDir, '../../../..'), - nodePath.resolve(thisDir, '..'), - ], - tsconfigFileName: './tsconfig.json', - tsconfigRootDir: thisDir, - }), - eslintFlatConfigForCypress(), -]; - -export default configs; diff --git a/packages/apps/blueprintjs-playground-styled/cypress/memo.md b/packages/apps/blueprintjs-playground-styled/cypress/memo.md deleted file mode 100644 index 5a0d456b22..0000000000 --- a/packages/apps/blueprintjs-playground-styled/cypress/memo.md +++ /dev/null @@ -1 +0,0 @@ -https://docs.cypress.io/api/commands/click diff --git a/packages/apps/blueprintjs-playground-styled/cypress/package.json b/packages/apps/blueprintjs-playground-styled/cypress/package.json deleted file mode 100644 index b0afa8f59c..0000000000 --- a/packages/apps/blueprintjs-playground-styled/cypress/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "@noshiro/blueprintjs-playground-styled-cypress", - "version": "0.0.0", - "license": "MIT", - "type": "module", - "scripts": { - "cy:open": "cypress open", - "cy:record": "cypress run --record --key ${CYPRESS_RECORD_KEY}", - "cy:run:chrome": "cypress run --headed --browser chrome ", - "cy:run:firefox": "cypress run --headed --browser firefox ", - "start:dev-server": "yarn workspace @noshiro/blueprintjs-playground-styled start:dev-server", - "start:emulators": "yarn workspace @noshiro/blueprintjs-playground-styled start:emulators", - "start:emulators:e2e": "yarn workspace @noshiro/blueprintjs-playground-styled start:emulators:e2e" - } -} diff --git a/packages/apps/blueprintjs-playground-styled/cypress/tsconfig.json b/packages/apps/blueprintjs-playground-styled/cypress/tsconfig.json deleted file mode 100644 index 47d9af6bd4..0000000000 --- a/packages/apps/blueprintjs-playground-styled/cypress/tsconfig.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "../../../../configs/tsconfig/tsconfig.type-check.json", - "include": ["./cypress.config.ts", "./cypress"] -} diff --git a/packages/apps/blueprintjs-playground-styled/e2e/main-page.spec.ts b/packages/apps/blueprintjs-playground-styled/e2e/main-page.spec.ts new file mode 100644 index 0000000000..981f1e6b2c --- /dev/null +++ b/packages/apps/blueprintjs-playground-styled/e2e/main-page.spec.ts @@ -0,0 +1,7 @@ +import { expect, test } from '@playwright/test'; + +test('visit main page', async ({ page }) => { + await page.goto('/'); + + await expect.soft(page.getByTestId('root')).toBeVisible(); +}); diff --git a/packages/apps/blueprintjs-playground-styled/eslint.config.js b/packages/apps/blueprintjs-playground-styled/eslint.config.js index 50ecd71614..f85823bfed 100644 --- a/packages/apps/blueprintjs-playground-styled/eslint.config.js +++ b/packages/apps/blueprintjs-playground-styled/eslint.config.js @@ -1,6 +1,7 @@ /** @typedef {import('@noshiro/eslint-configs').FlatConfig} FlatConfig */ import { + eslintFlatConfigForPlaywright, eslintFlatConfigForReact, eslintFlatConfigForTypeScript, eslintFlatConfigForVitest, @@ -26,8 +27,9 @@ const defineConfig = async () => { tsconfigFileName: './tsconfig.json', packageDirs: [nodePath.resolve(thisDir, '../../..'), thisDir], }), - eslintFlatConfigForVitest(), - ...eslintFlatConfigForReact(), + eslintFlatConfigForVitest(['src/**/*']), + ...eslintFlatConfigForReact(['src/**/*']), + eslintFlatConfigForPlaywright(['e2e/**/*']), { rules: { diff --git a/packages/apps/blueprintjs-playground-styled/package.json b/packages/apps/blueprintjs-playground-styled/package.json index 8d5940a8ff..4f903edbff 100644 --- a/packages/apps/blueprintjs-playground-styled/package.json +++ b/packages/apps/blueprintjs-playground-styled/package.json @@ -14,10 +14,8 @@ "clean:build": "rimraf build", "clean:firebase": "rimraf .firebase", "clean:wireit": "rimraf .wireit/**", - "cy:open": "yarn workspace @noshiro/blueprintjs-playground-styled-cypress cy:open", - "cy:record": "yarn workspace @noshiro/blueprintjs-playground-styled-cypress cy:record", - "cy:run:chrome": "yarn workspace @noshiro/blueprintjs-playground-styled-cypress cy:run:chrome", - "cy:run:firefox": "yarn workspace @noshiro/blueprintjs-playground-styled-cypress cy:run:firefox", + "e2e": "playwright test --config configs/playwright.config.ts", + "e2e:ui": "yarn e2e --ui", "fb": "firebase", "fb:deploy": "wireit", "fb:deploy:hosting": "wireit", @@ -40,13 +38,11 @@ "testw": "yarn zz:vitest watch", "tsc": "yarn type-check", "tscw": "tsc --noEmit --watch", - "type-check": "run-p type-check:src type-check:e2e", - "type-check:e2e": "tsc --noEmit -p ./cypress/tsconfig.json", - "type-check:src": "wireit", + "type-check": "wireit", "z:setup": "run-p z:setup:gen-global-dts", "z:setup:gen-global-dts": "node ./scripts/gen-global-dts.mjs", "zz:eslint": "ESLINT_USE_FLAT_CONFIG=true TIMING=1 eslint", - "zz:eslint:e2e": "yarn zz:eslint --config ./cypress/eslint.config.js './cypress/**/*.ts'", + "zz:eslint:e2e": "yarn zz:eslint --config eslint.config.js './e2e/**/*.ts'", "zz:eslint:print-config": "yarn zz:eslint --print-config src/main.tsx", "zz:eslint:src": "yarn zz:eslint --config eslint.config.js './src/**/*'", "zz:prettier": "prettier --cache --cache-strategy content --ignore-path ../../../.prettierignore --write", @@ -95,7 +91,7 @@ "@noshiro/ts-utils": "*" }, "wireit": { - "type-check:src": { + "type-check": { "dependencies": [ "z:setup:gen-global-dts" ], diff --git a/packages/apps/blueprintjs-playground-styled/src/app.tsx b/packages/apps/blueprintjs-playground-styled/src/app.tsx index ddbc8864ef..588b0538ce 100644 --- a/packages/apps/blueprintjs-playground-styled/src/app.tsx +++ b/packages/apps/blueprintjs-playground-styled/src/app.tsx @@ -6,7 +6,7 @@ export const App = memoNamed('App', () => ( min-height: 100vh; padding: 20px; `} - data-cy={'root'} + data-e2e={'root'} >

{'Blueprint.js Playground (styled in scratch)'}

diff --git a/packages/apps/blueprintjs-playground-styled/tsconfig.json b/packages/apps/blueprintjs-playground-styled/tsconfig.json index 531745e313..6ec7337eab 100644 --- a/packages/apps/blueprintjs-playground-styled/tsconfig.json +++ b/packages/apps/blueprintjs-playground-styled/tsconfig.json @@ -5,5 +5,11 @@ "../../../configs/tsconfig/tsconfig.vite.json", "../../../configs/tsconfig/tsconfig.absolute-path.json" ], - "include": ["./src", "./configs", "./scripts"] + "include": [ + "./src", + "./configs", + "./scripts", + "./e2e", + "./playwright.config.ts" + ] } diff --git a/packages/apps/blueprintjs-playground/.gitignore b/packages/apps/blueprintjs-playground/.gitignore deleted file mode 100644 index 7abd081cd5..0000000000 --- a/packages/apps/blueprintjs-playground/.gitignore +++ /dev/null @@ -1 +0,0 @@ -cypress/cypress/videos diff --git a/packages/apps/blueprintjs-playground/configs/playwright.config.ts b/packages/apps/blueprintjs-playground/configs/playwright.config.ts new file mode 100644 index 0000000000..ecbed1f7e2 --- /dev/null +++ b/packages/apps/blueprintjs-playground/configs/playwright.config.ts @@ -0,0 +1,16 @@ +import { toThisDir } from '@noshiro/mono-utils'; +import path from 'node:path'; +import { definePlaywrightConfig } from '../../../../configs/define-playwright-config.mjs'; + +const thisDir = toThisDir(import.meta.url); + +export default definePlaywrightConfig({ + baseURL: 'http://localhost:5180', + testDir: path.resolve(thisDir, '..', 'e2e'), + webServer: [ + { + url: 'http://localhost:5180', + command: 'yarn start:dev-server', + }, + ], +}); diff --git a/packages/apps/blueprintjs-playground/cypress/cypress.config.ts b/packages/apps/blueprintjs-playground/cypress/cypress.config.ts deleted file mode 100644 index e872835ea5..0000000000 --- a/packages/apps/blueprintjs-playground/cypress/cypress.config.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { defineConfig } from 'cypress'; - -export default defineConfig({ - projectId: 'gyk89r', - viewportWidth: 375, - viewportHeight: 667, - modifyObstructiveCode: false, - pageLoadTimeout: 120_000, - e2e: { - setupNodeEvents(_on, _config) { - // implement node event listeners here - }, - baseUrl: 'http://localhost:5180', - // specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}', - }, -}); diff --git a/packages/apps/blueprintjs-playground/cypress/cypress/e2e/main.cy.ts b/packages/apps/blueprintjs-playground/cypress/cypress/e2e/main.cy.ts deleted file mode 100644 index 9c112c749b..0000000000 --- a/packages/apps/blueprintjs-playground/cypress/cypress/e2e/main.cy.ts +++ /dev/null @@ -1,10 +0,0 @@ -const e = (selector: string): string => `[data-cy="${selector}"]`; - -describe('main', { testIsolation: false }, () => { - it('visit', () => { - cy.visit('/'); - cy.get(e('root')).should('be.visible'); - }); -}); - -export {}; diff --git a/packages/apps/blueprintjs-playground/cypress/cypress/fixtures/example.json b/packages/apps/blueprintjs-playground/cypress/cypress/fixtures/example.json deleted file mode 100644 index 02e4254378..0000000000 --- a/packages/apps/blueprintjs-playground/cypress/cypress/fixtures/example.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "Using fixtures to represent data", - "email": "hello@cypress.io", - "body": "Fixtures are a great way to mock data for responses to routes" -} diff --git a/packages/apps/blueprintjs-playground/cypress/cypress/index.ts b/packages/apps/blueprintjs-playground/cypress/cypress/index.ts deleted file mode 100644 index 5ed18ab535..0000000000 --- a/packages/apps/blueprintjs-playground/cypress/cypress/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// - -export {}; diff --git a/packages/apps/blueprintjs-playground/cypress/cypress/support/commands.ts b/packages/apps/blueprintjs-playground/cypress/cypress/support/commands.ts deleted file mode 100644 index 915eae01a0..0000000000 --- a/packages/apps/blueprintjs-playground/cypress/cypress/support/commands.ts +++ /dev/null @@ -1,38 +0,0 @@ -/// -// *********************************************** -// This example commands.ts shows you how to -// create various custom commands and overwrite -// existing commands. -// -// For more comprehensive examples of custom -// commands please read more here: -// https://on.cypress.io/custom-commands -// *********************************************** -// -// -// -- This is a parent command -- -// Cypress.Commands.add('login', (email, password) => { ... }) -// -// -// -- This is a child command -- -// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... }) -// -// -// -- This is a dual command -- -// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... }) -// -// -// -- This will overwrite an existing command -- -// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) -// -// declare global { -// namespace Cypress { -// interface Chainable { -// login(email: string, password: string): Chainable -// drag(subject: string, options?: Partial): Chainable -// dismiss(subject: string, options?: Partial): Chainable -// visit(originalFn: CommandOriginalFn, url: string, options: Partial): Chainable -// } -// } -// } -export {}; diff --git a/packages/apps/blueprintjs-playground/cypress/cypress/support/e2e.ts b/packages/apps/blueprintjs-playground/cypress/cypress/support/e2e.ts deleted file mode 100644 index c946d73f09..0000000000 --- a/packages/apps/blueprintjs-playground/cypress/cypress/support/e2e.ts +++ /dev/null @@ -1,21 +0,0 @@ -// *********************************************************** -// This example support/e2e.ts is processed and -// loaded automatically before your test files. -// -// This is a great place to put global configuration and -// behavior that modifies Cypress. -// -// You can change the location of this file or turn off -// automatically serving support files with the -// 'supportFile' configuration option. -// -// You can read more here: -// https://on.cypress.io/configuration -// *********************************************************** - -// Import commands.js using ES2015 syntax: -// eslint-disable-next-line import/no-unassigned-import -import './commands'; - -// Alternatively you can use CommonJS syntax: -// require('./commands') diff --git a/packages/apps/blueprintjs-playground/cypress/cypress/tsconfig.json b/packages/apps/blueprintjs-playground/cypress/cypress/tsconfig.json deleted file mode 100644 index 53cf38609d..0000000000 --- a/packages/apps/blueprintjs-playground/cypress/cypress/tsconfig.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "../../../../../configs/tsconfig/tsconfig.type-check.json", - "include": ["./**/*.ts"] -} diff --git a/packages/apps/blueprintjs-playground/cypress/eslint.config.js b/packages/apps/blueprintjs-playground/cypress/eslint.config.js deleted file mode 100644 index a29ec42885..0000000000 --- a/packages/apps/blueprintjs-playground/cypress/eslint.config.js +++ /dev/null @@ -1,26 +0,0 @@ -/** @typedef {import('@noshiro/eslint-configs').FlatConfig} FlatConfig */ - -import { - eslintFlatConfigForCypress, - eslintFlatConfigForTypeScript, -} from '@noshiro/eslint-configs'; -import { toThisDir } from '@noshiro/mono-utils'; -import * as nodePath from 'node:path'; - -/** @type {string} */ -const thisDir = toThisDir(import.meta.url); - -/** @type {readonly FlatConfig[]} */ -const configs = [ - ...eslintFlatConfigForTypeScript({ - packageDirs: [ - nodePath.resolve(thisDir, '../../../..'), - nodePath.resolve(thisDir, '..'), - ], - tsconfigFileName: './tsconfig.json', - tsconfigRootDir: thisDir, - }), - eslintFlatConfigForCypress(), -]; - -export default configs; diff --git a/packages/apps/blueprintjs-playground/cypress/memo.md b/packages/apps/blueprintjs-playground/cypress/memo.md deleted file mode 100644 index 5a0d456b22..0000000000 --- a/packages/apps/blueprintjs-playground/cypress/memo.md +++ /dev/null @@ -1 +0,0 @@ -https://docs.cypress.io/api/commands/click diff --git a/packages/apps/blueprintjs-playground/cypress/package.json b/packages/apps/blueprintjs-playground/cypress/package.json deleted file mode 100644 index c7870c3824..0000000000 --- a/packages/apps/blueprintjs-playground/cypress/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "@noshiro/blueprintjs-playground-cypress", - "version": "0.0.0", - "license": "MIT", - "type": "module", - "scripts": { - "cy:open": "cypress open", - "cy:record": "cypress run --record --key ${CYPRESS_RECORD_KEY}", - "cy:run:chrome": "cypress run --headed --browser chrome ", - "cy:run:firefox": "cypress run --headed --browser firefox ", - "start:dev-server": "yarn workspace @noshiro/blueprintjs-playground start:dev-server", - "start:emulators": "yarn workspace @noshiro/blueprintjs-playground start:emulators", - "start:emulators:e2e": "yarn workspace @noshiro/blueprintjs-playground start:emulators:e2e" - } -} diff --git a/packages/apps/blueprintjs-playground/cypress/tsconfig.json b/packages/apps/blueprintjs-playground/cypress/tsconfig.json deleted file mode 100644 index 47d9af6bd4..0000000000 --- a/packages/apps/blueprintjs-playground/cypress/tsconfig.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "../../../../configs/tsconfig/tsconfig.type-check.json", - "include": ["./cypress.config.ts", "./cypress"] -} diff --git a/packages/apps/blueprintjs-playground/e2e/main-page.spec.ts b/packages/apps/blueprintjs-playground/e2e/main-page.spec.ts new file mode 100644 index 0000000000..981f1e6b2c --- /dev/null +++ b/packages/apps/blueprintjs-playground/e2e/main-page.spec.ts @@ -0,0 +1,7 @@ +import { expect, test } from '@playwright/test'; + +test('visit main page', async ({ page }) => { + await page.goto('/'); + + await expect.soft(page.getByTestId('root')).toBeVisible(); +}); diff --git a/packages/apps/blueprintjs-playground/eslint.config.js b/packages/apps/blueprintjs-playground/eslint.config.js index b2417f4988..7a8b3a46d7 100644 --- a/packages/apps/blueprintjs-playground/eslint.config.js +++ b/packages/apps/blueprintjs-playground/eslint.config.js @@ -1,6 +1,7 @@ /** @typedef {import('@noshiro/eslint-configs').FlatConfig} FlatConfig */ import { + eslintFlatConfigForPlaywright, eslintFlatConfigForReact, eslintFlatConfigForTypeScript, eslintFlatConfigForVitest, @@ -26,8 +27,9 @@ const defineConfig = async () => { tsconfigFileName: './tsconfig.json', packageDirs: [nodePath.resolve(thisDir, '../../..'), thisDir], }), - eslintFlatConfigForVitest(), - ...eslintFlatConfigForReact(), + eslintFlatConfigForVitest(['src/**/*']), + ...eslintFlatConfigForReact(['src/**/*']), + eslintFlatConfigForPlaywright(['e2e/**/*']), { rules: { diff --git a/packages/apps/blueprintjs-playground/package.json b/packages/apps/blueprintjs-playground/package.json index f928908529..3d37211fd6 100644 --- a/packages/apps/blueprintjs-playground/package.json +++ b/packages/apps/blueprintjs-playground/package.json @@ -14,10 +14,8 @@ "clean:build": "rimraf build", "clean:firebase": "rimraf .firebase", "clean:wireit": "rimraf .wireit/**", - "cy:open": "yarn workspace @noshiro/blueprintjs-playground-cypress cy:open", - "cy:record": "yarn workspace @noshiro/blueprintjs-playground-cypress cy:record", - "cy:run:chrome": "yarn workspace @noshiro/blueprintjs-playground-cypress cy:run:chrome", - "cy:run:firefox": "yarn workspace @noshiro/blueprintjs-playground-cypress cy:run:firefox", + "e2e": "playwright test --config configs/playwright.config.ts", + "e2e:ui": "yarn e2e --ui", "fb": "firebase", "fb:deploy": "wireit", "fb:deploy:hosting": "wireit", @@ -40,13 +38,11 @@ "testw": "yarn zz:vitest watch", "tsc": "yarn type-check", "tscw": "tsc --noEmit --watch", - "type-check": "run-p type-check:src type-check:e2e", - "type-check:e2e": "tsc --noEmit -p ./cypress/tsconfig.json", - "type-check:src": "wireit", + "type-check": "wireit", "z:setup": "run-p z:setup:gen-global-dts", "z:setup:gen-global-dts": "node ./scripts/gen-global-dts.mjs", "zz:eslint": "ESLINT_USE_FLAT_CONFIG=true TIMING=1 eslint", - "zz:eslint:e2e": "yarn zz:eslint --config ./cypress/eslint.config.js './cypress/**/*.ts'", + "zz:eslint:e2e": "yarn zz:eslint --config eslint.config.js './e2e/**/*.ts'", "zz:eslint:print-config": "yarn zz:eslint --print-config src/main.tsx", "zz:eslint:src": "yarn zz:eslint --config eslint.config.js './src/**/*'", "zz:prettier": "prettier --cache --cache-strategy content --ignore-path ../../../.prettierignore --write", @@ -96,7 +92,7 @@ "@noshiro/ts-utils": "*" }, "wireit": { - "type-check:src": { + "type-check": { "dependencies": [ "z:setup:gen-global-dts" ], diff --git a/packages/apps/blueprintjs-playground/src/app.tsx b/packages/apps/blueprintjs-playground/src/app.tsx index 0737483d6d..aa4c762819 100644 --- a/packages/apps/blueprintjs-playground/src/app.tsx +++ b/packages/apps/blueprintjs-playground/src/app.tsx @@ -6,7 +6,7 @@ export const App = memoNamed('App', () => ( min-height: 100vh; padding: 20px; `} - data-cy={'root'} + data-e2e={'root'} >

{'Blueprint.js Playground'}

diff --git a/packages/apps/blueprintjs-playground/tsconfig.json b/packages/apps/blueprintjs-playground/tsconfig.json index 531745e313..6ec7337eab 100644 --- a/packages/apps/blueprintjs-playground/tsconfig.json +++ b/packages/apps/blueprintjs-playground/tsconfig.json @@ -5,5 +5,11 @@ "../../../configs/tsconfig/tsconfig.vite.json", "../../../configs/tsconfig/tsconfig.absolute-path.json" ], - "include": ["./src", "./configs", "./scripts"] + "include": [ + "./src", + "./configs", + "./scripts", + "./e2e", + "./playwright.config.ts" + ] } diff --git a/packages/apps/cant-stop-probability-app/.gitignore b/packages/apps/cant-stop-probability-app/.gitignore deleted file mode 100644 index 7abd081cd5..0000000000 --- a/packages/apps/cant-stop-probability-app/.gitignore +++ /dev/null @@ -1 +0,0 @@ -cypress/cypress/videos diff --git a/packages/apps/cant-stop-probability-app/configs/playwright.config.ts b/packages/apps/cant-stop-probability-app/configs/playwright.config.ts new file mode 100644 index 0000000000..ecbed1f7e2 --- /dev/null +++ b/packages/apps/cant-stop-probability-app/configs/playwright.config.ts @@ -0,0 +1,16 @@ +import { toThisDir } from '@noshiro/mono-utils'; +import path from 'node:path'; +import { definePlaywrightConfig } from '../../../../configs/define-playwright-config.mjs'; + +const thisDir = toThisDir(import.meta.url); + +export default definePlaywrightConfig({ + baseURL: 'http://localhost:5180', + testDir: path.resolve(thisDir, '..', 'e2e'), + webServer: [ + { + url: 'http://localhost:5180', + command: 'yarn start:dev-server', + }, + ], +}); diff --git a/packages/apps/cant-stop-probability-app/cypress/cypress.config.ts b/packages/apps/cant-stop-probability-app/cypress/cypress.config.ts deleted file mode 100644 index ea743fed17..0000000000 --- a/packages/apps/cant-stop-probability-app/cypress/cypress.config.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { defineConfig } from 'cypress'; - -export default defineConfig({ - projectId: 'zem8a1', - viewportWidth: 375, - viewportHeight: 667, - modifyObstructiveCode: false, - pageLoadTimeout: 120_000, - e2e: { - setupNodeEvents(_on, _config) { - // implement node event listeners here - }, - baseUrl: 'http://localhost:5180', - // specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}', - }, -}); diff --git a/packages/apps/cant-stop-probability-app/cypress/cypress/e2e/main.cy.ts b/packages/apps/cant-stop-probability-app/cypress/cypress/e2e/main.cy.ts deleted file mode 100644 index 9fd164e15f..0000000000 --- a/packages/apps/cant-stop-probability-app/cypress/cypress/e2e/main.cy.ts +++ /dev/null @@ -1,60 +0,0 @@ -const e = (selector: string): string => `[data-cy="${selector}"]`; - -describe('main', { testIsolation: false }, () => { - it('visit', () => { - cy.visit('/'); - cy.get(e('filter-input')).should('be.visible'); - }); - - it('filter 4,5', () => { - cy.get(e('filter-input')).clear(); - cy.get(e('filter-input')).type('4,5'); - - cy.get(e('table-body')).within(() => { - cy.get('tr') - .eq(0) - .within(() => { - cy.get('td').eq(0).should('have.text', '4'); - cy.get('td').eq(1).should('have.text', '5'); - cy.get('td').eq(2).should('have.text', '7'); - cy.get('td').eq(4).should('have.text', '357'); - cy.get('td').eq(5).should('have.text', '742'); - cy.get('td').eq(6).should('have.text', '197'); - cy.get('td').eq(7).should('have.text', '7'); - }); - - cy.get('tr') - .eq(1) - .within(() => { - cy.get('td').eq(0).should('have.text', '4'); - cy.get('td').eq(1).should('have.text', '5'); - cy.get('td').eq(2).should('have.text', '8'); - cy.get('td').eq(4).should('have.text', '314'); - cy.get('td').eq(5).should('have.text', '782'); - cy.get('td').eq(6).should('have.text', '200'); - cy.get('td').eq(7).should('have.text', '7'); - }); - }); - }); - - it('filter 12,2,3', () => { - cy.get(e('filter-input')).clear(); - cy.get(e('filter-input')).type('12,2,3'); - - cy.get(e('table-body')).within(() => { - cy.get('tr') - .eq(0) - .within(() => { - cy.get('td').eq(0).should('have.text', '2'); - cy.get('td').eq(1).should('have.text', '3'); - cy.get('td').eq(2).should('have.text', '12'); - cy.get('td').eq(4).should('have.text', '30'); - cy.get('td').eq(5).should('have.text', '538'); - cy.get('td').eq(6).should('have.text', '728'); - cy.get('td').eq(7).should('have.text', '0'); - }); - }); - }); -}); - -export {}; diff --git a/packages/apps/cant-stop-probability-app/cypress/cypress/fixtures/example.json b/packages/apps/cant-stop-probability-app/cypress/cypress/fixtures/example.json deleted file mode 100644 index 02e4254378..0000000000 --- a/packages/apps/cant-stop-probability-app/cypress/cypress/fixtures/example.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "Using fixtures to represent data", - "email": "hello@cypress.io", - "body": "Fixtures are a great way to mock data for responses to routes" -} diff --git a/packages/apps/cant-stop-probability-app/cypress/cypress/index.ts b/packages/apps/cant-stop-probability-app/cypress/cypress/index.ts deleted file mode 100644 index 5ed18ab535..0000000000 --- a/packages/apps/cant-stop-probability-app/cypress/cypress/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// - -export {}; diff --git a/packages/apps/cant-stop-probability-app/cypress/cypress/support/commands.ts b/packages/apps/cant-stop-probability-app/cypress/cypress/support/commands.ts deleted file mode 100644 index 915eae01a0..0000000000 --- a/packages/apps/cant-stop-probability-app/cypress/cypress/support/commands.ts +++ /dev/null @@ -1,38 +0,0 @@ -/// -// *********************************************** -// This example commands.ts shows you how to -// create various custom commands and overwrite -// existing commands. -// -// For more comprehensive examples of custom -// commands please read more here: -// https://on.cypress.io/custom-commands -// *********************************************** -// -// -// -- This is a parent command -- -// Cypress.Commands.add('login', (email, password) => { ... }) -// -// -// -- This is a child command -- -// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... }) -// -// -// -- This is a dual command -- -// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... }) -// -// -// -- This will overwrite an existing command -- -// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) -// -// declare global { -// namespace Cypress { -// interface Chainable { -// login(email: string, password: string): Chainable -// drag(subject: string, options?: Partial): Chainable -// dismiss(subject: string, options?: Partial): Chainable -// visit(originalFn: CommandOriginalFn, url: string, options: Partial): Chainable -// } -// } -// } -export {}; diff --git a/packages/apps/cant-stop-probability-app/cypress/cypress/support/e2e.ts b/packages/apps/cant-stop-probability-app/cypress/cypress/support/e2e.ts deleted file mode 100644 index c946d73f09..0000000000 --- a/packages/apps/cant-stop-probability-app/cypress/cypress/support/e2e.ts +++ /dev/null @@ -1,21 +0,0 @@ -// *********************************************************** -// This example support/e2e.ts is processed and -// loaded automatically before your test files. -// -// This is a great place to put global configuration and -// behavior that modifies Cypress. -// -// You can change the location of this file or turn off -// automatically serving support files with the -// 'supportFile' configuration option. -// -// You can read more here: -// https://on.cypress.io/configuration -// *********************************************************** - -// Import commands.js using ES2015 syntax: -// eslint-disable-next-line import/no-unassigned-import -import './commands'; - -// Alternatively you can use CommonJS syntax: -// require('./commands') diff --git a/packages/apps/cant-stop-probability-app/cypress/cypress/tsconfig.json b/packages/apps/cant-stop-probability-app/cypress/cypress/tsconfig.json deleted file mode 100644 index 53cf38609d..0000000000 --- a/packages/apps/cant-stop-probability-app/cypress/cypress/tsconfig.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "../../../../../configs/tsconfig/tsconfig.type-check.json", - "include": ["./**/*.ts"] -} diff --git a/packages/apps/cant-stop-probability-app/cypress/eslint.config.js b/packages/apps/cant-stop-probability-app/cypress/eslint.config.js deleted file mode 100644 index a29ec42885..0000000000 --- a/packages/apps/cant-stop-probability-app/cypress/eslint.config.js +++ /dev/null @@ -1,26 +0,0 @@ -/** @typedef {import('@noshiro/eslint-configs').FlatConfig} FlatConfig */ - -import { - eslintFlatConfigForCypress, - eslintFlatConfigForTypeScript, -} from '@noshiro/eslint-configs'; -import { toThisDir } from '@noshiro/mono-utils'; -import * as nodePath from 'node:path'; - -/** @type {string} */ -const thisDir = toThisDir(import.meta.url); - -/** @type {readonly FlatConfig[]} */ -const configs = [ - ...eslintFlatConfigForTypeScript({ - packageDirs: [ - nodePath.resolve(thisDir, '../../../..'), - nodePath.resolve(thisDir, '..'), - ], - tsconfigFileName: './tsconfig.json', - tsconfigRootDir: thisDir, - }), - eslintFlatConfigForCypress(), -]; - -export default configs; diff --git a/packages/apps/cant-stop-probability-app/cypress/memo.md b/packages/apps/cant-stop-probability-app/cypress/memo.md deleted file mode 100644 index 5a0d456b22..0000000000 --- a/packages/apps/cant-stop-probability-app/cypress/memo.md +++ /dev/null @@ -1 +0,0 @@ -https://docs.cypress.io/api/commands/click diff --git a/packages/apps/cant-stop-probability-app/cypress/package.json b/packages/apps/cant-stop-probability-app/cypress/package.json deleted file mode 100644 index 800aa56f0c..0000000000 --- a/packages/apps/cant-stop-probability-app/cypress/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "@noshiro/cant-stop-probability-app-cypress", - "version": "0.0.0", - "license": "MIT", - "type": "module", - "scripts": { - "cy:open": "cypress open", - "cy:record": "cypress run --record --key ${CYPRESS_RECORD_KEY}", - "cy:run:chrome": "cypress run --headed --browser chrome ", - "cy:run:firefox": "cypress run --headed --browser firefox ", - "start:dev-server": "yarn workspace @noshiro/cant-stop-probability-app start:dev-server", - "start:emulators": "yarn workspace @noshiro/cant-stop-probability-app start:emulators", - "start:emulators:e2e": "yarn workspace @noshiro/cant-stop-probability-app start:emulators:e2e" - } -} diff --git a/packages/apps/cant-stop-probability-app/cypress/tsconfig.json b/packages/apps/cant-stop-probability-app/cypress/tsconfig.json deleted file mode 100644 index 47d9af6bd4..0000000000 --- a/packages/apps/cant-stop-probability-app/cypress/tsconfig.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "../../../../configs/tsconfig/tsconfig.type-check.json", - "include": ["./cypress.config.ts", "./cypress"] -} diff --git a/packages/apps/cant-stop-probability-app/e2e/main-page.spec.ts b/packages/apps/cant-stop-probability-app/e2e/main-page.spec.ts new file mode 100644 index 0000000000..685aa8fb08 --- /dev/null +++ b/packages/apps/cant-stop-probability-app/e2e/main-page.spec.ts @@ -0,0 +1,57 @@ +import { expect, test } from '@playwright/test'; + +test('visit main page', async ({ page }) => { + await page.goto('/'); + + await expect.soft(page.getByTestId('filter-input')).toBeVisible(); +}); + +test('filter 4,5', async ({ page }) => { + await page.goto('/'); + + await page.getByTestId('filter-input').clear(); + await page.getByTestId('filter-input').fill('4,5'); + + const tableBody = page.getByTestId('table-body'); + const tr = tableBody.getByRole('row'); + + const row0Cells = tr.nth(0).getByRole('cell'); + + await expect.soft(row0Cells.nth(0)).toHaveText('4'); + await expect.soft(row0Cells.nth(1)).toHaveText('5'); + await expect.soft(row0Cells.nth(2)).toHaveText('7'); + await expect.soft(row0Cells.nth(4)).toHaveText('357'); + await expect.soft(row0Cells.nth(5)).toHaveText('742'); + await expect.soft(row0Cells.nth(6)).toHaveText('197'); + await expect.soft(row0Cells.nth(7)).toHaveText('7'); + + const row1Cells = tr.nth(1).getByRole('cell'); + + await expect.soft(row1Cells.nth(0)).toHaveText('4'); + await expect.soft(row1Cells.nth(1)).toHaveText('5'); + await expect.soft(row1Cells.nth(2)).toHaveText('8'); + await expect.soft(row1Cells.nth(4)).toHaveText('314'); + await expect.soft(row1Cells.nth(5)).toHaveText('782'); + await expect.soft(row1Cells.nth(6)).toHaveText('200'); + await expect.soft(row1Cells.nth(7)).toHaveText('7'); +}); + +test('filter 12,2,3', async ({ page }) => { + await page.goto('/'); + + await page.getByTestId('filter-input').clear(); + await page.getByTestId('filter-input').fill('12,2,3'); + + const tableBody = page.getByTestId('table-body'); + const tr = tableBody.getByRole('row'); + + const row0Cells = tr.nth(0).getByRole('cell'); + + await expect.soft(row0Cells.nth(0)).toHaveText('2'); + await expect.soft(row0Cells.nth(1)).toHaveText('3'); + await expect.soft(row0Cells.nth(2)).toHaveText('12'); + await expect.soft(row0Cells.nth(4)).toHaveText('30'); + await expect.soft(row0Cells.nth(5)).toHaveText('538'); + await expect.soft(row0Cells.nth(6)).toHaveText('728'); + await expect.soft(row0Cells.nth(7)).toHaveText('0'); +}); diff --git a/packages/apps/cant-stop-probability-app/eslint.config.js b/packages/apps/cant-stop-probability-app/eslint.config.js index 50ecd71614..f85823bfed 100644 --- a/packages/apps/cant-stop-probability-app/eslint.config.js +++ b/packages/apps/cant-stop-probability-app/eslint.config.js @@ -1,6 +1,7 @@ /** @typedef {import('@noshiro/eslint-configs').FlatConfig} FlatConfig */ import { + eslintFlatConfigForPlaywright, eslintFlatConfigForReact, eslintFlatConfigForTypeScript, eslintFlatConfigForVitest, @@ -26,8 +27,9 @@ const defineConfig = async () => { tsconfigFileName: './tsconfig.json', packageDirs: [nodePath.resolve(thisDir, '../../..'), thisDir], }), - eslintFlatConfigForVitest(), - ...eslintFlatConfigForReact(), + eslintFlatConfigForVitest(['src/**/*']), + ...eslintFlatConfigForReact(['src/**/*']), + eslintFlatConfigForPlaywright(['e2e/**/*']), { rules: { diff --git a/packages/apps/cant-stop-probability-app/package.json b/packages/apps/cant-stop-probability-app/package.json index 797bd83da3..306921b340 100644 --- a/packages/apps/cant-stop-probability-app/package.json +++ b/packages/apps/cant-stop-probability-app/package.json @@ -14,10 +14,8 @@ "clean:build": "rimraf build", "clean:firebase": "rimraf .firebase", "clean:wireit": "rimraf .wireit/**", - "cy:open": "yarn workspace @noshiro/cant-stop-probability-app-cypress cy:open", - "cy:record": "yarn workspace @noshiro/cant-stop-probability-app-cypress cy:record", - "cy:run:chrome": "yarn workspace @noshiro/cant-stop-probability-app-cypress cy:run:chrome", - "cy:run:firefox": "yarn workspace @noshiro/cant-stop-probability-app-cypress cy:run:firefox", + "e2e": "playwright test --config configs/playwright.config.ts", + "e2e:ui": "yarn e2e --ui", "fb": "firebase", "fb:deploy": "wireit", "fb:deploy:hosting": "wireit", @@ -40,13 +38,11 @@ "testw": "yarn zz:vitest watch", "tsc": "yarn type-check", "tscw": "tsc --noEmit --watch", - "type-check": "run-p type-check:src type-check:e2e", - "type-check:e2e": "tsc --noEmit -p ./cypress/tsconfig.json", - "type-check:src": "wireit", + "type-check": "wireit", "z:setup": "run-p z:setup:gen-global-dts", "z:setup:gen-global-dts": "node ./scripts/gen-global-dts.mjs", "zz:eslint": "ESLINT_USE_FLAT_CONFIG=true TIMING=1 eslint", - "zz:eslint:e2e": "yarn zz:eslint --config ./cypress/eslint.config.js './cypress/**/*.ts'", + "zz:eslint:e2e": "yarn zz:eslint --config eslint.config.js './e2e/**/*.ts'", "zz:eslint:print-config": "yarn zz:eslint --print-config src/main.tsx", "zz:eslint:src": "yarn zz:eslint --config eslint.config.js './src/**/*'", "zz:prettier": "prettier --cache --cache-strategy content --ignore-path ../../../.prettierignore --write", @@ -93,7 +89,7 @@ "@noshiro/ts-utils": "*" }, "wireit": { - "type-check:src": { + "type-check": { "dependencies": [ "z:setup:gen-global-dts" ], diff --git a/packages/apps/cant-stop-probability-app/src/components/table.tsx b/packages/apps/cant-stop-probability-app/src/components/table.tsx index 8787ae336b..cac6dd871f 100644 --- a/packages/apps/cant-stop-probability-app/src/components/table.tsx +++ b/packages/apps/cant-stop-probability-app/src/components/table.tsx @@ -59,7 +59,7 @@ export const ProbabilityTable = memoNamed( ( - + {filtered.map((r) => ( {r.selected[0]} diff --git a/packages/apps/cant-stop-probability-app/tsconfig.json b/packages/apps/cant-stop-probability-app/tsconfig.json index 531745e313..6ec7337eab 100644 --- a/packages/apps/cant-stop-probability-app/tsconfig.json +++ b/packages/apps/cant-stop-probability-app/tsconfig.json @@ -5,5 +5,11 @@ "../../../configs/tsconfig/tsconfig.vite.json", "../../../configs/tsconfig/tsconfig.absolute-path.json" ], - "include": ["./src", "./configs", "./scripts"] + "include": [ + "./src", + "./configs", + "./scripts", + "./e2e", + "./playwright.config.ts" + ] } diff --git a/packages/apps/catan-dice-app/.gitignore b/packages/apps/catan-dice-app/.gitignore deleted file mode 100644 index 7abd081cd5..0000000000 --- a/packages/apps/catan-dice-app/.gitignore +++ /dev/null @@ -1 +0,0 @@ -cypress/cypress/videos diff --git a/packages/apps/catan-dice-app/configs/playwright.config.ts b/packages/apps/catan-dice-app/configs/playwright.config.ts new file mode 100644 index 0000000000..ecbed1f7e2 --- /dev/null +++ b/packages/apps/catan-dice-app/configs/playwright.config.ts @@ -0,0 +1,16 @@ +import { toThisDir } from '@noshiro/mono-utils'; +import path from 'node:path'; +import { definePlaywrightConfig } from '../../../../configs/define-playwright-config.mjs'; + +const thisDir = toThisDir(import.meta.url); + +export default definePlaywrightConfig({ + baseURL: 'http://localhost:5180', + testDir: path.resolve(thisDir, '..', 'e2e'), + webServer: [ + { + url: 'http://localhost:5180', + command: 'yarn start:dev-server', + }, + ], +}); diff --git a/packages/apps/catan-dice-app/cypress/cypress.config.ts b/packages/apps/catan-dice-app/cypress/cypress.config.ts deleted file mode 100644 index 41028596ef..0000000000 --- a/packages/apps/catan-dice-app/cypress/cypress.config.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { defineConfig } from 'cypress'; - -export default defineConfig({ - projectId: 'hh92i5', - viewportWidth: 375, - viewportHeight: 667, - modifyObstructiveCode: false, - pageLoadTimeout: 120_000, - e2e: { - setupNodeEvents(_on, _config) { - // implement node event listeners here - }, - baseUrl: 'http://localhost:5180', - // specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}', - }, -}); diff --git a/packages/apps/catan-dice-app/cypress/cypress/e2e/main.cy.ts b/packages/apps/catan-dice-app/cypress/cypress/e2e/main.cy.ts deleted file mode 100644 index 6e248693fa..0000000000 --- a/packages/apps/catan-dice-app/cypress/cypress/e2e/main.cy.ts +++ /dev/null @@ -1,56 +0,0 @@ -const e = (selector: string): string => `[data-cy="${selector}"]`; - -describe('main', { testIsolation: false }, () => { - const rollButton = e('roll-dice-button'); - const undoButton = e('undo-button'); - const redoButton = e('redo-button'); - const redoCount = e('roll-count'); - - it('visit', () => { - cy.visit('/'); - cy.get(rollButton).should('be.visible'); - cy.get(undoButton).should('be.visible'); - cy.get(redoButton).should('be.visible'); - cy.get(redoCount).should('be.visible'); - }); - - it('initial state', () => { - cy.get(rollButton).should('not.be.disabled'); - cy.get(undoButton).should('be.disabled'); - cy.get(redoButton).should('be.disabled'); - cy.get(redoCount).should('have.text', 'N = 0'); - }); - - it('after roll twice', () => { - cy.get(rollButton).click(); - cy.get(rollButton).click(); - - cy.get(rollButton).should('not.be.disabled'); - cy.get(undoButton).should('not.be.disabled'); - cy.get(redoButton).should('be.disabled'); - - cy.get(redoCount).should('have.text', 'N = 2'); - }); - - it('after click undo once', () => { - cy.get(undoButton).click(); - - cy.get(rollButton).should('not.be.disabled'); - cy.get(undoButton).should('not.be.disabled'); - cy.get(redoButton).should('not.be.disabled'); - - cy.get(redoCount).should('have.text', 'N = 1'); - }); - - it('then click roll dice', () => { - cy.get(rollButton).click(); - - cy.get(rollButton).should('not.be.disabled'); - cy.get(undoButton).should('not.be.disabled'); - cy.get(redoButton).should('be.disabled'); - - cy.get(redoCount).should('have.text', 'N = 2'); - }); -}); - -export {}; diff --git a/packages/apps/catan-dice-app/cypress/cypress/fixtures/example.json b/packages/apps/catan-dice-app/cypress/cypress/fixtures/example.json deleted file mode 100644 index 02e4254378..0000000000 --- a/packages/apps/catan-dice-app/cypress/cypress/fixtures/example.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "Using fixtures to represent data", - "email": "hello@cypress.io", - "body": "Fixtures are a great way to mock data for responses to routes" -} diff --git a/packages/apps/catan-dice-app/cypress/cypress/index.ts b/packages/apps/catan-dice-app/cypress/cypress/index.ts deleted file mode 100644 index 5ed18ab535..0000000000 --- a/packages/apps/catan-dice-app/cypress/cypress/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// - -export {}; diff --git a/packages/apps/catan-dice-app/cypress/cypress/support/commands.ts b/packages/apps/catan-dice-app/cypress/cypress/support/commands.ts deleted file mode 100644 index 915eae01a0..0000000000 --- a/packages/apps/catan-dice-app/cypress/cypress/support/commands.ts +++ /dev/null @@ -1,38 +0,0 @@ -/// -// *********************************************** -// This example commands.ts shows you how to -// create various custom commands and overwrite -// existing commands. -// -// For more comprehensive examples of custom -// commands please read more here: -// https://on.cypress.io/custom-commands -// *********************************************** -// -// -// -- This is a parent command -- -// Cypress.Commands.add('login', (email, password) => { ... }) -// -// -// -- This is a child command -- -// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... }) -// -// -// -- This is a dual command -- -// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... }) -// -// -// -- This will overwrite an existing command -- -// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) -// -// declare global { -// namespace Cypress { -// interface Chainable { -// login(email: string, password: string): Chainable -// drag(subject: string, options?: Partial): Chainable -// dismiss(subject: string, options?: Partial): Chainable -// visit(originalFn: CommandOriginalFn, url: string, options: Partial): Chainable -// } -// } -// } -export {}; diff --git a/packages/apps/catan-dice-app/cypress/cypress/support/e2e.ts b/packages/apps/catan-dice-app/cypress/cypress/support/e2e.ts deleted file mode 100644 index c946d73f09..0000000000 --- a/packages/apps/catan-dice-app/cypress/cypress/support/e2e.ts +++ /dev/null @@ -1,21 +0,0 @@ -// *********************************************************** -// This example support/e2e.ts is processed and -// loaded automatically before your test files. -// -// This is a great place to put global configuration and -// behavior that modifies Cypress. -// -// You can change the location of this file or turn off -// automatically serving support files with the -// 'supportFile' configuration option. -// -// You can read more here: -// https://on.cypress.io/configuration -// *********************************************************** - -// Import commands.js using ES2015 syntax: -// eslint-disable-next-line import/no-unassigned-import -import './commands'; - -// Alternatively you can use CommonJS syntax: -// require('./commands') diff --git a/packages/apps/catan-dice-app/cypress/cypress/tsconfig.json b/packages/apps/catan-dice-app/cypress/cypress/tsconfig.json deleted file mode 100644 index 53cf38609d..0000000000 --- a/packages/apps/catan-dice-app/cypress/cypress/tsconfig.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "../../../../../configs/tsconfig/tsconfig.type-check.json", - "include": ["./**/*.ts"] -} diff --git a/packages/apps/catan-dice-app/cypress/eslint.config.js b/packages/apps/catan-dice-app/cypress/eslint.config.js deleted file mode 100644 index a29ec42885..0000000000 --- a/packages/apps/catan-dice-app/cypress/eslint.config.js +++ /dev/null @@ -1,26 +0,0 @@ -/** @typedef {import('@noshiro/eslint-configs').FlatConfig} FlatConfig */ - -import { - eslintFlatConfigForCypress, - eslintFlatConfigForTypeScript, -} from '@noshiro/eslint-configs'; -import { toThisDir } from '@noshiro/mono-utils'; -import * as nodePath from 'node:path'; - -/** @type {string} */ -const thisDir = toThisDir(import.meta.url); - -/** @type {readonly FlatConfig[]} */ -const configs = [ - ...eslintFlatConfigForTypeScript({ - packageDirs: [ - nodePath.resolve(thisDir, '../../../..'), - nodePath.resolve(thisDir, '..'), - ], - tsconfigFileName: './tsconfig.json', - tsconfigRootDir: thisDir, - }), - eslintFlatConfigForCypress(), -]; - -export default configs; diff --git a/packages/apps/catan-dice-app/cypress/memo.md b/packages/apps/catan-dice-app/cypress/memo.md deleted file mode 100644 index 5a0d456b22..0000000000 --- a/packages/apps/catan-dice-app/cypress/memo.md +++ /dev/null @@ -1 +0,0 @@ -https://docs.cypress.io/api/commands/click diff --git a/packages/apps/catan-dice-app/cypress/package.json b/packages/apps/catan-dice-app/cypress/package.json deleted file mode 100644 index 5ad1beec85..0000000000 --- a/packages/apps/catan-dice-app/cypress/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "@noshiro/catan-dice-app-cypress", - "version": "0.0.0", - "license": "MIT", - "type": "module", - "scripts": { - "cy:open": "cypress open", - "cy:record": "cypress run --record --key ${CYPRESS_RECORD_KEY}", - "cy:run:chrome": "cypress run --headed --browser chrome ", - "cy:run:firefox": "cypress run --headed --browser firefox ", - "start:dev-server": "yarn workspace @noshiro/catan-dice-app start:dev-server", - "start:emulators": "yarn workspace @noshiro/catan-dice-app start:emulators", - "start:emulators:e2e": "yarn workspace @noshiro/catan-dice-app start:emulators:e2e" - } -} diff --git a/packages/apps/catan-dice-app/cypress/tsconfig.json b/packages/apps/catan-dice-app/cypress/tsconfig.json deleted file mode 100644 index 47d9af6bd4..0000000000 --- a/packages/apps/catan-dice-app/cypress/tsconfig.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "../../../../configs/tsconfig/tsconfig.type-check.json", - "include": ["./cypress.config.ts", "./cypress"] -} diff --git a/packages/apps/catan-dice-app/e2e/main-page.spec.ts b/packages/apps/catan-dice-app/e2e/main-page.spec.ts new file mode 100644 index 0000000000..f3b075cfb1 --- /dev/null +++ b/packages/apps/catan-dice-app/e2e/main-page.spec.ts @@ -0,0 +1,83 @@ +import { expect, test } from '@playwright/test'; + +test('visit main page', async ({ page }) => { + await page.goto('/'); + + const rollButton = page.getByTestId('roll-dice-button'); + const undoButton = page.getByTestId('undo-button'); + const redoButton = page.getByTestId('redo-button'); + const redoCount = page.getByTestId('roll-count'); + + await expect.soft(rollButton).toBeVisible(); + await expect.soft(undoButton).toBeVisible(); + await expect.soft(redoButton).toBeVisible(); + await expect.soft(redoCount).toBeVisible(); +}); + +test('initial state', async ({ page }) => { + await page.goto('/'); + + const rollButton = page.getByTestId('roll-dice-button'); + const undoButton = page.getByTestId('undo-button'); + const redoButton = page.getByTestId('redo-button'); + const redoCount = page.getByTestId('roll-count'); + + await expect.soft(rollButton).toBeEnabled(); + await expect.soft(undoButton).toBeDisabled(); + await expect.soft(redoButton).toBeDisabled(); + await expect.soft(redoCount).toHaveText('N = 0'); +}); + +test('after roll twice', async ({ page }) => { + await page.goto('/'); + + const rollButton = page.getByTestId('roll-dice-button'); + const undoButton = page.getByTestId('undo-button'); + const redoButton = page.getByTestId('redo-button'); + const redoCount = page.getByTestId('roll-count'); + + await rollButton.click(); + await rollButton.click(); + + await expect.soft(rollButton).toBeEnabled(); + await expect.soft(undoButton).toBeEnabled(); + await expect.soft(redoButton).toBeDisabled(); + await expect.soft(redoCount).toHaveText('N = 2'); +}); + +test('after click undo once', async ({ page }) => { + await page.goto('/'); + + const rollButton = page.getByTestId('roll-dice-button'); + const undoButton = page.getByTestId('undo-button'); + const redoButton = page.getByTestId('redo-button'); + const redoCount = page.getByTestId('roll-count'); + + await rollButton.click(); + await rollButton.click(); + await undoButton.click(); + + await expect.soft(rollButton).toBeEnabled(); + await expect.soft(undoButton).toBeEnabled(); + await expect.soft(redoButton).toBeEnabled(); + await expect.soft(redoCount).toHaveText('N = 1'); +}); + +test('roll after undo', async ({ page }) => { + await page.goto('/'); + + const rollButton = page.getByTestId('roll-dice-button'); + const undoButton = page.getByTestId('undo-button'); + const redoButton = page.getByTestId('redo-button'); + const redoCount = page.getByTestId('roll-count'); + + await rollButton.click(); + await rollButton.click(); + await undoButton.click(); + await rollButton.click(); + + await expect.soft(rollButton).toBeEnabled(); + await expect.soft(undoButton).toBeEnabled(); + await expect.soft(redoButton).toBeDisabled(); + await expect.soft(redoCount).toHaveText('N = 2'); +}); diff --git a/packages/apps/catan-dice-app/eslint.config.js b/packages/apps/catan-dice-app/eslint.config.js index 50ecd71614..f85823bfed 100644 --- a/packages/apps/catan-dice-app/eslint.config.js +++ b/packages/apps/catan-dice-app/eslint.config.js @@ -1,6 +1,7 @@ /** @typedef {import('@noshiro/eslint-configs').FlatConfig} FlatConfig */ import { + eslintFlatConfigForPlaywright, eslintFlatConfigForReact, eslintFlatConfigForTypeScript, eslintFlatConfigForVitest, @@ -26,8 +27,9 @@ const defineConfig = async () => { tsconfigFileName: './tsconfig.json', packageDirs: [nodePath.resolve(thisDir, '../../..'), thisDir], }), - eslintFlatConfigForVitest(), - ...eslintFlatConfigForReact(), + eslintFlatConfigForVitest(['src/**/*']), + ...eslintFlatConfigForReact(['src/**/*']), + eslintFlatConfigForPlaywright(['e2e/**/*']), { rules: { diff --git a/packages/apps/catan-dice-app/package.json b/packages/apps/catan-dice-app/package.json index c07afae85e..d449168fab 100644 --- a/packages/apps/catan-dice-app/package.json +++ b/packages/apps/catan-dice-app/package.json @@ -14,10 +14,8 @@ "clean:build": "rimraf build", "clean:firebase": "rimraf .firebase", "clean:wireit": "rimraf .wireit/**", - "cy:open": "yarn workspace @noshiro/catan-dice-app-cypress cy:open", - "cy:record": "yarn workspace @noshiro/catan-dice-app-cypress cy:record", - "cy:run:chrome": "yarn workspace @noshiro/catan-dice-app-cypress cy:run:chrome", - "cy:run:firefox": "yarn workspace @noshiro/catan-dice-app-cypress cy:run:firefox", + "e2e": "playwright test --config configs/playwright.config.ts", + "e2e:ui": "yarn e2e --ui", "fb": "firebase", "fb:deploy": "wireit", "fb:deploy:hosting": "wireit", @@ -40,13 +38,11 @@ "testw": "yarn zz:vitest watch", "tsc": "yarn type-check", "tscw": "tsc --noEmit --watch", - "type-check": "run-p type-check:src type-check:e2e", - "type-check:e2e": "tsc --noEmit -p ./cypress/tsconfig.json", - "type-check:src": "wireit", + "type-check": "wireit", "z:setup": "run-p z:setup:gen-global-dts", "z:setup:gen-global-dts": "node ./scripts/gen-global-dts.mjs", "zz:eslint": "ESLINT_USE_FLAT_CONFIG=true TIMING=1 eslint", - "zz:eslint:e2e": "yarn zz:eslint --config ./cypress/eslint.config.js './cypress/**/*.ts'", + "zz:eslint:e2e": "yarn zz:eslint --config eslint.config.js './e2e/**/*.ts'", "zz:eslint:print-config": "yarn zz:eslint --print-config src/main.tsx", "zz:eslint:src": "yarn zz:eslint --config eslint.config.js './src/**/*'", "zz:prettier": "prettier --cache --cache-strategy content --ignore-path ../../../.prettierignore --write", @@ -91,7 +87,7 @@ "@noshiro/ts-utils": "*" }, "wireit": { - "type-check:src": { + "type-check": { "dependencies": [ "z:setup:gen-global-dts" ], diff --git a/packages/apps/catan-dice-app/src/components/histogram/histogram-view.tsx b/packages/apps/catan-dice-app/src/components/histogram/histogram-view.tsx index 626bbac2fe..de95d08c2b 100644 --- a/packages/apps/catan-dice-app/src/components/histogram/histogram-view.tsx +++ b/packages/apps/catan-dice-app/src/components/histogram/histogram-view.tsx @@ -24,7 +24,7 @@ export const HistogramView = memoNamed( css={css` padding: 5px; `} - data-cy={'roll-count'} + data-e2e={'roll-count'} > {'N = '} {numSample} diff --git a/packages/apps/catan-dice-app/src/components/main-view.tsx b/packages/apps/catan-dice-app/src/components/main-view.tsx index db15e96b71..d52e6c4f85 100644 --- a/packages/apps/catan-dice-app/src/components/main-view.tsx +++ b/packages/apps/catan-dice-app/src/components/main-view.tsx @@ -85,7 +85,7 @@ export const MainView = memoNamed(