diff --git a/assert/package.json b/assert/package.json index a07ffca..1ca60bb 100644 --- a/assert/package.json +++ b/assert/package.json @@ -1,6 +1,6 @@ { "name": "@cgauge/assert", - "version": "0.12.1", + "version": "0.13.0", "description": "Extra assert library", "type": "module", "repository": { diff --git a/dtc-aws-plugin/package.json b/dtc-aws-plugin/package.json index 3218a91..61eff88 100644 --- a/dtc-aws-plugin/package.json +++ b/dtc-aws-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@cgauge/dtc-aws-plugin", - "version": "0.12.1", + "version": "0.13.0", "description": "AWS plugin for Declarative TestCases", "repository": { "type": "git", @@ -22,10 +22,10 @@ "@aws-sdk/client-sns": "^3.645.0", "@aws-sdk/lib-dynamodb": "^3.645.0", "@aws-sdk/util-dynamodb": "^3.645.0", - "@cgauge/assert": "^0.12.0", - "@cgauge/dtc": "^0.12.0", - "@cgauge/nock-aws": "^0.12.0", - "@cgauge/type-guard": "^0.12.0" + "@cgauge/assert": "^0.13.0", + "@cgauge/dtc": "^0.13.0", + "@cgauge/nock-aws": "^0.13.0", + "@cgauge/type-guard": "^0.13.0" }, "scripts": { "build": "tsc --build --verbose", diff --git a/dtc-graphql-plugin/package.json b/dtc-graphql-plugin/package.json index 8dab6d8..d40a06d 100644 --- a/dtc-graphql-plugin/package.json +++ b/dtc-graphql-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@cgauge/dtc-graphql-plugin", - "version": "0.12.1", + "version": "0.13.0", "description": "GraphQl plugin for Declarative TestCases", "repository": { "type": "git", @@ -15,9 +15,9 @@ "author": "Salam Suleymanov", "license": "LGPL-3.0-or-later", "dependencies": { - "@cgauge/assert": "^0.12.0", - "@cgauge/dtc": "^0.12.0", - "@cgauge/type-guard": "^0.12.0", + "@cgauge/assert": "^0.13.0", + "@cgauge/dtc": "^0.13.0", + "@cgauge/type-guard": "^0.13.0", "graphql-request": "^7.1.2" }, "scripts": { diff --git a/dtc-mysql-plugin/package.json b/dtc-mysql-plugin/package.json index f4f0f29..3d31a0b 100644 --- a/dtc-mysql-plugin/package.json +++ b/dtc-mysql-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@cgauge/dtc-mysql-plugin", - "version": "0.12.1", + "version": "0.13.0", "description": "MySQL plugin for Declarative TestCases", "repository": { "type": "git", @@ -15,9 +15,9 @@ "author": "Abdala Cerqueira", "license": "LGPL-3.0-or-later", "dependencies": { - "@cgauge/assert": "^0.12.0", - "@cgauge/dtc": "^0.12.0", - "@cgauge/type-guard": "^0.12.0", + "@cgauge/assert": "^0.13.0", + "@cgauge/dtc": "^0.13.0", + "@cgauge/type-guard": "^0.13.0", "mysql2": "^3.11.0", "node-sql-parser": "^5.1.0", "type-assurance": "^1.5.1" diff --git a/dtc-playwright-plugin/package.json b/dtc-playwright-plugin/package.json index 91078dc..5ad823e 100644 --- a/dtc-playwright-plugin/package.json +++ b/dtc-playwright-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@cgauge/dtc-playwright-plugin", - "version": "0.12.1", + "version": "0.13.0", "description": "Playwright plugin for Declarative TestCases", "repository": { "type": "git", @@ -15,9 +15,9 @@ "author": "Abdala Cerqueira", "license": "LGPL-3.0-or-later", "dependencies": { - "@cgauge/assert": "^0.12.0", - "@cgauge/dtc": "^0.12.0", - "@cgauge/type-guard": "^0.12.0", + "@cgauge/assert": "^0.13.0", + "@cgauge/dtc": "^0.13.0", + "@cgauge/type-guard": "^0.13.0", "@playwright/test": "^1.47.0" }, "scripts": { diff --git a/dtc-playwright-plugin/src/playwright-plugin.ts b/dtc-playwright-plugin/src/playwright-plugin.ts index 15088c5..aa88272 100644 --- a/dtc-playwright-plugin/src/playwright-plugin.ts +++ b/dtc-playwright-plugin/src/playwright-plugin.ts @@ -16,6 +16,7 @@ const PlaywrightAction = { action: optional(union(String, PlaywrightActionArgs)), fill: optional(String), click: optional(Boolean), + keydown: optional(Boolean), toBeVisible: optional(Boolean), options: optional(record(String, unknown)), } @@ -66,6 +67,11 @@ const executeActions = async (actions: PlaywrightAction[], page: Page) => { await element.fill(act.fill, act.options) } else if (act.click !== undefined) { await element.click(act.options) + } else if (act.keydown !== undefined) { + await element.focus() + await element.evaluate((htmlElement, options) => { + htmlElement.dispatchEvent(new KeyboardEvent('keydown', {bubbles: true, key: 'ArrowDown', ...options})) + }, act.options) } else if (act.toBeVisible !== undefined) { await expect(element.first()).toBeVisible({visible: act.toBeVisible, ...act.options}) } @@ -77,7 +83,7 @@ export const arrange = async (args: unknown, _basePath: string, {page}: {page: P if (!page) { throw new Error('Page not defined') } - + if (!is(args, {playwright: Playwright})) { return } diff --git a/dtc/package.json b/dtc/package.json index 056bf84..0e7d180 100644 --- a/dtc/package.json +++ b/dtc/package.json @@ -1,6 +1,6 @@ { "name": "@cgauge/dtc", - "version": "0.12.1", + "version": "0.13.0", "description": "Declarative TestCases", "repository": { "type": "git", @@ -18,8 +18,8 @@ "author": "Abdala Cerqueira", "license": "LGPL-3.0-or-later", "dependencies": { - "@cgauge/assert": "^0.12.0", - "@cgauge/type-guard": "^0.12.0", + "@cgauge/assert": "^0.13.0", + "@cgauge/type-guard": "^0.13.0", "cleye": "^1.3.2", "nock": "^14.0.0-beta.15" }, diff --git a/nock-aws/package.json b/nock-aws/package.json index 10d50bd..56464d1 100644 --- a/nock-aws/package.json +++ b/nock-aws/package.json @@ -1,6 +1,6 @@ { "name": "@cgauge/nock-aws", - "version": "0.12.1", + "version": "0.13.0", "description": "AWS Request mocker based on Nock", "repository": { "type": "git", diff --git a/type-guard/package.json b/type-guard/package.json index fab7769..0b09f73 100644 --- a/type-guard/package.json +++ b/type-guard/package.json @@ -1,6 +1,6 @@ { "name": "@cgauge/type-guard", - "version": "0.12.1", + "version": "0.13.0", "description": "Typescript type guards", "repository": { "type": "git", diff --git a/yaml/package.json b/yaml/package.json index 3645072..9e89f21 100644 --- a/yaml/package.json +++ b/yaml/package.json @@ -1,6 +1,6 @@ { "name": "@cgauge/yaml", - "version": "0.12.1", + "version": "0.13.0", "description": "YAML parser with extra tags", "repository": { "type": "git",