From 4742a5a3d4d68eb477b0c252d238501fd3550fba Mon Sep 17 00:00:00 2001 From: Tomasz Konieczny Date: Tue, 16 May 2023 14:25:38 +0200 Subject: [PATCH] E2E tests moved to testkube-dashboard repo, test CRD updated (#3839) --- test/dashboard-e2e/.env | 2 - test/dashboard-e2e/.gitignore | 4 - test/dashboard-e2e/api/api-helpers.js | 147 ------ test/dashboard-e2e/crd/crd.yaml | 2 +- .../data-handlers/test-data-handlers.ts | 7 - test/dashboard-e2e/fixtures/tests.json | 130 ----- test/dashboard-e2e/helpers/common-helpers.ts | 18 - test/dashboard-e2e/package-lock.json | 463 ------------------ test/dashboard-e2e/package.json | 16 - test/dashboard-e2e/pages/CreateTestPage.ts | 63 --- test/dashboard-e2e/pages/MainPage.ts | 24 - .../dashboard-e2e/pages/TestExecutionsPage.ts | 16 - test/dashboard-e2e/playwright.config.ts | 45 -- test/dashboard-e2e/tests/create-test.spec.ts | 57 --- test/dashboard-e2e/tests/executors.spec.ts | 25 - test/dashboard-e2e/tests/run-test.spec.ts | 40 -- .../dashboard-e2e/tests/test-settings.spec.ts | 29 -- test/dashboard-e2e/tests/test-sources.spec.ts | 17 - .../tests/tests-dashboard.spec.ts | 9 - .../tests/testsuite-settings.spec.ts | 25 - .../tests/testsuites-dashboard.spec.ts | 9 - test/dashboard-e2e/tests/triggers.spec.ts | 13 - 22 files changed, 1 insertion(+), 1160 deletions(-) delete mode 100644 test/dashboard-e2e/.env delete mode 100644 test/dashboard-e2e/.gitignore delete mode 100644 test/dashboard-e2e/api/api-helpers.js delete mode 100644 test/dashboard-e2e/data-handlers/test-data-handlers.ts delete mode 100644 test/dashboard-e2e/fixtures/tests.json delete mode 100644 test/dashboard-e2e/helpers/common-helpers.ts delete mode 100644 test/dashboard-e2e/package-lock.json delete mode 100644 test/dashboard-e2e/package.json delete mode 100644 test/dashboard-e2e/pages/CreateTestPage.ts delete mode 100644 test/dashboard-e2e/pages/MainPage.ts delete mode 100644 test/dashboard-e2e/pages/TestExecutionsPage.ts delete mode 100644 test/dashboard-e2e/playwright.config.ts delete mode 100644 test/dashboard-e2e/tests/create-test.spec.ts delete mode 100644 test/dashboard-e2e/tests/executors.spec.ts delete mode 100644 test/dashboard-e2e/tests/run-test.spec.ts delete mode 100644 test/dashboard-e2e/tests/test-settings.spec.ts delete mode 100644 test/dashboard-e2e/tests/test-sources.spec.ts delete mode 100644 test/dashboard-e2e/tests/tests-dashboard.spec.ts delete mode 100644 test/dashboard-e2e/tests/testsuite-settings.spec.ts delete mode 100644 test/dashboard-e2e/tests/testsuites-dashboard.spec.ts delete mode 100644 test/dashboard-e2e/tests/triggers.spec.ts diff --git a/test/dashboard-e2e/.env b/test/dashboard-e2e/.env deleted file mode 100644 index f7896d025b5..00000000000 --- a/test/dashboard-e2e/.env +++ /dev/null @@ -1,2 +0,0 @@ -BASE_URL=http://localhost:8080 -API_URL=localhost:8088/v1 \ No newline at end of file diff --git a/test/dashboard-e2e/.gitignore b/test/dashboard-e2e/.gitignore deleted file mode 100644 index 75e854d8dcf..00000000000 --- a/test/dashboard-e2e/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -node_modules/ -/test-results/ -/playwright-report/ -/playwright/.cache/ diff --git a/test/dashboard-e2e/api/api-helpers.js b/test/dashboard-e2e/api/api-helpers.js deleted file mode 100644 index d3f71289841..00000000000 --- a/test/dashboard-e2e/api/api-helpers.js +++ /dev/null @@ -1,147 +0,0 @@ -import superagent from 'superagent' - -export class ApiHelpers { - constructor(apiUrl) { - this.API_URL = apiUrl; - } - - async getTests() { - const request = `${this.API_URL}/tests` - - try { - const response = await superagent.get(request) - - return response.body - } catch (e) { - throw Error(`getTests failed on "${request}" with: "${e}"`) - } - } - - async createTest(testData) { - const request = `${this.API_URL}/tests` - - try { - const response = await superagent.post(request) - .set('Content-Type', 'application/json') - .send(testData) - - return response.body - } catch (e) { - throw Error(`createTest failed on "${request}" with: "${e}"`) - } - } - - async abortTest(testName, executionId) { - const request = `${this.API_URL}/tests/${testName}/executions/${executionId}` - - try { - const response = await superagent.patch(request) - - return response - } catch (e) { - throw Error(`abortTest failed on "${request}" with: "${e}"`) - } - } - - async removeTest(testName) { - const request = `${this.API_URL}/tests/${testName}` - - try { - await superagent.delete(request) - } catch (e) { - throw Error(`removeTest failed on "${request}" with: "${e}"`) - } - } - - async updateTest(testData) { - const request = `${this.API_URL}/tests/${testData.name}` - - try { - const response = await superagent.patch(request) - .set('Content-Type', 'application/json') - .send(testData) - - return response.body - } catch (e) { - throw Error(`updateTest failed on "${request}" with: "${e}"`) - } - } - - async isTestCreated(testName) { - try { - const currentTests = await this.getTests() - const test = currentTests.find(singleTest => singleTest.name == testName) - - if(test != undefined) { - return true - } - - return false - } catch (e) { - throw Error(`isTestCreated failed for "${testName}" with: "${e}"`) - } - } - - async assureTestNotCreated(testName) { - try { - const alreadyCreated = await this.isTestCreated(testName) - if(alreadyCreated) { - await this.removeTest(testName) - } - - return true - } catch (e) { - throw Error(`assureTestNotCreated failed for "${testName}" with: "${e}"`) - } - } - - async assureTestCreated(testData, fullCleanup=false) { - try { - const alreadyCreated = await this.isTestCreated(testData.name) - - if(alreadyCreated) { - if(fullCleanup) { - await this.removeTest(testData.name) - await this.createTest(testData) - } else { - await this.updateTest(testData) - } - } else { - await this.createTest(testData) - } - } catch (e) { - throw Error(`assureTestCreated failed for "${testData.name}" with: "${e}"`) - } - } - - async getTestData(testName) { - const request = `${this.API_URL}/tests/${testName}` - - try { - const response = await superagent.get(request) - - return response.body - } catch (e) { - throw Error(`getTestData failed on "${request}" with: "${e}"`) - } - } - - async getLastExecutionNumber(testName) { - const request = `${this.API_URL}/tests/${testName}/executions` - - try { - const response = await superagent.get(request) - const totalsResults = response.body.totals.results - - if(totalsResults == 0) { - return totalsResults - } else { - const lastExecutionResults = response.body.results[0] - - return lastExecutionResults.number - } - } catch (e) { - throw Error(`getLastExecutionNumber failed on "${request}" with: "${e}"`) - } - } -} \ No newline at end of file diff --git a/test/dashboard-e2e/crd/crd.yaml b/test/dashboard-e2e/crd/crd.yaml index 8666970166c..33c309b9303 100644 --- a/test/dashboard-e2e/crd/crd.yaml +++ b/test/dashboard-e2e/crd/crd.yaml @@ -11,7 +11,7 @@ spec: type: git repository: type: git - uri: https://github.com/kubeshop/testkube + uri: https://github.com/kubeshop/testkube-dashboard branch: main path: test/dashboard-e2e workingDir: test/dashboard-e2e diff --git a/test/dashboard-e2e/data-handlers/test-data-handlers.ts b/test/dashboard-e2e/data-handlers/test-data-handlers.ts deleted file mode 100644 index 1bedfa05ef4..00000000000 --- a/test/dashboard-e2e/data-handlers/test-data-handlers.ts +++ /dev/null @@ -1,7 +0,0 @@ -import testsData from '../fixtures/tests.json' - -export class TestDataHandler { - getTest(testName) { - return testsData[testName] - } -} \ No newline at end of file diff --git a/test/dashboard-e2e/fixtures/tests.json b/test/dashboard-e2e/fixtures/tests.json deleted file mode 100644 index 08eb9c2a2a6..00000000000 --- a/test/dashboard-e2e/fixtures/tests.json +++ /dev/null @@ -1,130 +0,0 @@ -{ - "cypress-git": { - "name": "internal-dashboard-e2e-cypress-git", - "type": "cypress/project", - "content": { - "type": "git", - "repository": { - "type": "git", - "uri": "https://github.com/kubeshop/testkube", - "branch": "main", - "path": "test/cypress/executor-tests/cypress-without-envs" - } - }, - "labels": { - "core-tests": "dashboard-e2e-internal" - } - }, - "cypress-git-created": { - "name": "internal-dashboard-e2e-cypress-git-created", - "type": "cypress/project", - "content": { - "type": "git", - "repository": { - "type": "git", - "uri": "https://github.com/kubeshop/testkube", - "branch": "main", - "path": "test/cypress/executor-tests/cypress-without-envs" - } - }, - "labels": { - "core-tests": "dashboard-e2e-internal" - } - }, - "k6-git": { - "name": "internal-dashboard-e2e-k6-git", - "type": "k6/script", - "content": { - "type": "git", - "repository": { - "type": "git", - "uri": "https://github.com/kubeshop/testkube", - "branch": "main", - "path": "test/k6/executor-tests/k6-smoke-test-without-envs.js" - } - }, - "labels": { - "core-tests": "dashboard-e2e-internal" - } - }, - "k6-git-created": { - "name": "internal-dashboard-e2e-k6-git-created", - "type": "k6/script", - "content": { - "type": "git", - "repository": { - "type": "git", - "uri": "https://github.com/kubeshop/testkube", - "branch": "main", - "path": "test/k6/executor-tests/k6-smoke-test-without-envs.js" - } - }, - "labels": { - "core-tests": "dashboard-e2e-internal" - } - }, - "postman-git": { - "name": "internal-dashboard-e2e-postman-git", - "type": "postman/collection", - "content": { - "type": "git", - "repository": { - "type": "git", - "uri": "https://github.com/kubeshop/testkube", - "branch": "main", - "path": "test/postman/executor-tests/postman-executor-smoke-without-envs.postman_collection.json" - } - }, - "labels": { - "core-tests": "dashboard-e2e-internal" - } - }, - "postman-git-created": { - "name": "internal-dashboard-e2e-postman-git-created", - "type": "postman/collection", - "content": { - "type": "git", - "repository": { - "type": "git", - "uri": "https://github.com/kubeshop/testkube", - "branch": "main", - "path": "test/postman/executor-tests/postman-executor-smoke-without-envs.postman_collection.json" - } - }, - "labels": { - "core-tests": "dashboard-e2e-internal" - } - }, - "postman-negative-test": { - "name": "internal-dashboard-e2e-postman-git-ran-negative-test", - "type": "postman/collection", - "content": { - "type": "git", - "repository": { - "type": "git", - "uri": "https://github.com/kubeshop/testkube", - "branch": "main", - "path": "test/postman/executor-tests/postman-executor-smoke.postman_collection.json" - } - }, - "labels": { - "core-tests": "cli-internal" - } - }, - "postman-negative-init": { - "name": "internal-dashboard-e2e-postman-git-ran-negative-init", - "type": "postman/collection", - "content": { - "type": "git", - "repository": { - "type": "git", - "uri": "https://github.com/kubeshop/testkube", - "branch": "some-non-existing-branch", - "path": "some/incorrect/path/non-existing-file.json" - } - }, - "labels": { - "core-tests": "cli-internal" - } - } -} \ No newline at end of file diff --git a/test/dashboard-e2e/helpers/common-helpers.ts b/test/dashboard-e2e/helpers/common-helpers.ts deleted file mode 100644 index 532684dc743..00000000000 --- a/test/dashboard-e2e/helpers/common-helpers.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { expect } from '@playwright/test'; - -export class CommonHelpers { - validateTest(testData, createdTestData) { - expect(testData.name).toEqual(createdTestData.name) - //TODO: label - expect(testData.type).toEqual(createdTestData.type) - expect(testData.content.type).toEqual(createdTestData.content.type) - - //testSources - const contentType = testData.content.type - if (contentType == "git") { - for (let key in testData.content.repository) { - expect(testData.content.repository[key]).toEqual(createdTestData.content.repository[key]) - } - } - } -} \ No newline at end of file diff --git a/test/dashboard-e2e/package-lock.json b/test/dashboard-e2e/package-lock.json deleted file mode 100644 index ffaaaab04d2..00000000000 --- a/test/dashboard-e2e/package-lock.json +++ /dev/null @@ -1,463 +0,0 @@ -{ - "name": "dashboard-e2e-playwright", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "dashboard-e2e-playwright", - "version": "1.0.0", - "license": "ISC", - "devDependencies": { - "@playwright/test": "^1.32.3", - "@types/node": "^18.15.13", - "dotenv": "16.0.3", - "superagent": "8.0.0" - } - }, - "node_modules/@playwright/test": { - "version": "1.32.3", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.32.3.tgz", - "integrity": "sha512-BvWNvK0RfBriindxhLVabi8BRe3X0J9EVjKlcmhxjg4giWBD/xleLcg2dz7Tx0agu28rczjNIPQWznwzDwVsZQ==", - "dev": true, - "dependencies": { - "@types/node": "*", - "playwright-core": "1.32.3" - }, - "bin": { - "playwright": "cli.js" - }, - "engines": { - "node": ">=14" - }, - "optionalDependencies": { - "fsevents": "2.3.2" - } - }, - "node_modules/@types/node": { - "version": "18.15.13", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.13.tgz", - "integrity": "sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==", - "dev": true - }, - "node_modules/asap": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", - "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", - "dev": true - }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dev": true - }, - "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/component-emitter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", - "dev": true - }, - "node_modules/cookiejar": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.4.tgz", - "integrity": "sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==", - "dev": true - }, - "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/dezalgo": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.4.tgz", - "integrity": "sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig==", - "dev": true, - "dependencies": { - "asap": "^2.0.0", - "wrappy": "1" - } - }, - "node_modules/dotenv": { - "version": "16.0.3", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz", - "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/fast-safe-stringify": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", - "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", - "dev": true - }, - "node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "dev": true, - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/formidable": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/formidable/-/formidable-2.1.1.tgz", - "integrity": "sha512-0EcS9wCFEzLvfiks7omJ+SiYJAiD+TzK4Pcw1UlUoGnhUxDcMKjt0P7x8wEb0u6OHu8Nb98WG3nxtlF5C7bvUQ==", - "dev": true, - "dependencies": { - "dezalgo": "^1.0.4", - "hexoid": "^1.0.0", - "once": "^1.4.0", - "qs": "^6.11.0" - }, - "funding": { - "url": "https://ko-fi.com/tunnckoCore/commissions" - } - }, - "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "node_modules/get-intrinsic": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz", - "integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/hexoid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/hexoid/-/hexoid-1.0.0.tgz", - "integrity": "sha512-QFLV0taWQOZtvIRIAdBChesmogZrtuXvVWsFHZTk2SU+anspqZ2vMnoLg7IE1+Uk16N19APic1BuF8bC8c2m5g==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", - "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==", - "dev": true, - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dev": true, - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/object-inspect": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", - "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/playwright-core": { - "version": "1.32.3", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.32.3.tgz", - "integrity": "sha512-SB+cdrnu74ZIn5Ogh/8278ngEh9NEEV0vR4sJFmK04h2iZpybfbqBY0bX6+BLYWVdV12JLLI+JEFtSnYgR+mWg==", - "dev": true, - "bin": { - "playwright": "cli.js" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/qs": { - "version": "6.11.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.1.tgz", - "integrity": "sha512-0wsrzgTz/kAVIeuxSjnpGC56rzYtr6JT/2BwEvMaPhFIoYa1aGO8LbzuU1R0uUYQkLpWBTOj0l/CLAJB64J6nQ==", - "dev": true, - "dependencies": { - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/semver": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.0.tgz", - "integrity": "sha512-+XC0AD/R7Q2mPSRuy2Id0+CGTZ98+8f+KvwirxOKIEyid+XSx6HbC63p+O4IndTHuX5Z+JxQ0TghCkO5Cg/2HA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, - "node_modules/superagent": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/superagent/-/superagent-8.0.0.tgz", - "integrity": "sha512-iudipXEel+SzlP9y29UBWGDjB+Zzag+eeA1iLosaR2YHBRr1Q1kC29iBrF2zIVD9fqVbpZnXkN/VJmwFMVyNWg==", - "dev": true, - "dependencies": { - "component-emitter": "^1.3.0", - "cookiejar": "^2.1.3", - "debug": "^4.3.4", - "fast-safe-stringify": "^2.1.1", - "form-data": "^4.0.0", - "formidable": "^2.0.1", - "methods": "^1.1.2", - "mime": "2.6.0", - "qs": "^6.10.3", - "readable-stream": "^3.6.0", - "semver": "^7.3.7" - }, - "engines": { - "node": ">=6.4.0 <13 || >=14" - } - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "dev": true - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - } - } -} diff --git a/test/dashboard-e2e/package.json b/test/dashboard-e2e/package.json deleted file mode 100644 index 508bc9e3237..00000000000 --- a/test/dashboard-e2e/package.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "dashboard-e2e-playwright", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": {}, - "keywords": [], - "author": "", - "license": "ISC", - "devDependencies": { - "@playwright/test": "^1.32.3", - "@types/node": "^18.15.13", - "dotenv": "16.0.3", - "superagent": "8.0.0" - } -} diff --git a/test/dashboard-e2e/pages/CreateTestPage.ts b/test/dashboard-e2e/pages/CreateTestPage.ts deleted file mode 100644 index c2d3f141cd6..00000000000 --- a/test/dashboard-e2e/pages/CreateTestPage.ts +++ /dev/null @@ -1,63 +0,0 @@ -import type { Page } from '@playwright/test'; -import { TestDataHandler } from '../data-handlers/test-data-handlers'; -const testDataHandler=new TestDataHandler(); - -export class CreateTestPage{ - readonly page: Page - constructor(page:Page){ - this.page=page - } - - async createTest(testName) { - await this._fillInTestDetails(testName) - await this._clickCreateTestButton() - } - - async selectTestType(testType) { - await this.setSelectionSearch(testType, "testType") - } - - async selectTestSource(contentData) { - if(contentData.type == "git") { - - let repositoryData = contentData.repository - - await this.setSelectionSearch("Git", "testSource") - for (let key in repositoryData) { - var value = repositoryData[key]; - // cy.log(`${key}: ${value}`) - - if(key == 'type') { - continue - } - - await this.setBasicInput(value, key) - } - - }else { - throw 'Type not supported by selectTestSource - extend CreateTestPage' - } - } - - async setBasicInput(value, inputName) { - await this.page.locator(`input[id="test-creation_${inputName}"]`).fill(value) - } - - async setSelectionSearch(value, inputName) { - let firstWord = value.split(' ')[0] //workaround - otherwise search won't find it - - await this.page.locator(`input[id="test-creation_${inputName}"]`).fill(firstWord) - await this.page.click(`div[class*="list-holder"] div[title="${value}"]`) - } - - async _fillInTestDetails(testName) { - const testData = testDataHandler.getTest(testName) - await this.setBasicInput(testData.name, 'name') - await this.selectTestType(testData.type) - await this.selectTestSource(testData.content) - } - - async _clickCreateTestButton() { - await this.page.click('button[data-test="add-a-new-test-create-button"]') - } -} \ No newline at end of file diff --git a/test/dashboard-e2e/pages/MainPage.ts b/test/dashboard-e2e/pages/MainPage.ts deleted file mode 100644 index ba215a70480..00000000000 --- a/test/dashboard-e2e/pages/MainPage.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { Page } from '@playwright/test'; -export class MainPage{ - readonly page: Page - constructor(page:Page){ - this.page=page - } - - async visitMainPage(){ - await this.page.goto(`/apiEndpoint?apiEndpoint=${process.env.API_URL}`); - - await this.page.addInitScript(() => { - window.localStorage.setItem('isGADisabled', '1'); - }); - } - - async openCreateTestDialog() { - await this.page.click('button[data-test="add-a-new-test-btn"]') - } - - async openTestExecutionDetails(realTestName) { - await this.page.locator(`input[data-cy="search-filter"]`).fill(realTestName) - await this.page.click(`xpath=//div[@data-test="tests-list-item" and .//span[text()="${realTestName}"]]`) - } -} \ No newline at end of file diff --git a/test/dashboard-e2e/pages/TestExecutionsPage.ts b/test/dashboard-e2e/pages/TestExecutionsPage.ts deleted file mode 100644 index bbe1572ab4b..00000000000 --- a/test/dashboard-e2e/pages/TestExecutionsPage.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { Page } from '@playwright/test'; - -export class TestExecutionsPage{ - readonly page: Page - constructor(page:Page){ - this.page=page - } - - async runTest() { - await this.page.click('//span[@class="ant-page-header-heading-extra"]//button[.//span]') //TODO: data-test needed - } - - async openExecutionDetails(executionName) { - await this.page.click(`xpath=//tr[.//span[text()="${executionName}"]]`) - } -} \ No newline at end of file diff --git a/test/dashboard-e2e/playwright.config.ts b/test/dashboard-e2e/playwright.config.ts deleted file mode 100644 index 0679a7b51b9..00000000000 --- a/test/dashboard-e2e/playwright.config.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { defineConfig, devices } from '@playwright/test'; -import dotenv from 'dotenv'; - - -/** - * Read environment variables from file. - * https://github.com/motdotla/dotenv - */ -// require('dotenv').config(); - -// Read from default ".env" file. -dotenv.config(); - -/** - * See https://playwright.dev/docs/test-configuration. - */ -export default defineConfig({ - testDir: './tests', - /* Run tests in files in parallel */ - fullyParallel: true, - /* Fail the build on CI if you accidentally left test.only in the source code. */ - forbidOnly: !!process.env.CI, - /* Retry on CI only */ - retries: process.env.CI ? 2 : 0, - /* Opt out of parallel tests on CI. */ - workers: process.env.CI ? 1 : undefined, - /* Reporter to use. See https://playwright.dev/docs/test-reporters */ - reporter: 'html', - /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ - use: { - /* Base URL to use in actions like `await page.goto('/')`. */ - baseURL: process.env.BASE_URL, - - /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ - trace: 'on-first-retry', - }, - - /* Configure projects for major browsers */ - projects: [ - { - name: 'chromium', - use: { ...devices['Desktop Chrome'] }, - }, - ], -}); diff --git a/test/dashboard-e2e/tests/create-test.spec.ts b/test/dashboard-e2e/tests/create-test.spec.ts deleted file mode 100644 index 9ae92590d79..00000000000 --- a/test/dashboard-e2e/tests/create-test.spec.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { test, expect } from '@playwright/test'; - -import { TestDataHandler } from '../data-handlers/test-data-handlers'; -import { ApiHelpers } from '../api/api-helpers'; -import { CommonHelpers } from '../helpers/common-helpers'; -import { MainPage } from '../pages/MainPage'; -import { CreateTestPage } from '../pages/CreateTestPage'; - - -test.beforeEach(async ({ page }) => { - await page.addInitScript(() => { - window.localStorage.setItem('isGADisabled', '1'); - }); -}); - - -const testNames = ['cypress-git', 'k6-git', 'postman-git']; -for (const testName of testNames) { - test(`Creating test for ${testName}`, async ({ page }) => { - const testDataHandler=new TestDataHandler() - const testData = testDataHandler.getTest(testName) - - const apiHelpers=new ApiHelpers(process.env.API_URL) - await apiHelpers.assureTestNotCreated(testData.name) - const mainPage=new MainPage(page) - await mainPage.visitMainPage() - await mainPage.openCreateTestDialog() - - const createTestPage=new CreateTestPage(page) - await createTestPage.createTest(testName) - - - await page.waitForURL(`**/tests/executions/${testData.name}`) - - const createdTestData = await apiHelpers.getTestData(testData.name) - - const commonHelpers=new CommonHelpers() - await commonHelpers.validateTest(testData, createdTestData) - }); -} - - -test.skip(`Create test from File`, async ({ page }) => { - -}); - -test.skip(`Create test from String`, async ({ page }) => { - -}); - -test.skip(`Create test from Git source`, async ({ page }) => { - -}); - -test.skip(`Create test with Labels`, async ({ page }) => { - -}); \ No newline at end of file diff --git a/test/dashboard-e2e/tests/executors.spec.ts b/test/dashboard-e2e/tests/executors.spec.ts deleted file mode 100644 index ba6bfa7e409..00000000000 --- a/test/dashboard-e2e/tests/executors.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { test } from '@playwright/test'; - -test.skip(`Create custom container executor`, async ({ page }) => { - -}); - -test.skip(`Custom container executor - general settings`, async ({ page }) => { - -}); - -test.skip(`Custom container executor - delete executor`, async ({ page }) => { - -}); - -test.skip(`Custom container executor - container image`, async ({ page }) => { - -}); - -test.skip(`Custom container executor - command and arguments`, async ({ page }) => { - -}); - -test.skip(`Custom container executor - definition`, async ({ page }) => { - -}); \ No newline at end of file diff --git a/test/dashboard-e2e/tests/run-test.spec.ts b/test/dashboard-e2e/tests/run-test.spec.ts deleted file mode 100644 index 18c52350949..00000000000 --- a/test/dashboard-e2e/tests/run-test.spec.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { test, expect } from '@playwright/test'; - -import { TestDataHandler } from '../data-handlers/test-data-handlers'; -import { ApiHelpers } from '../api/api-helpers'; -import { MainPage } from '../pages/MainPage'; -import { TestExecutionsPage } from '../pages/TestExecutionsPage'; - -test.beforeEach(async ({ page }) => { - await page.addInitScript(() => { - window.localStorage.setItem('isGADisabled', '1'); - }); -}); - -const testNames = ['cypress-git-created', 'k6-git-created', 'postman-git-created']; -for (const testName of testNames) { - test(`Run test ${testName}`, async ({ page }) => { - const testDataHandler=new TestDataHandler() - const testData = testDataHandler.getTest(testName) - const realTestName = testData.name - - const apiHelpers=new ApiHelpers(process.env.API_URL) - await apiHelpers.assureTestCreated(testData, false) - const lastExecutionNumber = await apiHelpers.getLastExecutionNumber(realTestName) - - const mainPage=new MainPage(page) - await mainPage.visitMainPage() - await mainPage.openTestExecutionDetails(realTestName) - - const testExecutionsPage=new TestExecutionsPage(page) - await testExecutionsPage.runTest() - - const currentExecutionNumber = lastExecutionNumber+1 - const executionName = `${realTestName}-${currentExecutionNumber}` - - await testExecutionsPage.openExecutionDetails(executionName) //openLatestExecutionDetails? - - - await apiHelpers.abortTest(realTestName, executionName) //abort test not to waste compute resources -}); -} \ No newline at end of file diff --git a/test/dashboard-e2e/tests/test-settings.spec.ts b/test/dashboard-e2e/tests/test-settings.spec.ts deleted file mode 100644 index f379203522d..00000000000 --- a/test/dashboard-e2e/tests/test-settings.spec.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { test } from '@playwright/test'; - -test.skip(`Delete test`, async ({ page }) => { - -}); - -test.skip(`Edit test`, async ({ page }) => { - -}); - -test.skip(`Test pre-run script`, async ({ page }) => { - -}); - -test.skip(`Test - variables and secrets`, async ({ page }) => { - -}); - -test.skip(`Test - arguments`, async ({ page }) => { - -}); - -test.skip(`Test - scheduling`, async ({ page }) => { - -}); - -test.skip(`Test - definition`, async ({ page }) => { - -}); \ No newline at end of file diff --git a/test/dashboard-e2e/tests/test-sources.spec.ts b/test/dashboard-e2e/tests/test-sources.spec.ts deleted file mode 100644 index bb1ec12b395..00000000000 --- a/test/dashboard-e2e/tests/test-sources.spec.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { test } from '@playwright/test'; - -test.skip(`Create test source`, async ({ page }) => { - -}); - -test.skip(`Edit test source`, async ({ page }) => { - -}); - -test.skip(`Delete test source`, async ({ page }) => { - -}); - -test.skip(`Test source - definition`, async ({ page }) => { - -}); \ No newline at end of file diff --git a/test/dashboard-e2e/tests/tests-dashboard.spec.ts b/test/dashboard-e2e/tests/tests-dashboard.spec.ts deleted file mode 100644 index 7e0d7910798..00000000000 --- a/test/dashboard-e2e/tests/tests-dashboard.spec.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { test } from '@playwright/test'; - -test.skip(`Tests dashboard - test "item" `, async ({ page }) => { - -}); - -test.skip(`Tests dashboard - filters`, async ({ page }) => { - -}); \ No newline at end of file diff --git a/test/dashboard-e2e/tests/testsuite-settings.spec.ts b/test/dashboard-e2e/tests/testsuite-settings.spec.ts deleted file mode 100644 index 99617d97318..00000000000 --- a/test/dashboard-e2e/tests/testsuite-settings.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { test } from '@playwright/test'; - -test.skip(`Delete test suite`, async ({ page }) => { - -}); - -test.skip(`Test suite - edit tests`, async ({ page }) => { - -}); - -test.skip(`Test suite - edit label`, async ({ page }) => { - -}); - -test.skip(`Test suite - variables`, async ({ page }) => { - -}); - -test.skip(`Test suite - scheduling`, async ({ page }) => { - -}); - -test.skip(`Test suite - definition`, async ({ page }) => { - -}); \ No newline at end of file diff --git a/test/dashboard-e2e/tests/testsuites-dashboard.spec.ts b/test/dashboard-e2e/tests/testsuites-dashboard.spec.ts deleted file mode 100644 index 179fc66cb57..00000000000 --- a/test/dashboard-e2e/tests/testsuites-dashboard.spec.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { test } from '@playwright/test'; - -test.skip(`Test Suites dashboard - test "item" `, async ({ page }) => { - -}); - -test.skip(`Test Suites dashboard - filters`, async ({ page }) => { - -}); \ No newline at end of file diff --git a/test/dashboard-e2e/tests/triggers.spec.ts b/test/dashboard-e2e/tests/triggers.spec.ts deleted file mode 100644 index 6e24aca885d..00000000000 --- a/test/dashboard-e2e/tests/triggers.spec.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { test } from '@playwright/test'; - -test.skip(`Create test trigger`, async ({ page }) => { - -}); - -test.skip(`Edit test trigger`, async ({ page }) => { - -}); - -test.skip(`Delete test trigger`, async ({ page }) => { - -}); \ No newline at end of file