diff --git a/README.md b/README.md index 95c8154..cff65e8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Ecommerce demo store - Playwright (javascript) tests +# Ecommerce-demo-test-playwright -Automated end-to-end tests for Ecommerce demo store using [Playwright](https://playwright.dev/). +Automated end-to-end tests for Ecommerce Demo store using [Playwright](https://playwright.dev/). --- @@ -63,9 +63,7 @@ reporter: [ After your tests complete and the report is generated in `playwright-report`, upload it to Testdino: -```sh -npx --yes tdpw ./playwright-report --token="YOUR_TESTDINO_API_KEY" --upload-html -``` + Replace the token above with your own Testdino API key. @@ -82,11 +80,7 @@ npx tdpw --help Add the following step to your workflow after tests and report generation: -```yaml -- name: Send Testdino report - run: | - npx --yes tdpw ./playwright-report --token="YOUR_TESTDINO_API_KEY" --upload-html -``` + Ensure your API key is correctly placed in the command. @@ -106,4 +100,3 @@ Pull requests and issues are welcome! ## License -MIT diff --git a/__screenshots__/visual.spec.js-snapshots/github-login-changed-chromium-darwin.png b/__screenshots__/visual.spec.js-snapshots/github-login-changed-chromium-darwin.png new file mode 100644 index 0000000..81b5cb7 Binary files /dev/null and b/__screenshots__/visual.spec.js-snapshots/github-login-changed-chromium-darwin.png differ diff --git a/__screenshots__/visual.spec.js-snapshots/github-login-chromium-darwin.png b/__screenshots__/visual.spec.js-snapshots/github-login-chromium-darwin.png new file mode 100644 index 0000000..568dbbb Binary files /dev/null and b/__screenshots__/visual.spec.js-snapshots/github-login-chromium-darwin.png differ diff --git a/package-lock.json b/package-lock.json index 8e94191..008f3b2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,13 +10,66 @@ "license": "ISC", "dependencies": { "dotenv": "^17.2.1", - "playwright": "^1.55.0" + "playwright": "^1.55.0", + "testdino-mcp": "file:testdino-mcp-1.0.6.tgz" }, "devDependencies": { "@playwright/test": "^1.54.1", "@types/node": "^24.1.0" } }, + "node_modules/@hono/node-server": { + "version": "1.19.9", + "resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-1.19.9.tgz", + "integrity": "sha512-vHL6w3ecZsky+8P5MD+eFfaGTyCeOHUIFYMGpQGbrBTSmNNoxv0if69rEZ5giu36weC5saFuznL411gRX7bJDw==", + "license": "MIT", + "engines": { + "node": ">=18.14.1" + }, + "peerDependencies": { + "hono": "^4" + } + }, + "node_modules/@modelcontextprotocol/sdk": { + "version": "1.26.0", + "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.26.0.tgz", + "integrity": "sha512-Y5RmPncpiDtTXDbLKswIJzTqu2hyBKxTNsgKqKclDbhIgg1wgtf1fRuvxgTnRfcnxtvvgbIEcqUOzZrJ6iSReg==", + "license": "MIT", + "dependencies": { + "@hono/node-server": "^1.19.9", + "ajv": "^8.17.1", + "ajv-formats": "^3.0.1", + "content-type": "^1.0.5", + "cors": "^2.8.5", + "cross-spawn": "^7.0.5", + "eventsource": "^3.0.2", + "eventsource-parser": "^3.0.0", + "express": "^5.2.1", + "express-rate-limit": "^8.2.1", + "hono": "^4.11.4", + "jose": "^6.1.3", + "json-schema-typed": "^8.0.2", + "pkce-challenge": "^5.0.0", + "raw-body": "^3.0.0", + "zod": "^3.25 || ^4.0", + "zod-to-json-schema": "^3.25.1" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@cfworker/json-schema": "^4.1.1", + "zod": "^3.25 || ^4.0" + }, + "peerDependenciesMeta": { + "@cfworker/json-schema": { + "optional": true + }, + "zod": { + "optional": false + } + } + }, "node_modules/@playwright/test": { "version": "1.55.0", "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.55.0.tgz", @@ -43,10 +96,240 @@ "undici-types": "~7.10.0" } }, + "node_modules/accepts": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", + "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", + "license": "MIT", + "dependencies": { + "mime-types": "^3.0.0", + "negotiator": "^1.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/accepts/node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/accepts/node_modules/mime-types": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz", + "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==", + "license": "MIT", + "dependencies": { + "mime-db": "^1.54.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/ajv": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.18.0.tgz", + "integrity": "sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-formats": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz", + "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", + "license": "MIT", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/body-parser": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.2.tgz", + "integrity": "sha512-oP5VkATKlNwcgvxi0vM0p/D3n2C3EReYVX+DNYs5TjZFn/oQt2j+4sVJtSMr18pdRr8wjTcBl6LoV+FUwzPmNA==", + "license": "MIT", + "dependencies": { + "bytes": "^3.1.2", + "content-type": "^1.0.5", + "debug": "^4.4.3", + "http-errors": "^2.0.0", + "iconv-lite": "^0.7.0", + "on-finished": "^2.4.1", + "qs": "^6.14.1", + "raw-body": "^3.0.1", + "type-is": "^2.0.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/content-disposition": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.1.tgz", + "integrity": "sha512-oIXISMynqSqm241k6kcQ5UwttDILMK4BiurCfGEREw6+X9jkkpEe5T9FZaApyLGGOnFuyMWZpdolTXMtvEJ08Q==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz", + "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==", + "license": "MIT", + "engines": { + "node": ">=6.6.0" + } + }, + "node_modules/cors": { + "version": "2.8.6", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.6.tgz", + "integrity": "sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw==", + "license": "MIT", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/dotenv": { - "version": "17.2.1", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.2.1.tgz", - "integrity": "sha512-kQhDYKZecqnM0fCnzI5eIv5L4cAe/iRI+HqMbO/hbRdTAeXDG+M9FjipUxNfbARuEg4iHIbhnhs78BCHNbSxEQ==", + "version": "17.3.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.3.1.tgz", + "integrity": "sha512-IO8C/dzEb6O3F9/twg6ZLXz164a2fhTnEWb95H23Dm4OuN+92NmEAlTrupP9VW6Jm3sO26tQlqyvyi4CsnY9GA==", "license": "BSD-2-Clause", "engines": { "node": ">=12" @@ -55,6 +338,248 @@ "url": "https://dotenvx.com" } }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/eventsource": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-3.0.7.tgz", + "integrity": "sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA==", + "license": "MIT", + "dependencies": { + "eventsource-parser": "^3.0.1" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/eventsource-parser": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/eventsource-parser/-/eventsource-parser-3.0.6.tgz", + "integrity": "sha512-Vo1ab+QXPzZ4tCa8SwIHJFaSzy4R6SHf7BY79rFBDf0idraZWAkYrDjDj8uWaSm3S2TK+hJ7/t1CEmZ7jXw+pg==", + "license": "MIT", + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/express": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz", + "integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==", + "license": "MIT", + "dependencies": { + "accepts": "^2.0.0", + "body-parser": "^2.2.1", + "content-disposition": "^1.0.0", + "content-type": "^1.0.5", + "cookie": "^0.7.1", + "cookie-signature": "^1.2.1", + "debug": "^4.4.0", + "depd": "^2.0.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "finalhandler": "^2.1.0", + "fresh": "^2.0.0", + "http-errors": "^2.0.0", + "merge-descriptors": "^2.0.0", + "mime-types": "^3.0.0", + "on-finished": "^2.4.1", + "once": "^1.4.0", + "parseurl": "^1.3.3", + "proxy-addr": "^2.0.7", + "qs": "^6.14.0", + "range-parser": "^1.2.1", + "router": "^2.2.0", + "send": "^1.1.0", + "serve-static": "^2.2.0", + "statuses": "^2.0.1", + "type-is": "^2.0.1", + "vary": "^1.1.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/express-rate-limit": { + "version": "8.2.1", + "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-8.2.1.tgz", + "integrity": "sha512-PCZEIEIxqwhzw4KF0n7QF4QqruVTcF73O5kFKUnGOyjbCCgizBBiFaYpd/fnBLUMPw/BWw9OsiN7GgrNYr7j6g==", + "license": "MIT", + "dependencies": { + "ip-address": "10.0.1" + }, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/express-rate-limit" + }, + "peerDependencies": { + "express": ">= 4.11" + } + }, + "node_modules/express/node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express/node_modules/mime-types": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz", + "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==", + "license": "MIT", + "dependencies": { + "mime-db": "^1.54.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "license": "MIT" + }, + "node_modules/fast-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.0.tgz", + "integrity": "sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/finalhandler": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.1.tgz", + "integrity": "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "on-finished": "^2.4.1", + "parseurl": "^1.3.3", + "statuses": "^2.0.1" + }, + "engines": { + "node": ">= 18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", + "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/fsevents": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", @@ -69,6 +594,314 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hono": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/hono/-/hono-4.12.2.tgz", + "integrity": "sha512-gJnaDHXKDayjt8ue0n8Gs0A007yKXj4Xzb8+cNjZeYsSzzwKc0Lr+OZgYwVfB0pHfUs17EPoLvrOsEaJ9mj+Tg==", + "license": "MIT", + "engines": { + "node": ">=16.9.0" + } + }, + "node_modules/http-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", + "license": "MIT", + "dependencies": { + "depd": "~2.0.0", + "inherits": "~2.0.4", + "setprototypeof": "~1.2.0", + "statuses": "~2.0.2", + "toidentifier": "~1.0.1" + }, + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/iconv-lite": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz", + "integrity": "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ip-address": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.0.1.tgz", + "integrity": "sha512-NWv9YLW4PoW2B7xtzaS3NCot75m6nK7Icdv0o3lfMceJVRfSoQwqD4wEH5rLwoKJwUiZ/rfpiVBhnaF0FK4HoA==", + "license": "MIT", + "engines": { + "node": ">= 12" + } + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-promise": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", + "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", + "license": "MIT" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "license": "ISC" + }, + "node_modules/jose": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/jose/-/jose-6.1.3.tgz", + "integrity": "sha512-0TpaTfihd4QMNwrz/ob2Bp7X04yuxJkjRGi4aKmOqwhov54i6u79oCv7T+C7lo70MKH6BesI3vscD1yb/yzKXQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "license": "MIT" + }, + "node_modules/json-schema-typed": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/json-schema-typed/-/json-schema-typed-8.0.2.tgz", + "integrity": "sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA==", + "license": "BSD-2-Clause" + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/media-typer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz", + "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/merge-descriptors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz", + "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/negotiator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", + "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "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==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-to-regexp": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.3.0.tgz", + "integrity": "sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/pkce-challenge": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/pkce-challenge/-/pkce-challenge-5.0.1.tgz", + "integrity": "sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ==", + "license": "MIT", + "engines": { + "node": ">=16.20.0" + } + }, "node_modules/playwright": { "version": "1.55.0", "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.55.0.tgz", @@ -99,12 +932,392 @@ "node": ">=18" } }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/qs": { + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.0.tgz", + "integrity": "sha512-mAZTtNCeetKMH+pSjrb76NAM8V9a05I9aBZOHztWy/UqcJdQYNsf59vrRKWnojAT9Y+GbIvoTBC++CPHqpDBhQ==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.2.tgz", + "integrity": "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==", + "license": "MIT", + "dependencies": { + "bytes": "~3.1.2", + "http-errors": "~2.0.1", + "iconv-lite": "~0.7.0", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/router": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz", + "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "depd": "^2.0.0", + "is-promise": "^4.0.0", + "parseurl": "^1.3.3", + "path-to-regexp": "^8.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/send": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/send/-/send-1.2.1.tgz", + "integrity": "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.3", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "fresh": "^2.0.0", + "http-errors": "^2.0.1", + "mime-types": "^3.0.2", + "ms": "^2.1.3", + "on-finished": "^2.4.1", + "range-parser": "^1.2.1", + "statuses": "^2.0.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/send/node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/send/node_modules/mime-types": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz", + "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==", + "license": "MIT", + "dependencies": { + "mime-db": "^1.54.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/serve-static": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.1.tgz", + "integrity": "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==", + "license": "MIT", + "dependencies": { + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "parseurl": "^1.3.3", + "send": "^1.2.0" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/testdino-mcp": { + "version": "1.0.6", + "resolved": "file:testdino-mcp-1.0.6.tgz", + "integrity": "sha512-a62WW0dB33rxZ42vsMYO0RT5pKJK7ZDlscSiu9yDnusjt0O/esdyvYW+LobYmvXWSA7N6UAuTUzxNfnoDCeIcQ==", + "dependencies": { + "@modelcontextprotocol/sdk": "^1.25.1" + }, + "bin": { + "testdino-mcp": "dist/index.js" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/type-is": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz", + "integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==", + "license": "MIT", + "dependencies": { + "content-type": "^1.0.5", + "media-typer": "^1.1.0", + "mime-types": "^3.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/type-is/node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/type-is/node_modules/mime-types": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz", + "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==", + "license": "MIT", + "dependencies": { + "mime-db": "^1.54.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, "node_modules/undici-types": { "version": "7.10.0", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.10.0.tgz", "integrity": "sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==", "dev": true, "license": "MIT" + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "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==", + "license": "ISC" + }, + "node_modules/zod": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.3.6.tgz", + "integrity": "sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, + "node_modules/zod-to-json-schema": { + "version": "3.25.1", + "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.25.1.tgz", + "integrity": "sha512-pM/SU9d3YAggzi6MtR4h7ruuQlqKtad8e9S0fmxcMi+ueAK5Korys/aWcV9LIIHTVbj01NdzxcnXSN+O74ZIVA==", + "license": "ISC", + "peerDependencies": { + "zod": "^3.25 || ^4" + } } } } diff --git a/package.json b/package.json index 4d7a316..1cbd2da 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ }, "dependencies": { "dotenv": "^17.2.1", - "playwright": "^1.55.0" + "playwright": "^1.55.0", + "testdino-mcp": "file:testdino-mcp-1.0.6.tgz" } } diff --git a/pages/LoginPage.js b/pages/LoginPage.js index 22e010d..b27d956 100644 --- a/pages/LoginPage.js +++ b/pages/LoginPage.js @@ -2,7 +2,7 @@ import BasePage from './BasePage.js'; import { expect } from '@playwright/test'; class LoginPage extends BasePage{ - + /** * @param {import('@playwright/test').Page} page */ @@ -23,6 +23,7 @@ class LoginPage extends BasePage{ successSignInMessage: `Logged in successfully`, } + async navigateToLoginPage() { await this.navigateTo('/'); } @@ -49,6 +50,11 @@ class LoginPage extends BasePage{ async clickOnUserProfileIcon() { await this.page.locator(this.locators.userIcon).click(); + // Wait for dropdown menu to appear + // await this.page.waitForSelector(this.locators.logoutButton, { + // state: 'visible', + // timeout: 5000 + // }); } async assertLoginPage() { @@ -66,7 +72,9 @@ class LoginPage extends BasePage{ } async clickOnLogoutButton() { - await this.page.locator(this.locators.logoutButton).click(); + const logoutBtn = this.page.locator(this.locators.logoutButton); + await logoutBtn.waitFor({ state: 'visible', timeout: 10000 }); + await logoutBtn.click(); } async validateSignInPage() { await expect(this.getLoginPageTitle()).toBeVisible(); diff --git a/testdino-mcp-1.0.6.tgz b/testdino-mcp-1.0.6.tgz new file mode 100644 index 0000000..464a81e Binary files /dev/null and b/testdino-mcp-1.0.6.tgz differ diff --git a/tests/cart_checkout.spec.js b/tests/cart_checkout.spec.js index 123f880..7b86928 100644 --- a/tests/cart_checkout.spec.js +++ b/tests/cart_checkout.spec.js @@ -9,169 +9,692 @@ test.beforeEach(async ({ page }) => { await page.goto('/'); }); -test.describe('Cart Module', () => { - test.describe('Product Removal', () => { - test('Verify that user is able to delete selected product from cart ',{tag: '@ios'}, async () => { - const productName = 'GoPro HERO10 Black'; - await allPages.inventoryPage.clickOnAllProductsLink(); - await allPages.inventoryPage.searchProduct(productName); - await allPages.inventoryPage.verifyProductTitleVisible(productName); - await allPages.inventoryPage.clickOnAddToCartIcon(); - - await allPages.cartPage.clickOnCartIcon(); - await allPages.cartPage.verifyCartItemVisible(productName); - await allPages.cartPage.clickOnDeleteProductIcon(); - await allPages.cartPage.verifyCartItemDeleted(productName); - - }); - }); -}); +/* ---------- Helpers ---------- */ + +async function login( + username = process.env.USERNAME, + password = process.env.PASSWORD +) { + await allPages.loginPage.clickOnUserProfileIcon(); + await allPages.loginPage.validateSignInPage(); + // await allPages.loginPage.login(username, password); +} + +/* ---------- FLAKY TESTS (fail on 1st run + 1st retry, pass on 2nd retry) ---------- */ -test.describe('Orders Module', () => { - test.describe('Order Cancellation', () => { - test('Verify new user views and cancels an order in my orders ',{tag: '@chromium'}, async () => { - const email = `test+${Date.now()}@test.com`; - const firstName = 'Test'; - const lastName = 'User'; - let productName = `Rode NT1-A Condenser Mic`; - - await test.step('Verify that user can register successfully', async () => { - // await allPages.loginPage.clickOnUserProfileIcon(); - // await allPages.loginPage.validateSignInPage(); - // await allPages.loginPage.clickOnSignupLink(); - // await allPages.signupPage.assertSignupPage(); - // await allPages.signupPage.signup(firstName, lastName, email, process.env.PASSWORD); - // await allPages.signupPage.verifySuccessSignUp(); +test.describe('Flaky tests (pass on 2nd retry)', () => { + test.describe.configure({ retries: 2 }); + + test( + 'Verify that user can login and logout successfully', + { + tag: '@chromium', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'Login' }, + { type: 'testdino:link', description: 'https://jira.example.com/LOGIN-001' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Flaky test: login and logout on Chromium' } + ] + }, + async ({}, testInfo) => { + const start = Date.now(); + await login(); + if (testInfo.retry < 2) { + throw new Error(`Flaky: failing on attempt ${testInfo.retry + 1}, will pass on 2nd retry`); + } + await expect(true).toBeTruthy(); + const flowTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'flow-time', + value: flowTime, + unit: 'ms', + threshold: 5000, + }), }); + } + ); - await test.step('Navigate to All Products and add view details of a random product', async () => { - await allPages.homePage.clickAllProductsNav(); - productName = await allPages.allProductsPage.getNthProductName(1); - await allPages.allProductsPage.clickNthProduct(1); - await allPages.productDetailsPage.clickAddToCartButton(); + test( + 'User searches products and views result (Searchbox)', + { + tag: '@firefox', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'Search' }, + { type: 'testdino:link', description: 'https://jira.example.com/SEARCH-001' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Flaky test: search products on Firefox' } + ] + }, + async ({}, testInfo) => { + const start = Date.now(); + await login(); + if (testInfo.retry < 2) { + throw new Error(`Flaky: failing on attempt ${testInfo.retry + 1}, will pass on 2nd retry`); + } + await expect(true).toBeTruthy(); + const flowTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'flow-time', + value: flowTime, + unit: 'ms', + threshold: 5000, + }), }); + } + ); - await test.step('Add product to cart, add new address and checkout', async () => { - await allPages.productDetailsPage.clickCartIcon(); - // await allPages.cartPage.assertYourCartTitle(); - // await expect(allPages.cartPage.getCartItemName()).toContainText(productName, { timeout: 10000 }); - // await allPages.cartPage.clickOnCheckoutButton(); - // await allPages.checkoutPage.verifyCheckoutTitle(); - // await allPages.checkoutPage.fillShippingAddress( - // firstName, email, 'New York', 'New York', '123 Main St', '10001', 'United States' - // ); - // await allPages.checkoutPage.clickSaveAddressButton(); - // await allPages.checkoutPage.assertAddressAddedToast(); - // }); - - // await test.step('Complete order and verify in my orders', async () => { - // await allPages.checkoutPage.selectCashOnDelivery(); - // await allPages.checkoutPage.verifyCheckoutTitle(); - // await allPages.checkoutPage.clickOnPlaceOrder(); - // await allPages.checkoutPage.verifyOrderPlacedSuccessfully(); - // await allPages.inventoryPage.clickOnContinueShopping(); - - // await allPages.loginPage.clickOnUserProfileIcon(); - // await allPages.orderPage.clickOnMyOrdersTab(); - // await allPages.orderPage.clickCancelOrderButton(); - // await allPages.orderPage.confirmCancellation(); + test( + 'User navigates through product categories (Product page)', + { + tag: '@webkit', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'Products' }, + { type: 'testdino:link', description: 'https://jira.example.com/PRODUCTS-001' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Flaky test: product categories on WebKit' } + ] + }, + async ({}, testInfo) => { + const start = Date.now(); + await login(); + if (testInfo.retry < 2) { + throw new Error(`Flaky: failing on attempt ${testInfo.retry + 1}, will pass on 2nd retry`); + } + await expect(true).toBeTruthy(); + const flowTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'flow-time', + value: flowTime, + unit: 'ms', + threshold: 5000, + }), }); - }); - }); + } + ); }); -test.describe('User Journey', () => { - test.describe('Multiple Order Placement', () => { - test('Verify That a New User Can Successfully Complete the Journey from Registration to a Multiple Order Placement ',{tag: '@chromium'}, async () => { - const email = `test+${Date.now()}@test.com`; - const firstName = 'Test'; - const lastName = 'User'; - - await test.step('Verify that user can register successfully', async () => { - // await allPages.loginPage.clickOnUserProfileIcon(); - // await allPages.loginPage.validateSignInPage(); - // await allPages.loginPage.clickOnSignupLink(); - // await allPages.signupPage.assertSignupPage(); - // await allPages.signupPage.signup(firstName, lastName, email, process.env.PASSWORD); - // await allPages.signupPage.verifySuccessSignUp(); - }); - await test.step('Navigate product details and validate tabs', async () => { - await allPages.homePage.clickOnShopNowButton(); - // await allPages.allProductsPage.assertAllProductsTitle(); - // await allPages.allProductsPage.clickNthProduct(1); - // await allPages.productDetailsPage.clickOnReviewsTab(); - // await allPages.productDetailsPage.assertReviewsTab(); - // await allPages.productDetailsPage.clickOnAdditionalInfoTab(); - // await allPages.productDetailsPage.assertAdditionalInfoTab(); - }); +/* ---------- STABLE TESTS (NO RANDOM FAILURES) ---------- */ - await test.step('Place first order', async () => { - // await allPages.productDetailsPage.clickAddToCartButton(); - // await allPages.productDetailsPage.clickCartIcon(); - // await allPages.cartPage.clickIncreaseQuantityButton(); - // await allPages.cartPage.clickOnCheckoutButton(); - // await allPages.checkoutPage.verifyCheckoutTitle(); - // await allPages.checkoutPage.selectCashOnDelivery(); - // await allPages.checkoutPage.fillShippingAddress( - // process.env.SFIRST_NAME, - // email, - // process.env.SCITY, - // process.env.SSTATE, - // process.env.SSTREET_ADD, - // process.env.SZIP_CODE, - // process.env.SCOUNTRY - // ); - // await allPages.checkoutPage.clickSaveAddressButton(); - // await allPages.checkoutPage.clickOnPlaceOrder(); - // await allPages.checkoutPage.verifyOrderPlacedSuccessfully(); - // await allPages.checkoutPage.clickOnContinueShoppingButton(); - }); +test( + 'Verify that all the navbar are working properly', + { + tag: '@webkit', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'Navbar' }, + { type: 'testdino:link', description: 'https://jira.example.com/NAVBAR-001' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Navbar functionality on WebKit' } + ] + }, + async () => { + const start = Date.now(); + await login(); + await expect(true).toBeTruthy(); + const flowTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'flow-time', + value: flowTime, + unit: 'ms', + threshold: 5000, + }), + }); + } +); - await test.step('Place second order using existing address', async () => { - // await allPages.homePage.clickOnShopNowButton(); - // await allPages.allProductsPage.assertAllProductsTitle(); - // await allPages.allProductsPage.clickNthProduct(1); - // await allPages.productDetailsPage.clickAddToCartButton(); - // await allPages.productDetailsPage.clickCartIcon(); - // await allPages.cartPage.clickOnCheckoutButton(); - // await allPages.checkoutPage.verifyCheckoutTitle(); - // await allPages.checkoutPage.selectCashOnDelivery(); - // await allPages.checkoutPage.clickOnPlaceOrder(); - // await allPages.checkoutPage.verifyOrderPlacedSuccessfully(); - }); +test( + 'Verify that user can edit and delete a product review', + { + tag: '@chromium', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'Review' }, + { type: 'testdino:link', description: 'https://jira.example.com/REVIEW-001' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Edit and delete product review on Chromium' } + ] + }, + async () => { + const start = Date.now(); + await login(); + await expect(true).toBeTruthy(); + const flowTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'flow-time', + value: flowTime, + unit: 'ms', + threshold: 5000, + }), }); - }); -}); + } +); -test.describe('Authentication', () => { - test.describe('Signup & Login', () => { - test('Verify that the new user is able to Sign Up, Log In, and Navigate to the Home Page Successfully ',{tag: '@chromium'}, async () => { - const email = `test+${Date.now()}@test.com`; - const firstName = 'Test'; - const lastName = 'User'; - - // await allPages.loginPage.clickOnUserProfileIcon(); - // await allPages.loginPage.validateSignInPage(); - // await allPages.loginPage.clickOnSignupLink(); - // await allPages.signupPage.assertSignupPage(); - // await allPages.signupPage.signup(firstName, lastName, email, process.env.PASSWORD); - // await allPages.signupPage.verifySuccessSignUp(); - - // await allPages.loginPage.validateSignInPage(); - // await allPages.loginPage.login(email, process.env.PASSWORD); - // await allPages.loginPage.verifySuccessSignIn(); - // await expect(allPages.homePage.getHomeNav()).toBeVisible({ timeout: 30000 }); - }); - }); -}); +test( + 'Verify that User Can Complete the Journey from Login to Order Placement', + { + tag: '@chromium', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'Order' }, + { type: 'testdino:link', description: 'https://jira.example.com/ORDER-001' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Login to order placement journey on Chromium' } + ] + }, + async () => { + const start = Date.now(); + await login(); + await expect(true).toBeTruthy(); + const flowTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'flow-time', + value: flowTime, + unit: 'ms', + threshold: 5000, + }), + }); + } +); -test.describe('User Profile', () => { - test.describe('Personal Information', () => { - test('Verify that user can update personal information ',{tag: '@firefox'}, async () => { - await allPages.userPage.clickOnUserProfileIcon(); - // await allPages.userPage.updatePersonalInfo(); - // await allPages.userPage.verifyPersonalInfoUpdated(); +test( + 'Verify that user can filter products by price range', + { + tag: '@firefox', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'Filter' }, + { type: 'testdino:link', description: 'https://jira.example.com/FILTER-001' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Filter products by price on Firefox' } + ] + }, + async () => { + const start = Date.now(); + await expect(true).toBeTruthy(); + const flowTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'flow-time', + value: flowTime, + unit: 'ms', + threshold: 5000, + }), }); - }); -}); + } +); + +test( + 'Verify if user can add product to wishlist, move to cart and checkout', + { + tag: '@firefox', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'Wishlist' }, + { type: 'testdino:link', description: 'https://jira.example.com/WISHLIST-001' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Wishlist to cart and checkout on Firefox' } + ] + }, + async () => { + const start = Date.now(); + await login(); + await expect(true).toBeTruthy(); + const flowTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'flow-time', + value: flowTime, + unit: 'ms', + threshold: 5000, + }), + }); + } +); + +test( + 'Verify that user is able to submit a product review', + { + tag: '@webkit', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'Review' }, + { type: 'testdino:link', description: 'https://jira.example.com/REVIEW-002' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Submit product review on WebKit' } + ] + }, + async () => { + const start = Date.now(); + await login(); + await expect(true).toBeTruthy(); + const flowTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'flow-time', + value: flowTime, + unit: 'ms', + threshold: 5000, + }), + }); + } +); + +test( + 'Verify that all the navbar are working properly (Navbar)', + { + tag: '@webkit', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'Navbar' }, + { type: 'testdino:link', description: 'https://jira.example.com/NAVBAR-002' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Navbar (Navbar) on WebKit' } + ] + }, + async () => { + const start = Date.now(); + await login(); + await expect(true).toBeTruthy(); + const flowTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'flow-time', + value: flowTime, + unit: 'ms', + threshold: 5000, + }), + }); + } +); + +test( + 'Verify that user can edit and delete a product review (Single review)', + { + tag: '@chromium', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'Review' }, + { type: 'testdino:link', description: 'https://jira.example.com/REVIEW-003' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Edit and delete review (Single review) on Chromium' } + ] + }, + async () => { + const start = Date.now(); + await login(); + await expect(true).toBeTruthy(); + const flowTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'flow-time', + value: flowTime, + unit: 'ms', + threshold: 5000, + }), + }); + } +); + +test( + 'Verify that User Can Complete the Journey from Login to Order Placement (Single order)', + { + tag: '@chromium', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'Order' }, + { type: 'testdino:link', description: 'https://jira.example.com/ORDER-002' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Login to order (Single order) on Chromium' } + ] + }, + async () => { + const start = Date.now(); + await login(); + await expect(true).toBeTruthy(); + const flowTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'flow-time', + value: flowTime, + unit: 'ms', + threshold: 5000, + }), + }); + } +); + +test( + 'Verify that user can filter products by price range (Price page', + { + tag: '@firefox', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'Filter' }, + { type: 'testdino:link', description: 'https://jira.example.com/FILTER-002' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Filter by price (Price page) on Firefox' } + ] + }, + async () => { + const start = Date.now(); + await expect(true).toBeTruthy(); + const flowTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'flow-time', + value: flowTime, + unit: 'ms', + threshold: 5000, + }), + }); + } +); + +test( + 'Verify if user can add product to wishlist, move to cart(Checkout page)', + { + tag: '@firefox', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'Wishlist' }, + { type: 'testdino:link', description: 'https://jira.example.com/WISHLIST-002' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Wishlist to cart (Checkout page) on Firefox' } + ] + }, + async () => { + const start = Date.now(); + await login(); + await expect(true).toBeTruthy(); + const flowTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'flow-time', + value: flowTime, + unit: 'ms', + threshold: 5000, + }), + }); + } +); + +test( + 'Verify that user is able to submit a product review (Review)', + { + tag: '@webkit', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'Review' }, + { type: 'testdino:link', description: 'https://jira.example.com/REVIEW-004' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Submit product review (Review) on WebKit' } + ] + }, + async () => { + const start = Date.now(); + await login(); + await expect(true).toBeTruthy(); + const flowTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'flow-time', + value: flowTime, + unit: 'ms', + threshold: 5000, + }), + }); + } +); + +test( + 'Verify that user can update cart quantity and verify total price', + { + tag: '@chromium', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'Cart' }, + { type: 'testdino:link', description: 'https://jira.example.com/CART-001' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Update cart quantity and total price on Chromium' } + ] + }, + async () => { + const start = Date.now(); + await login(); + // await allPages.homePage.clickOnShopNowButton(); + // await allPages.allProductsPage.clickNthProduct(1); + // await allPages.productDetailsPage.clickAddToCartButton(); + // await allPages.cartPage.clickOnCartIcon(); + // await allPages.cartPage.clickIncreaseQuantityButton(); + // await allPages.cartPage.verifyTotalPriceUpdated(); + await expect(true).toBeTruthy(); + const flowTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'flow-time', + value: flowTime, + unit: 'ms', + threshold: 5000, + }), + }); + } +); + +test( + 'Verify that user can view order history and order detail (Order page)', + { + tag: '@firefox', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'Order' }, + { type: 'testdino:link', description: 'https://jira.example.com/ORDER-003' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Order history and order detail (Order page) on Firefox' } + ] + }, + async () => { + const start = Date.now(); + await login(); + // await allPages.loginPage.clickOnUserProfileIcon(); + // await allPages.orderPage.clickOnMyOrdersTab(); + // await allPages.orderPage.verifyOrdersListVisible(); + // await allPages.orderPage.clickOnFirstOrder(); + // await allPages.orderDetailsPage.verifyOrderDetailsDisplayed(); + await expect(true).toBeTruthy(); + const flowTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'flow-time', + value: flowTime, + unit: 'ms', + threshold: 5000, + }), + }); + } +); + +test( + 'Verify that user can update cart quantity and verify total price (Pricing)', + { + tag: '@chromium', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'Cart' }, + { type: 'testdino:link', description: 'https://jira.example.com/CART-002' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Cart quantity and total price (Pricing) on Chromium' } + ] + }, + async () => { + const start = Date.now(); + await login(); + // await allPages.homePage.clickOnShopNowButton(); + // await allPages.allProductsPage.clickNthProduct(1); + // await allPages.productDetailsPage.clickAddToCartButton(); + // await allPages.cartPage.clickOnCartIcon(); + // await allPages.cartPage.clickIncreaseQuantityButton(); + // await allPages.cartPage.verifyTotalPriceUpdated(); + await expect(true).toBeTruthy(); + const flowTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'flow-time', + value: flowTime, + unit: 'ms', + threshold: 5000, + }), + }); + } +); + +test( + 'Verify that user can view order history and order details properly (Order details)', + { + tag: '@firefox', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'Order' }, + { type: 'testdino:link', description: 'https://jira.example.com/ORDER-004' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Order history and details (Order details) on Firefox' } + ] + }, + async () => { + const start = Date.now(); + await login(); + // await allPages.loginPage.clickOnUserProfileIcon(); + // await allPages.orderPage.clickOnMyOrdersTab(); + // await allPages.orderPage.verifyOrdersListVisible(); + // await allPages.orderPage.clickOnFirstOrder(); + // await allPages.orderDetailsPage.verifyOrderDetailsDisplayed(); + await expect(true).toBeTruthy(); + const flowTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'flow-time', + value: flowTime, + unit: 'ms', + threshold: 5000, + }), + }); + } +); + +test( + 'Verify that users can update cart quantity and verify total price (Single order)', + { + tag: '@chromium', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'Cart' }, + { type: 'testdino:link', description: 'https://jira.example.com/CART-003' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Cart quantity (Single order) on Chromium' } + ] + }, + async () => { + const start = Date.now(); + await login(); + // await allPages.homePage.clickOnShopNowButton(); + // await allPages.allProductsPage.clickNthProduct(1); + // await allPages.productDetailsPage.clickAddToCartButton(); + // await allPages.cartPage.clickOnCartIcon(); + // await allPages.cartPage.clickIncreaseQuantityButton(); + // await allPages.cartPage.verifyTotalPriceUpdated(); + await expect(true).toBeTruthy(); + const flowTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'flow-time', + value: flowTime, + unit: 'ms', + threshold: 5000, + }), + }); + } +); + +test( + 'Verify that users can view order history and order details properly (Order history)', + { + tag: '@firefox', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'Order' }, + { type: 'testdino:link', description: 'https://jira.example.com/ORDER-005' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Order history on Firefox' } + ] + }, + async () => { + const start = Date.now(); + await login(); + // await allPages.loginPage.clickOnUserProfileIcon(); + // await allPages.orderPage.clickOnMyOrdersTab(); + // await allPages.orderPage.verifyOrdersListVisible(); + // await allPages.orderPage.clickOnFirstOrder(); + // await allPages.orderDetailsPage.verifyOrderDetailsDisplayed(); + await expect(true).toBeTruthy(); + const flowTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'flow-time', + value: flowTime, + unit: 'ms', + threshold: 5000, + }), + }); + } +); diff --git a/tests/delete-api.spec.js b/tests/delete-api.spec.js index e85a3da..0278cbd 100644 --- a/tests/delete-api.spec.js +++ b/tests/delete-api.spec.js @@ -7,7 +7,18 @@ const USERS_ENDPOINT = '/users'; test.describe('DELETE User API', () => { - test('Remove user 1', { tag: '@api' }, async ({ request }) => { + test('Remove user 1', { + tag: '@api', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'API' }, + { type: 'testdino:link', description: 'https://jira.example.com/API-001' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'DELETE remove user by ID' } + ] + }, async ({ request }) => { + const start = Date.now(); const userId = 1; const response = await request.delete(`${API_BASE_URL}${USERS_ENDPOINT}/${userId}`); @@ -15,9 +26,39 @@ test.describe('DELETE User API', () => { const body = await response.json(); expect(body).toHaveProperty('id', userId); expect(body).toHaveProperty('isDeleted', true); + + const responseTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-response-time', + value: responseTime, + unit: 'ms', + threshold: 5000, + }), + }); + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-calls', + value: 1, + unit: 'count', + }), + }); }); - test.skip('Remove user twice', { tag: '@api' }, async ({ request }) => { + test('Remove user twice', { + tag: '@api', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'API' }, + { type: 'testdino:link', description: 'https://jira.example.com/API-002' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'DELETE user twice idempotency' } + ] + }, async ({ request }) => { + const start = Date.now(); const userId = 2; // First deletion @@ -30,9 +71,39 @@ test.describe('DELETE User API', () => { expect(response2.status()).toBe(200); const body2 = await response2.json(); expect(body2).toHaveProperty('id', userId); + + const responseTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-response-time', + value: responseTime, + unit: 'ms', + threshold: 5000, + }), + }); + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-calls', + value: 2, + unit: 'count', + }), + }); }); - test.skip('Validate body is returned', { tag: '@api' }, async ({ request }) => { + test('Validate body is returned', { + tag: '@api', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'API' }, + { type: 'testdino:link', description: 'https://jira.example.com/API-003' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'DELETE response body validation' } + ] + }, async ({ request }) => { + const start = Date.now(); const userId = 3; const response = await request.delete(`${API_BASE_URL}${USERS_ENDPOINT}/${userId}`); @@ -43,5 +114,24 @@ test.describe('DELETE User API', () => { expect(body).toBeInstanceOf(Object); expect(body).toHaveProperty('id'); expect(typeof body.id).toBe('number'); + + const responseTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-response-time', + value: responseTime, + unit: 'ms', + threshold: 5000, + }), + }); + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-calls', + value: 1, + unit: 'count', + }), + }); }); }); diff --git a/tests/example.spec.js b/tests/example.spec.js index 96da862..a86878d 100644 --- a/tests/example.spec.js +++ b/tests/example.spec.js @@ -1,8 +1,6 @@ // @ts-check import { expect, test } from '@playwright/test'; import AllPages from '../pages/AllPages.js'; -import dotenv from 'dotenv'; -dotenv.config({ override: true }); let allPages; @@ -11,21 +9,15 @@ test.beforeEach(async ({ page }) => { await page.goto('/'); }); -async function login(username = process.env.USERNAME, password = process.env.PASSWORD) { - await allPages.loginPage.clickOnUserProfileIcon(); - await allPages.loginPage.validateSignInPage(); - await allPages.loginPage.login(username, password); -} +/* ---------- Helpers ---------- */ -async function login1(username = process.env.USERNAME1, password = process.env.PASSWORD) { +async function login( + username = process.env.USERNAME, + password = process.env.PASSWORD +) { await allPages.loginPage.clickOnUserProfileIcon(); await allPages.loginPage.validateSignInPage(); - await allPages.loginPage.login(username, password); -} - -async function logout() { - await allPages.loginPage.clickOnUserProfileIcon(); - await allPages.loginPage.clickOnLogoutButton(); + // await allPages.loginPage.login(username, password); } test('Verify that user can log in and log out successfully', { @@ -553,21 +545,31 @@ test('Verify that a new user can complete the journey from registration to multi // await allPages.productDetailsPage.clickAddToCartButton(); // await allPages.productDetailsPage.clickCartIcon(); // await allPages.cartPage.clickIncreaseQuantityButton(); - // await allPages.cartPage.clickOnCheckoutButton(); - // await allPages.checkoutPage.verifyCheckoutTitle(); - // await allPages.checkoutPage.selectCashOnDelivery(); - // await allPages.checkoutPage.verifyCashOnDeliverySelected(); - // await allPages.checkoutPage.fillShippingAddress(process.env.SFIRST_NAME, email, process.env.SCITY, process.env.SSTATE, process.env.SSTREET_ADD, process.env.SZIP_CODE, process.env.SCOUNTRY); - // await allPages.checkoutPage.clickSaveAddressButton(); - // await allPages.checkoutPage.clickOnPlaceOrder(); - // await allPages.checkoutPage.verifyOrderPlacedSuccessfully(); - // await allPages.checkoutPage.verifyOrderConfirmedTitle(); - // await allPages.checkoutPage.clickOnContinueShoppingButton(); - }) - - await test.step('Add another product to cart, select existing address and checkout', async () => { + // await allPages.cartPage.verifyTotalPriceUpdated(); + await expect(true).toBeTruthy(); + } +); + +test( + 'Verify that user can view order history and order detail (Order page)', + { tag: '@firefox' }, + async () => { + await login(); + // await allPages.loginPage.clickOnUserProfileIcon(); + // await allPages.orderPage.clickOnMyOrdersTab(); + // await allPages.orderPage.verifyOrdersListVisible(); + // await allPages.orderPage.clickOnFirstOrder(); + // await allPages.orderDetailsPage.verifyOrderDetailsDisplayed(); + await expect(true).toBeTruthy(); + } +); + +test( + 'Verify that user can update cart quantity and verify total price (Pricing)', + { tag: '@chromium' }, + async () => { + await login(); // await allPages.homePage.clickOnShopNowButton(); - // await allPages.allProductsPage.assertAllProductsTitle(); // await allPages.allProductsPage.clickNthProduct(1); // await allPages.productDetailsPage.clickAddToCartButton(); // await allPages.productDetailsPage.clickCartIcon(); diff --git a/tests/get-users.spec.js b/tests/get-users.spec.js index 1ab0a3d..817e7e6 100644 --- a/tests/get-users.spec.js +++ b/tests/get-users.spec.js @@ -7,16 +7,57 @@ const USERS_ENDPOINT = '/users'; test.describe('GET Users API', () => { - test('Fetch all users', { tag: '@api' }, async ({ request }) => { + test('Fetch all users', { + tag: '@api', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'API' }, + { type: 'testdino:link', description: 'https://jira.example.com/API-001' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'GET fetch all users' } + ] + }, async ({ request }) => { + const start = Date.now(); const response = await request.get(`${API_BASE_URL}${USERS_ENDPOINT}`); expect(response.status()).toBe(200); const body = await response.json(); expect(body).toHaveProperty('users'); expect(Array.isArray(body.users)).toBe(true); + + const responseTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-response-time', + value: responseTime, + unit: 'ms', + threshold: 5000, + }), + }); + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-calls', + value: 1, + unit: 'count', + }), + }); }); - test('Fetch user by ID = 1', { tag: '@api' }, async ({ request }) => { + test('Fetch user by ID = 1', { + tag: '@api', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'API' }, + { type: 'testdino:link', description: 'https://jira.example.com/API-002' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'GET user by ID' } + ] + }, async ({ request }) => { + const start = Date.now(); const response = await request.get(`${API_BASE_URL}${USERS_ENDPOINT}/1`); expect(response.status()).toBe(200); @@ -24,18 +65,78 @@ test.describe('GET Users API', () => { expect(body).toHaveProperty('id', 1); expect(body).toHaveProperty('firstName'); expect(body).toHaveProperty('lastName'); + + const responseTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-response-time', + value: responseTime, + unit: 'ms', + threshold: 5000, + }), + }); + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-calls', + value: 1, + unit: 'count', + }), + }); }); - test('Validate total users > 0', { tag: '@api' }, async ({ request }) => { + test('Validate total users > 0', { + tag: '@api', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'API' }, + { type: 'testdino:link', description: 'https://jira.example.com/API-003' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Validate total users count' } + ] + }, async ({ request }) => { + const start = Date.now(); const response = await request.get(`${API_BASE_URL}${USERS_ENDPOINT}`); expect(response.status()).toBe(200); const body = await response.json(); expect(body).toHaveProperty('total'); expect(body.total).toBeGreaterThan(0); + + const responseTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-response-time', + value: responseTime, + unit: 'ms', + threshold: 5000, + }), + }); + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-calls', + value: 1, + unit: 'count', + }), + }); }); - test('Validate user image exists', { tag: '@api' }, async ({ request }) => { + test('Validate user image exists', { + tag: '@api', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'API' }, + { type: 'testdino:link', description: 'https://jira.example.com/API-004' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Validate user image field' } + ] + }, async ({ request }) => { + const start = Date.now(); const response = await request.get(`${API_BASE_URL}${USERS_ENDPOINT}/1`); expect(response.status()).toBe(200); @@ -43,9 +144,39 @@ test.describe('GET Users API', () => { expect(body).toHaveProperty('image'); expect(body.image).toBeTruthy(); expect(typeof body.image).toBe('string'); + + const responseTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-response-time', + value: responseTime, + unit: 'ms', + threshold: 5000, + }), + }); + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-calls', + value: 1, + unit: 'count', + }), + }); }); - test('Validate user 1 has firstName field', { tag: '@api' }, async ({ request }) => { + test('Validate user 1 has firstName field', { + tag: '@api', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'API' }, + { type: 'testdino:link', description: 'https://jira.example.com/API-005' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Validate firstName field' } + ] + }, async ({ request }) => { + const start = Date.now(); const response = await request.get(`${API_BASE_URL}${USERS_ENDPOINT}/1`); expect(response.status()).toBe(200); @@ -53,15 +184,75 @@ test.describe('GET Users API', () => { expect(body).toHaveProperty('firstName'); expect(typeof body.firstName).toBe('string'); expect(body.firstName.length).toBeGreaterThan(0); + + const responseTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-response-time', + value: responseTime, + unit: 'ms', + threshold: 5000, + }), + }); + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-calls', + value: 1, + unit: 'count', + }), + }); }); - test('Invalid user ID returns 404', { tag: '@api' }, async ({ request }) => { + test('Invalid user ID returns 404', { + tag: '@api', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'API' }, + { type: 'testdino:link', description: 'https://jira.example.com/API-006' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Invalid user ID returns 404' } + ] + }, async ({ request }) => { + const start = Date.now(); const response = await request.get(`${API_BASE_URL}${USERS_ENDPOINT}/999999`); expect(response.status()).toBe(404); + + const responseTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-response-time', + value: responseTime, + unit: 'ms', + threshold: 5000, + }), + }); + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-calls', + value: 1, + unit: 'count', + }), + }); }); - test('default users (no query) returns data object/array', { tag: '@api' }, async ({ request }) => { + test('default users (no query) returns data object/array', { + tag: '@api', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'API' }, + { type: 'testdino:link', description: 'https://jira.example.com/API-007' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Default users response structure' } + ] + }, async ({ request }) => { + const start = Date.now(); const response = await request.get(`${API_BASE_URL}${USERS_ENDPOINT}`); expect(response.status()).toBe(200); @@ -69,9 +260,39 @@ test.describe('GET Users API', () => { expect(body).toBeInstanceOf(Object); // Should have either 'users' array or be an array itself expect(body.users || Array.isArray(body)).toBeTruthy(); + + const responseTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-response-time', + value: responseTime, + unit: 'ms', + threshold: 5000, + }), + }); + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-calls', + value: 1, + unit: 'count', + }), + }); }); - test('limit param returns limited results', { tag: '@api' }, async ({ request }) => { + test('limit param returns limited results', { + tag: '@api', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'API' }, + { type: 'testdino:link', description: 'https://jira.example.com/API-008' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Limit param pagination' } + ] + }, async ({ request }) => { + const start = Date.now(); const limit = 5; const response = await request.get(`${API_BASE_URL}${USERS_ENDPOINT}?limit=${limit}`); @@ -80,9 +301,39 @@ test.describe('GET Users API', () => { const users = body.users || body; const usersArray = Array.isArray(users) ? users : []; expect(usersArray.length).toBeLessThanOrEqual(limit); + + const responseTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-response-time', + value: responseTime, + unit: 'ms', + threshold: 5000, + }), + }); + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-calls', + value: 1, + unit: 'count', + }), + }); }); - test('skip param shifts results', { tag: '@api' }, async ({ request }) => { + test('skip param shifts results', { + tag: '@api', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'API' }, + { type: 'testdino:link', description: 'https://jira.example.com/API-009' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Skip param pagination' } + ] + }, async ({ request }) => { + const start = Date.now(); const skip = 5; const limit = 10; @@ -105,9 +356,39 @@ test.describe('GET Users API', () => { if (firstUser1 && firstUser2) { expect(firstUser1.id).not.toBe(firstUser2.id); } + + const responseTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-response-time', + value: responseTime, + unit: 'ms', + threshold: 5000, + }), + }); + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-calls', + value: 2, + unit: 'count', + }), + }); }); - test('sorting / search query (if supported) returns filtered results', { tag: '@api' }, async ({ request }) => { + test('sorting / search query (if supported) returns filtered results', { + tag: '@api', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'API' }, + { type: 'testdino:link', description: 'https://jira.example.com/API-010' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Search query filtered results' } + ] + }, async ({ request }) => { + const start = Date.now(); // Try search query parameter (common patterns: q, search, query) const searchTerm = 'john'; const response = await request.get(`${API_BASE_URL}${USERS_ENDPOINT}/search?q=${searchTerm}`); @@ -121,9 +402,39 @@ test.describe('GET Users API', () => { // At least verify the response structure is valid expect(Array.isArray(usersArray)).toBe(true); } + + const responseTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-response-time', + value: responseTime, + unit: 'ms', + threshold: 5000, + }), + }); + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-calls', + value: 1, + unit: 'count', + }), + }); }); - test('delayed response (3s) should return 200', { tag: '@api' }, async ({ request }) => { + test('delayed response (3s) should return 200', { + tag: '@api', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'API' }, + { type: 'testdino:link', description: 'https://jira.example.com/API-011' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Delayed response returns 200' } + ] + }, async ({ request }) => { + const start = Date.now(); const isRetry = test.info().retry > 0; if (!isRetry) { expect(true).toBe(false); @@ -144,9 +455,39 @@ test.describe('GET Users API', () => { const body = await response.json(); expect(body).toBeInstanceOf(Object); + + const responseTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-response-time', + value: responseTime, + unit: 'ms', + threshold: 10000, + }), + }); + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-calls', + value: 1, + unit: 'count', + }), + }); }); - test('enforce timeout (expect to fail if too slow) — set short timeout', { tag: '@api' }, async ({ request }) => { + test('enforce timeout (expect to fail if too slow) — set short timeout', { + tag: '@api', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'API' }, + { type: 'testdino:link', description: 'https://jira.example.com/API-012' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Enforce request timeout' } + ] + }, async ({ request }) => { + const start = Date.now(); const delay = 5; const shortTimeout = 2000; @@ -160,5 +501,24 @@ test.describe('GET Users API', () => { } catch (error) { expect(error.message).toMatch(/timeout|Timeout/i); } + + const responseTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-response-time', + value: responseTime, + unit: 'ms', + threshold: 5000, + }), + }); + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-calls', + value: 1, + unit: 'count', + }), + }); }); }); diff --git a/tests/post-api.spec.js b/tests/post-api.spec.js index 38059eb..a0518b3 100644 --- a/tests/post-api.spec.js +++ b/tests/post-api.spec.js @@ -8,7 +8,18 @@ const ADD_ENDPOINT = '/users/add'; test.describe('POST Create User API', () => { - test('Bad endpoint returns 404', { tag: '@api' }, async ({ request }) => { + test('Bad endpoint returns 404', { + tag: '@api', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'API' }, + { type: 'testdino:link', description: 'https://jira.example.com/API-001' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'POST bad endpoint returns 404' } + ] + }, async ({ request }) => { + const start = Date.now(); const userData = { firstName: 'Test', lastName: 'User' @@ -19,9 +30,39 @@ test.describe('POST Create User API', () => { }); expect(response.status()).toBe(404); + + const responseTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-response-time', + value: responseTime, + unit: 'ms', + threshold: 5000, + }), + }); + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-calls', + value: 1, + unit: 'count', + }), + }); }); - test('Invalid JSON payload handling', { tag: '@api' }, async ({ request }) => { + test('Invalid JSON payload handling', { + tag: '@api', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'API' }, + { type: 'testdino:link', description: 'https://jira.example.com/API-002' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Invalid JSON payload handling' } + ] + }, async ({ request }) => { + const start = Date.now(); const response = await request.post(`${API_BASE_URL}${ADD_ENDPOINT}`, { data: 'invalid json string', headers: { @@ -31,25 +72,115 @@ test.describe('POST Create User API', () => { // Should return 400 Bad Request for invalid JSON expect([400, 422]).toContain(response.status()); + + const responseTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-response-time', + value: responseTime, + unit: 'ms', + threshold: 5000, + }), + }); + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-calls', + value: 1, + unit: 'count', + }), + }); }); - test('Too large ID param should return 404', { tag: '@api' }, async ({ request }) => { + test('Too large ID param should return 404', { + tag: '@api', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'API' }, + { type: 'testdino:link', description: 'https://jira.example.com/API-003' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Too large ID param returns 404' } + ] + }, async ({ request }) => { + const start = Date.now(); const tooLargeId = 999999999; const response = await request.get(`${API_BASE_URL}${USERS_ENDPOINT}/${tooLargeId}`); expect(response.status()).toBe(404); + + const responseTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-response-time', + value: responseTime, + unit: 'ms', + threshold: 5000, + }), + }); + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-calls', + value: 1, + unit: 'count', + }), + }); }); - test('Deleting invalid id returns 200/response but not crash', { tag: '@api' }, async ({ request }) => { + test('Deleting invalid id returns 200/response but not crash', { + tag: '@api', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'API' }, + { type: 'testdino:link', description: 'https://jira.example.com/API-004' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Delete invalid id response handling' } + ] + }, async ({ request }) => { + const start = Date.now(); const invalidId = 999999; const response = await request.delete(`${API_BASE_URL}${USERS_ENDPOINT}/${invalidId}`); expect([200, 404]).toContain(response.status()); const body = await response.json(); expect(body).toBeInstanceOf(Object); + + const responseTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-response-time', + value: responseTime, + unit: 'ms', + threshold: 5000, + }), + }); + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-calls', + value: 1, + unit: 'count', + }), + }); }); - test('PUT: Invalid method usage returns appropriate response (no 500)', { tag: '@api' }, async ({ request }) => { + test('PUT: Invalid method usage returns appropriate response (no 500)', { + tag: '@api', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'API' }, + { type: 'testdino:link', description: 'https://jira.example.com/API-005' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Invalid PUT method usage response' } + ] + }, async ({ request }) => { + const start = Date.now(); const userId = 1; const updateData = { firstName: 'Updated' @@ -63,9 +194,39 @@ test.describe('POST Create User API', () => { // Should return appropriate error (400, 404, 405) but not 500 expect([400, 404, 405, 200]).toContain(response.status()); expect(response.status()).not.toBe(500); + + const responseTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-response-time', + value: responseTime, + unit: 'ms', + threshold: 5000, + }), + }); + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-calls', + value: 1, + unit: 'count', + }), + }); }); - test('user schema contains expected keys', { tag: '@api' }, async ({ request }) => { + test('user schema contains expected keys', { + tag: '@api', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'API' }, + { type: 'testdino:link', description: 'https://jira.example.com/API-006' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'User schema expected keys validation' } + ] + }, async ({ request }) => { + const start = Date.now(); const response = await request.get(`${API_BASE_URL}${USERS_ENDPOINT}/1`); expect(response.status()).toBe(200); @@ -76,9 +237,39 @@ test.describe('POST Create User API', () => { expectedKeys.forEach(key => { expect(body).toHaveProperty(key); }); + + const responseTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-response-time', + value: responseTime, + unit: 'ms', + threshold: 5000, + }), + }); + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-calls', + value: 1, + unit: 'count', + }), + }); }); - test('users list contains objects with id and email', { tag: '@api' },async ({ request }) => { + test('users list contains objects with id and email', { + tag: '@api', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'API' }, + { type: 'testdino:link', description: 'https://jira.example.com/API-007' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Users list id and email validation' } + ] + }, async ({ request }) => { + const start = Date.now(); const response = await request.get(`${API_BASE_URL}${USERS_ENDPOINT}`); expect(response.status()).toBe(200); @@ -94,5 +285,24 @@ test.describe('POST Create User API', () => { expect(typeof firstUser.email).toBe('string'); } } + + const responseTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-response-time', + value: responseTime, + unit: 'ms', + threshold: 5000, + }), + }); + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-calls', + value: 1, + unit: 'count', + }), + }); }); }); diff --git a/tests/updateUser.spec.js b/tests/updateUser.spec.js index ae4e06a..52ace44 100644 --- a/tests/updateUser.spec.js +++ b/tests/updateUser.spec.js @@ -8,7 +8,18 @@ const AUTH_ENDPOINT = '/auth/login'; test.describe('PUT / PATCH Update User API', () => { - test('Update user details', { tag: '@api' }, async ({ request }) => { + test('Update user details', { + tag: '@api', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'API' }, + { type: 'testdino:link', description: 'https://jira.example.com/API-001' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'PUT/PATCH update user API' } + ] + }, async ({ request }) => { + const start = Date.now(); const userId = 1; const updateData = { firstName: 'John', @@ -16,7 +27,6 @@ test.describe('PUT / PATCH Update User API', () => { age: 30 }; - // Try PUT first, fallback to PATCH if needed const response = await request.put(`${API_BASE_URL}${USERS_ENDPOINT}/${userId}`, { data: updateData }); @@ -26,9 +36,39 @@ test.describe('PUT / PATCH Update User API', () => { expect(body).toHaveProperty('id', userId); expect(body).toHaveProperty('firstName', updateData.firstName); expect(body).toHaveProperty('lastName', updateData.lastName); + + const responseTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-response-time', + value: responseTime, + unit: 'ms', + threshold: 5000, + }), + }); + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-calls', + value: 1, + unit: 'count', + }), + }); }); - test('Update user with empty payload', { tag: '@api' }, async ({ request }) => { + test('Update user with empty payload', { + tag: '@api', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'API' }, + { type: 'testdino:link', description: 'https://jira.example.com/API-002' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Update user with empty payload' } + ] + }, async ({ request }) => { + const start = Date.now(); const userId = 2; const response = await request.put(`${API_BASE_URL}${USERS_ENDPOINT}/${userId}`, { data: {} @@ -38,9 +78,39 @@ test.describe('PUT / PATCH Update User API', () => { const body = await response.json(); expect(body).toBeInstanceOf(Object); expect(body).toHaveProperty('id', userId); + + const responseTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-response-time', + value: responseTime, + unit: 'ms', + threshold: 5000, + }), + }); + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-calls', + value: 1, + unit: 'count', + }), + }); }); - test('Update only one field', { tag: '@api' }, async ({ request }) => { + test('Update only one field', { + tag: '@api', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'API' }, + { type: 'testdino:link', description: 'https://jira.example.com/API-003' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'PATCH partial user update' } + ] + }, async ({ request }) => { + const start = Date.now(); const userId = 3; const updateData = { firstName: 'UpdatedFirstName' @@ -55,9 +125,39 @@ test.describe('PUT / PATCH Update User API', () => { const body = await response.json(); expect(body).toHaveProperty('id', userId); expect(body).toHaveProperty('firstName', updateData.firstName); + + const responseTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-response-time', + value: responseTime, + unit: 'ms', + threshold: 5000, + }), + }); + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-calls', + value: 1, + unit: 'count', + }), + }); }); - test('Validate returned name field', { tag: '@api' }, async ({ request }) => { + test('Validate returned name field', { + tag: '@api', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'API' }, + { type: 'testdino:link', description: 'https://jira.example.com/API-004' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Validate returned name field from update' } + ] + }, async ({ request }) => { + const start = Date.now(); const userId = 4; const updateData = { firstName: 'Jane', @@ -76,9 +176,39 @@ test.describe('PUT / PATCH Update User API', () => { expect(typeof body.lastName).toBe('string'); expect(body.firstName).toBe(updateData.firstName); expect(body.lastName).toBe(updateData.lastName); + + const responseTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-response-time', + value: responseTime, + unit: 'ms', + threshold: 5000, + }), + }); + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-calls', + value: 1, + unit: 'count', + }), + }); }); - test('Update and validate response contains updatedAt simulation', { tag: '@api' }, async ({ request }) => { + test('Update and validate response contains updatedAt simulation', { + tag: '@api', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'API' }, + { type: 'testdino:link', description: 'https://jira.example.com/API-005' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Validate updatedAt in update response' } + ] + }, async ({ request }) => { + const start = Date.now(); const userId = 5; const updateData = { firstName: 'Updated', @@ -100,9 +230,39 @@ test.describe('PUT / PATCH Update User API', () => { // At minimum, validate the response structure expect(body).toBeInstanceOf(Object); expect(body).toHaveProperty('id', userId); + + const responseTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-response-time', + value: responseTime, + unit: 'ms', + threshold: 5000, + }), + }); + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-calls', + value: 1, + unit: 'count', + }), + }); }); - test('Login failure (invalid creds)', { tag: '@api' }, async ({ request }) => { + test('Login failure (invalid creds)', { + tag: '@api', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'API' }, + { type: 'testdino:link', description: 'https://jira.example.com/API-006' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Auth login failure with invalid credentials' } + ] + }, async ({ request }) => { + const start = Date.now(); const loginData = { username: 'invaliduser', password: 'wrongpassword' @@ -116,9 +276,39 @@ test.describe('PUT / PATCH Update User API', () => { expect([400, 401, 403]).toContain(response.status()); const body = await response.json(); expect(body).toBeInstanceOf(Object); + + const responseTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-response-time', + value: responseTime, + unit: 'ms', + threshold: 5000, + }), + }); + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-calls', + value: 1, + unit: 'count', + }), + }); }); - test('Login missing fields returns 400', { tag: '@api' }, async ({ request }) => { + test('Login missing fields returns 400', { + tag: '@api', + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'API' }, + { type: 'testdino:link', description: 'https://jira.example.com/API-007' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Login missing fields returns 400' } + ] + }, async ({ request }) => { + const start = Date.now(); const loginData = { username: 'kminchelle' }; @@ -130,5 +320,24 @@ test.describe('PUT / PATCH Update User API', () => { expect(response.status()).toBe(400); const body = await response.json(); expect(body).toBeInstanceOf(Object); + + const responseTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-response-time', + value: responseTime, + unit: 'ms', + threshold: 5000, + }), + }); + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'api-calls', + value: 1, + unit: 'count', + }), + }); }); }); diff --git a/tests/visual.spec.js b/tests/visual.spec.js index a410be9..76f2783 100644 --- a/tests/visual.spec.js +++ b/tests/visual.spec.js @@ -11,13 +11,35 @@ test.beforeEach(async ({ page }) => { test.describe('Visual Comparison', () => { test.describe('GitHub Login Page', () => { - test('visual comparison demo test', { tag: ['@visual', '@chromium'] }, async ({ page }) => { - await page.goto('https://github.com/login'); + test.skip('visual comparison demo test', { + tag: ['@visual', '@chromium'], + annotation: [ + { type: 'testdino:priority', description: 'p1' }, + { type: 'testdino:feature', description: 'Visual' }, + { type: 'testdino:link', description: 'https://jira.example.com/VISUAL-001' }, + { type: 'testdino:owner', description: 'qa-team' }, + { type: 'testdino:notify-slack', description: '#e2e-alerts' }, + { type: 'testdino:context', description: 'Visual comparison demo for GitHub login on Chromium' } + ] + }, async ({ page }) => { + const start = Date.now(); + await page.goto('https://github.com/login'); await expect(page).toHaveScreenshot('github-login.png'); await page.getByRole('textbox', { name: 'Username or email address' }).click(); await page.getByRole('textbox', { name: 'Username or email address' }).fill('test'); await expect(page).toHaveScreenshot('github-login-changed.png'); + + const flowTime = Date.now() - start; + test.info().annotations.push({ + type: 'testdino:metric', + description: JSON.stringify({ + name: 'visual-flow-time', + value: flowTime, + unit: 'ms', + threshold: 10000, + }), + }); }); }); });