From 159d5f8359b7fad052ac2235cda3be24b74a928d Mon Sep 17 00:00:00 2001 From: Makito Date: Thu, 3 Aug 2023 15:46:13 +0800 Subject: [PATCH 1/2] chore(*): isolate test-only deps and housekeeping --- .github/workflows/.reusable_e2e_tests.yml | 10 +- package.json | 15 ++- src/pages/plugins/Form.vue | 4 +- src/schemas/Datadog.ts | 4 +- tests/playwright/commands/withNavigation.ts | 4 +- tests/playwright/helpers/misc.ts | 3 + tests/playwright/package.json | 17 +++ .../playwright/playwright.config.ts | 4 +- tests/playwright/tsconfig.json | 13 +-- tests/playwright/yarn.lock | 100 ++++++++++++++++++ yarn.lock | 46 ++++---- 11 files changed, 164 insertions(+), 56 deletions(-) create mode 100644 tests/playwright/package.json rename playwright.config.ts => tests/playwright/playwright.config.ts (91%) create mode 100644 tests/playwright/yarn.lock diff --git a/.github/workflows/.reusable_e2e_tests.yml b/.github/workflows/.reusable_e2e_tests.yml index 97ed2e87..3492b4c3 100644 --- a/.github/workflows/.reusable_e2e_tests.yml +++ b/.github/workflows/.reusable_e2e_tests.yml @@ -64,8 +64,8 @@ jobs: timeout-minutes: 10 run: | npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}" - yarn add -D @playwright/test - npx --yes playwright install chromium + yarn install:e2e + yarn playwright install chromium - name: Log in to GitHub Container Registry timeout-minutes: 1 @@ -90,11 +90,11 @@ jobs: env: KM_TEST_GUI_URL: ${{ inputs.base-url }} run: | - yarn playwright test \ + yarn test:e2e \ --pass-with-no-tests \ --retries ${{ inputs.retries }} \ --reporter=list \ - specs/${{ matrix.suite }} + ${{ matrix.suite }}/ - name: Upload results if: ${{ !cancelled() }} @@ -102,5 +102,5 @@ jobs: uses: actions/upload-artifact@v3 with: name: results-${{ matrix.suite }} - path: test-results/ + path: tests/playwright/test-results/ retention-days: 1 diff --git a/package.json b/package.json index 77a8635d..04e25696 100644 --- a/package.json +++ b/package.json @@ -6,11 +6,12 @@ "scripts": { "serve": "vite", "build": "vite build", - "test:e2e": "playwright test specs/", + "install:e2e": "yarn --cwd tests/playwright install", + "test:e2e": "yarn --cwd tests/playwright run test", + "playwright": "yarn --cwd tests/playwright run playwright", "preview": "vite build && vite preview", "lint": "eslint --ext .js,.vue,.ts src", - "postinstall": "husky install", - "playwright": "playwright" + "postinstall": "husky install" }, "lint-staged": { "src/**/*.{ts,js,vue}": "eslint --fix" @@ -36,14 +37,12 @@ "@kong/kongponents": "^8.116.2", "@material-design-icons/font": "^0.14.9", "axios": "^1.4.0", - "bmp-js": "^0.1.0", - "lodash.clonedeep": "^4.5.0", "marked": "^5.1.0", "vue": "^3.2.47", "vue-router": "^4.2.2" }, "devDependencies": { - "@playwright/test": "^1.36.2", + "@types/lodash-es": "^4.17.8", "@types/node": "^20.3.1", "@typescript-eslint/eslint-plugin": "^5.60.0", "@typescript-eslint/parser": "^5.60.0", @@ -60,10 +59,10 @@ "eslint-plugin-vuejs-accessibility": "^2.1.0", "husky": "^8.0.3", "lint-staged": "^13.2.2", - "lodash.debounce": "^4.0.8", + "lodash-es": "^4.17.21", "sass": "^1.63.4", "typescript": "^5.1.3", "vite": "^4.3.9", "vite-plugin-html": "^3.2.0" } -} +} \ No newline at end of file diff --git a/src/pages/plugins/Form.vue b/src/pages/plugins/Form.vue index d27caa6e..c43f703d 100644 --- a/src/pages/plugins/Form.vue +++ b/src/pages/plugins/Form.vue @@ -73,7 +73,7 @@