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/DEVELOPMENT.md b/DEVELOPMENT.md new file mode 100644 index 00000000..201ae69a --- /dev/null +++ b/DEVELOPMENT.md @@ -0,0 +1,23 @@ +# Development + +> 🚧 This document is still a work in progress. + +## Testing + +### End-to-end testing + +End-to-end testing, also called E2E testing, guarantees that applications perform as expected and maintain seamless data flow for diverse user tasks and processes. This testing strategy begins from the perspective of end users and replicates real-life scenarios. + +Kong Manager uses Playwright to perform end-to-end tests. To install dependencies required for end-to-end testing, run the following command: + +```shell +yarn install:e2e +``` + +Afterward, run all the test cases using the following command: + +```shell +yarn test:e2e +``` + +You may find all the test cases for end-to-end testing under the `tests/playwright/specs` folder. Please feel free to make any necessary modifications and add new test cases as per your requirements. Happy testing! 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 @@