playwright-cucumber-ts-steps 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +270 -244
- package/dist/backend/actions/formTable.js +34 -0
- package/dist/backend/actions/index.js +5 -0
- package/dist/backend/actions/interactions.js +23 -0
- package/dist/backend/actions/navigation.js +19 -0
- package/dist/backend/api/assertions.js +26 -0
- package/dist/backend/api/index.js +5 -0
- package/dist/backend/api/mock.js +75 -0
- package/dist/backend/api/requests.js +86 -0
- package/dist/backend/api/state.js +15 -0
- package/dist/backend/assertions/expectVisible.js +8 -0
- package/dist/backend/assertions/index.js +5 -0
- package/dist/backend/assertions/pageState.js +25 -0
- package/dist/backend/assertions/text.js +20 -0
- package/dist/backend/assertions/visibility.js +20 -0
- package/dist/backend/auth/index.js +71 -0
- package/dist/backend/db/index.js +6 -0
- package/dist/backend/db/state.js +24 -0
- package/dist/backend/db/steps.js +43 -0
- package/dist/backend/elements/alerts.js +21 -0
- package/dist/backend/elements/forms.js +59 -0
- package/dist/backend/elements/frames.js +25 -0
- package/dist/backend/elements/index.js +5 -0
- package/dist/core/registry.js +20 -0
- package/dist/core/runner.js +151 -0
- package/dist/index.js +10 -0
- package/dist/reporting/index.js +43 -0
- package/package.json +19 -101
- package/LICENSE +0 -21
- package/lib/actions/clickSteps.d.ts +0 -251
- package/lib/actions/clickSteps.js +0 -415
- package/lib/actions/cookieSteps.d.ts +0 -18
- package/lib/actions/cookieSteps.js +0 -93
- package/lib/actions/debugSteps.d.ts +0 -14
- package/lib/actions/debugSteps.js +0 -23
- package/lib/actions/elementFindSteps.d.ts +0 -668
- package/lib/actions/elementFindSteps.js +0 -931
- package/lib/actions/fillFormSteps.d.ts +0 -69
- package/lib/actions/fillFormSteps.js +0 -237
- package/lib/actions/index.d.ts +0 -11
- package/lib/actions/index.js +0 -28
- package/lib/actions/inputSteps.d.ts +0 -218
- package/lib/actions/inputSteps.js +0 -343
- package/lib/actions/interceptionSteps.d.ts +0 -169
- package/lib/actions/interceptionSteps.js +0 -291
- package/lib/actions/miscSteps.d.ts +0 -645
- package/lib/actions/miscSteps.js +0 -1061
- package/lib/actions/mouseSteps.d.ts +0 -143
- package/lib/actions/mouseSteps.js +0 -234
- package/lib/actions/scrollSteps.d.ts +0 -82
- package/lib/actions/scrollSteps.js +0 -123
- package/lib/actions/storageSteps.d.ts +0 -174
- package/lib/actions/storageSteps.js +0 -292
- package/lib/assertions/buttonAndTextVisibilitySteps.d.ts +0 -245
- package/lib/assertions/buttonAndTextVisibilitySteps.js +0 -401
- package/lib/assertions/cookieSteps.d.ts +0 -75
- package/lib/assertions/cookieSteps.js +0 -113
- package/lib/assertions/elementSteps.d.ts +0 -264
- package/lib/assertions/elementSteps.js +0 -388
- package/lib/assertions/formInputSteps.d.ts +0 -248
- package/lib/assertions/formInputSteps.js +0 -350
- package/lib/assertions/index.d.ts +0 -10
- package/lib/assertions/index.js +0 -27
- package/lib/assertions/interceptionRequestsSteps.d.ts +0 -353
- package/lib/assertions/interceptionRequestsSteps.js +0 -593
- package/lib/assertions/locationSteps.d.ts +0 -217
- package/lib/assertions/locationSteps.js +0 -310
- package/lib/assertions/roleTestIdSteps.d.ts +0 -159
- package/lib/assertions/roleTestIdSteps.js +0 -221
- package/lib/assertions/semanticSteps.d.ts +0 -176
- package/lib/assertions/semanticSteps.js +0 -252
- package/lib/assertions/storageSteps.d.ts +0 -149
- package/lib/assertions/storageSteps.js +0 -210
- package/lib/assertions/visualSteps.d.ts +0 -74
- package/lib/assertions/visualSteps.js +0 -209
- package/lib/custom_setups/loginHooks.d.ts +0 -1
- package/lib/custom_setups/loginHooks.js +0 -130
- package/lib/helpers/checkPeerDeps.d.ts +0 -1
- package/lib/helpers/checkPeerDeps.js +0 -19
- package/lib/helpers/compareSnapshots.d.ts +0 -6
- package/lib/helpers/compareSnapshots.js +0 -20
- package/lib/helpers/hooks.d.ts +0 -1
- package/lib/helpers/hooks.js +0 -210
- package/lib/helpers/utils/fakerUtils.d.ts +0 -1
- package/lib/helpers/utils/fakerUtils.js +0 -60
- package/lib/helpers/utils/index.d.ts +0 -4
- package/lib/helpers/utils/index.js +0 -20
- package/lib/helpers/utils/optionsUtils.d.ts +0 -24
- package/lib/helpers/utils/optionsUtils.js +0 -88
- package/lib/helpers/utils/resolveUtils.d.ts +0 -6
- package/lib/helpers/utils/resolveUtils.js +0 -72
- package/lib/helpers/utils/sessionUtils.d.ts +0 -3
- package/lib/helpers/utils/sessionUtils.js +0 -40
- package/lib/helpers/world.d.ts +0 -34
- package/lib/helpers/world.js +0 -110
- package/lib/iframes/frames.d.ts +0 -1
- package/lib/iframes/frames.js +0 -11
- package/lib/index.d.ts +0 -10
- package/lib/index.js +0 -28
- package/lib/register.d.ts +0 -1
- package/lib/register.js +0 -6
- package/src/actions/clickSteps.ts +0 -429
- package/src/actions/cookieSteps.ts +0 -95
- package/src/actions/debugSteps.ts +0 -21
- package/src/actions/elementFindSteps.ts +0 -961
- package/src/actions/fillFormSteps.ts +0 -270
- package/src/actions/index.ts +0 -12
- package/src/actions/inputSteps.ts +0 -354
- package/src/actions/interceptionSteps.ts +0 -325
- package/src/actions/miscSteps.ts +0 -1144
- package/src/actions/mouseSteps.ts +0 -256
- package/src/actions/scrollSteps.ts +0 -122
- package/src/actions/storageSteps.ts +0 -308
- package/src/assertions/buttonAndTextVisibilitySteps.ts +0 -436
- package/src/assertions/cookieSteps.ts +0 -131
- package/src/assertions/elementSteps.ts +0 -432
- package/src/assertions/formInputSteps.ts +0 -377
- package/src/assertions/index.ts +0 -11
- package/src/assertions/interceptionRequestsSteps.ts +0 -640
- package/src/assertions/locationSteps.ts +0 -315
- package/src/assertions/roleTestIdSteps.ts +0 -254
- package/src/assertions/semanticSteps.ts +0 -267
- package/src/assertions/storageSteps.ts +0 -250
- package/src/assertions/visualSteps.ts +0 -275
- package/src/custom_setups/loginHooks.ts +0 -154
- package/src/helpers/checkPeerDeps.ts +0 -19
- package/src/helpers/compareSnapshots.ts +0 -35
- package/src/helpers/hooks.ts +0 -212
- package/src/helpers/utils/fakerUtils.ts +0 -64
- package/src/helpers/utils/index.ts +0 -4
- package/src/helpers/utils/optionsUtils.ts +0 -104
- package/src/helpers/utils/resolveUtils.ts +0 -74
- package/src/helpers/utils/sessionUtils.ts +0 -36
- package/src/helpers/world.ts +0 -119
- package/src/iframes/frames.ts +0 -15
- package/src/index.ts +0 -18
- package/src/register.ts +0 -4
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.runTests = runTests;
|
|
37
|
+
// src/core/runner.ts
|
|
38
|
+
const test_1 = require("@playwright/test");
|
|
39
|
+
const fs = __importStar(require("fs"));
|
|
40
|
+
const glob_1 = require("glob");
|
|
41
|
+
const registry_1 = require("./registry");
|
|
42
|
+
// LOAD BACKEND LIBRARIES
|
|
43
|
+
require("../backend/actions/index");
|
|
44
|
+
require("../backend/assertions/index");
|
|
45
|
+
require("../backend/elements/index");
|
|
46
|
+
require("../backend/api/index");
|
|
47
|
+
require("../backend/auth/index");
|
|
48
|
+
const state_1 = require("../backend/db/state");
|
|
49
|
+
require("../backend/db/index"); // Register DB steps
|
|
50
|
+
/**
|
|
51
|
+
* The main test runner. Parses feature files and executes them as Playwright tests.
|
|
52
|
+
* Includes support for Data Tables and Auto-Screenshots.
|
|
53
|
+
*/
|
|
54
|
+
function runTests(featureGlob, options) {
|
|
55
|
+
// 1. Register DB Adapter if provided
|
|
56
|
+
if (options?.dbQuery) {
|
|
57
|
+
state_1.dbState.setAdapter(options.dbQuery);
|
|
58
|
+
}
|
|
59
|
+
const files = (0, glob_1.globSync)(featureGlob);
|
|
60
|
+
for (const file of files) {
|
|
61
|
+
const content = fs.readFileSync(file, "utf8");
|
|
62
|
+
const featureMatch = content.match(/Feature:\s*(.+)/);
|
|
63
|
+
const featureName = featureMatch
|
|
64
|
+
? featureMatch[1].trim()
|
|
65
|
+
: "Unnamed Feature";
|
|
66
|
+
test_1.test.describe(featureName, () => {
|
|
67
|
+
const scenarioRegex = /(?:(@[\w\s@]+)\s+)?Scenario:\s*(.+)/g;
|
|
68
|
+
let match;
|
|
69
|
+
while ((match = scenarioRegex.exec(content)) !== null) {
|
|
70
|
+
// 1. CAPTURE DATA IMMEDIATELY
|
|
71
|
+
const foundTags = match[1] || "";
|
|
72
|
+
const scenarioName = match[2].trim();
|
|
73
|
+
const startIndex = match.index + match[0].length;
|
|
74
|
+
const nextMatchIndex = content.slice(startIndex).search(/Scenario:/);
|
|
75
|
+
const blockEnd = nextMatchIndex === -1 ? content.length : startIndex + nextMatchIndex;
|
|
76
|
+
const scenarioBlock = content.slice(startIndex, blockEnd);
|
|
77
|
+
if (options?.tags && !foundTags.includes(options.tags)) {
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
(0, test_1.test)(scenarioName, async ({ page }, testInfo) => {
|
|
81
|
+
const lines = scenarioBlock
|
|
82
|
+
.trim()
|
|
83
|
+
.split("\n")
|
|
84
|
+
.map((l) => l.trim())
|
|
85
|
+
.filter((l) => l);
|
|
86
|
+
// CHANGED: Use index loop to handle Data Tables (look-ahead)
|
|
87
|
+
for (let i = 0; i < lines.length; i++) {
|
|
88
|
+
const stepText = lines[i];
|
|
89
|
+
if (stepText.startsWith("#") ||
|
|
90
|
+
stepText.startsWith("@") ||
|
|
91
|
+
stepText === "")
|
|
92
|
+
continue;
|
|
93
|
+
// 2. CHECK FOR DATA TABLE
|
|
94
|
+
// We look at the NEXT lines to see if they start with a pipe '|'
|
|
95
|
+
const tableData = [];
|
|
96
|
+
while (i + 1 < lines.length && lines[i + 1].startsWith("|")) {
|
|
97
|
+
i++; // Move the index forward so we don't process this line as a step
|
|
98
|
+
const row = lines[i]
|
|
99
|
+
.split("|")
|
|
100
|
+
.map((cell) => cell.trim())
|
|
101
|
+
.filter((cell) => cell !== ""); // Remove empty start/end strings from split
|
|
102
|
+
tableData.push(row);
|
|
103
|
+
}
|
|
104
|
+
// 3. CLEAN STEP TEXT
|
|
105
|
+
// Remove "Given/When/..." and trailing colons ":"
|
|
106
|
+
const cleanStep = stepText
|
|
107
|
+
.replace(/^(Given|When|Then|And|But)\s+/i, "")
|
|
108
|
+
.replace(/:$/, "")
|
|
109
|
+
.trim();
|
|
110
|
+
const stepDef = findMatchingStep(cleanStep);
|
|
111
|
+
if (!stepDef) {
|
|
112
|
+
throw new Error(`❌ Undefined Step: "${cleanStep}"`);
|
|
113
|
+
}
|
|
114
|
+
// 4. EXECUTE WITH ERROR HANDLING
|
|
115
|
+
try {
|
|
116
|
+
// Construct arguments: Regex args + Table data (if exists)
|
|
117
|
+
const args = [...stepDef.args];
|
|
118
|
+
if (tableData.length > 0) {
|
|
119
|
+
args.push(tableData);
|
|
120
|
+
}
|
|
121
|
+
// Pass 'page' + args to the step function
|
|
122
|
+
await stepDef.fn(page, ...args);
|
|
123
|
+
}
|
|
124
|
+
catch (error) {
|
|
125
|
+
console.error(`❌ Failed at step: "${stepText}"`);
|
|
126
|
+
// Take a screenshot immediately
|
|
127
|
+
const screenshot = await page.screenshot({
|
|
128
|
+
fullPage: true,
|
|
129
|
+
type: "png",
|
|
130
|
+
});
|
|
131
|
+
await testInfo.attach("failure-screenshot", {
|
|
132
|
+
body: screenshot,
|
|
133
|
+
contentType: "image/png",
|
|
134
|
+
});
|
|
135
|
+
throw error;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
function findMatchingStep(text) {
|
|
144
|
+
for (const step of registry_1.stepRegistry) {
|
|
145
|
+
const match = step.expression.match(text);
|
|
146
|
+
if (match) {
|
|
147
|
+
return { fn: step.fn, args: match.map((arg) => arg.getValue(null)) };
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return null;
|
|
151
|
+
}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getReporters = exports.Step = exports.runTests = void 0;
|
|
4
|
+
// src/index.ts
|
|
5
|
+
var runner_1 = require("./core/runner");
|
|
6
|
+
Object.defineProperty(exports, "runTests", { enumerable: true, get: function () { return runner_1.runTests; } });
|
|
7
|
+
var registry_1 = require("./core/registry"); // Export this in case users want to add custom steps
|
|
8
|
+
Object.defineProperty(exports, "Step", { enumerable: true, get: function () { return registry_1.Step; } });
|
|
9
|
+
var index_1 = require("./reporting/index");
|
|
10
|
+
Object.defineProperty(exports, "getReporters", { enumerable: true, get: function () { return index_1.getReporters; } });
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// src/reporting/index.ts
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.getReporters = getReporters;
|
|
5
|
+
/**
|
|
6
|
+
* Helper to generate Playwright Reporter configuration.
|
|
7
|
+
* * @param options - Select which reporters to enable ('html', 'slack', etc.)
|
|
8
|
+
* @returns An array suitable for the 'reporter' field in playwright.config.ts
|
|
9
|
+
*/
|
|
10
|
+
function getReporters(options) {
|
|
11
|
+
const reporters = [];
|
|
12
|
+
// 1. ALWAYS ADD LIST (So they see progress in terminal)
|
|
13
|
+
reporters.push(["list"]);
|
|
14
|
+
// 2. HTML REPORTER (Priority 1)
|
|
15
|
+
if (options.on.includes("html")) {
|
|
16
|
+
reporters.push([
|
|
17
|
+
"html",
|
|
18
|
+
{ open: "on-failure", outputFolder: "playwright-report" },
|
|
19
|
+
]);
|
|
20
|
+
}
|
|
21
|
+
// 3. JSON REPORTER (Useful for CI)
|
|
22
|
+
if (options.on.includes("json")) {
|
|
23
|
+
reporters.push(["json", { outputFile: "results.json" }]);
|
|
24
|
+
}
|
|
25
|
+
// 4. SLACK REPORTER (Requires external package)
|
|
26
|
+
if (options.on.includes("slack")) {
|
|
27
|
+
if (!options.slackWebhookUrl) {
|
|
28
|
+
console.warn("⚠️ Slack reporter requested but no Webhook URL provided.");
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
// We assume the user has installed 'playwright-slack-report'
|
|
32
|
+
// We return the config string that Playwright expects
|
|
33
|
+
reporters.push([
|
|
34
|
+
"playwright-slack-report",
|
|
35
|
+
{
|
|
36
|
+
sendResults: "always", // 'always' | 'on-failure' | 'off'
|
|
37
|
+
slackWebHookUrl: options.slackWebhookUrl,
|
|
38
|
+
},
|
|
39
|
+
]);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return reporters;
|
|
43
|
+
}
|
package/package.json
CHANGED
|
@@ -1,113 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "playwright-cucumber-ts-steps",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
},
|
|
11
|
-
"exports": {
|
|
12
|
-
".": {
|
|
13
|
-
"import": "./lib/index.js"
|
|
14
|
-
},
|
|
15
|
-
"./register": {
|
|
16
|
-
"import": "./lib/register.js"
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
"sideEffects": false,
|
|
20
|
-
"typesVersions": {
|
|
21
|
-
"*": {
|
|
22
|
-
"*": [
|
|
23
|
-
"lib/*"
|
|
24
|
-
]
|
|
25
|
-
}
|
|
26
|
-
},
|
|
3
|
+
"version": "1.0.3",
|
|
4
|
+
"private": false,
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
27
10
|
"scripts": {
|
|
28
11
|
"build": "tsc",
|
|
29
12
|
"docs": "typedoc",
|
|
30
|
-
"
|
|
31
|
-
"prepare": "husky",
|
|
32
|
-
"lint": "eslint . --ext .ts",
|
|
33
|
-
"lint:fix": "eslint . --ext .ts --fix",
|
|
34
|
-
"lint:tsc": "tsc --noEmit",
|
|
35
|
-
"format": "prettier --write .",
|
|
36
|
-
"clean": "rm -rf playwright/report",
|
|
37
|
-
"test": "npm run clean && cucumber-js --config playwright/config/cucumber.js",
|
|
38
|
-
"commitlint": "commitlint --edit"
|
|
39
|
-
},
|
|
40
|
-
"lint-staged": {
|
|
41
|
-
"*.{js,ts,tsx,json,md}": [
|
|
42
|
-
"eslint --fix",
|
|
43
|
-
"prettier --write"
|
|
44
|
-
]
|
|
45
|
-
},
|
|
46
|
-
"commitlint": {
|
|
47
|
-
"extends": [
|
|
48
|
-
"@commitlint/config-conventional"
|
|
49
|
-
]
|
|
13
|
+
"prepublishOnly": "npm run build"
|
|
50
14
|
},
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"playwright",
|
|
57
|
-
"cucumber",
|
|
58
|
-
"typescript",
|
|
59
|
-
"e2e",
|
|
60
|
-
"steps",
|
|
61
|
-
"step-definitions",
|
|
62
|
-
"testing",
|
|
63
|
-
"automation",
|
|
64
|
-
"bdd",
|
|
65
|
-
"api",
|
|
66
|
-
"ui",
|
|
67
|
-
"web",
|
|
68
|
-
"end-to-end",
|
|
69
|
-
"behavior-driven",
|
|
70
|
-
"mobile",
|
|
71
|
-
"visual-testing"
|
|
72
|
-
],
|
|
73
|
-
"author": "qaPaschalE <paschal.enyimiri@gmail.com>",
|
|
74
|
-
"license": "MIT",
|
|
75
|
-
"bugs": {
|
|
76
|
-
"url": "https://github.com/qaPaschalE/playwright-cucumber-ts-steps/issues"
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@cucumber/cucumber-expressions": "^17.1.0",
|
|
17
|
+
"@cucumber/gherkin": "^27.0.0",
|
|
18
|
+
"@cucumber/messages": "^22.0.0",
|
|
19
|
+
"glob": "^10.3.10"
|
|
77
20
|
},
|
|
78
|
-
"homepage": "https://github.com/qaPaschalE/playwright-cucumber-ts-steps#readme",
|
|
79
21
|
"peerDependencies": {
|
|
80
|
-
"@
|
|
81
|
-
"@playwright/test": "*"
|
|
82
|
-
},
|
|
83
|
-
"files": [
|
|
84
|
-
"lib/",
|
|
85
|
-
"src/"
|
|
86
|
-
],
|
|
87
|
-
"dependencies": {
|
|
88
|
-
"@cucumber/tag-expressions": "^6.2.0",
|
|
89
|
-
"@faker-js/faker": "^9.8.0",
|
|
90
|
-
"dayjs": "^1.11.13",
|
|
91
|
-
"dotenv-cli": "^8.0.0",
|
|
92
|
-
"glob": "^11.0.3",
|
|
93
|
-
"parse": "^6.1.1",
|
|
94
|
-
"pixelmatch": "^7.1.0",
|
|
95
|
-
"pngjs": "^7.0.0"
|
|
22
|
+
"@playwright/test": "^1.0.0"
|
|
96
23
|
},
|
|
97
24
|
"devDependencies": {
|
|
98
|
-
"@
|
|
99
|
-
"@
|
|
100
|
-
"@types/
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
"eslint-plugin-import": "^2.32.0",
|
|
104
|
-
"gh-pages": "^6.3.0",
|
|
105
|
-
"husky": "^9.1.7",
|
|
106
|
-
"lint-staged": "^16.1.2",
|
|
107
|
-
"prettier": "^3.5.3",
|
|
108
|
-
"ts-node": "^10.9.2",
|
|
109
|
-
"typedoc": "^0.28.5",
|
|
110
|
-
"typescript": "^5.8.3",
|
|
111
|
-
"typescript-eslint": "^8.34.1"
|
|
25
|
+
"@playwright/test": "^1.41.0",
|
|
26
|
+
"@types/glob": "^8.1.0",
|
|
27
|
+
"@types/node": "^20.11.0",
|
|
28
|
+
"typedoc": "^0.28.15",
|
|
29
|
+
"typescript": "^5.3.3"
|
|
112
30
|
}
|
|
113
31
|
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Chetachi (Paschal) Enyimiri
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
@@ -1,251 +0,0 @@
|
|
|
1
|
-
import { DataTable } from "@cucumber/cucumber";
|
|
2
|
-
import { CustomWorld } from "../helpers/world";
|
|
3
|
-
/**
|
|
4
|
-
* Clicks on the previously stored element.
|
|
5
|
-
*
|
|
6
|
-
* ```gherkin
|
|
7
|
-
* When I click
|
|
8
|
-
* ```
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```gherkin
|
|
12
|
-
* When I click
|
|
13
|
-
* ```
|
|
14
|
-
* @remarks
|
|
15
|
-
* Requires a previous step that stores an element.
|
|
16
|
-
* @category Click Steps
|
|
17
|
-
*/
|
|
18
|
-
export declare function When_I_click(this: CustomWorld, ...rest: any[]): Promise<void>;
|
|
19
|
-
/**
|
|
20
|
-
* Clicks on an element matching the given selector.
|
|
21
|
-
*
|
|
22
|
-
* ```gherkin
|
|
23
|
-
* When I click on element {string}
|
|
24
|
-
* ```
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* ```gherkin
|
|
28
|
-
* When I click on element ".my-class"
|
|
29
|
-
* ```
|
|
30
|
-
* @remarks
|
|
31
|
-
* Stores the clicked element for later use.
|
|
32
|
-
* @category Click Steps
|
|
33
|
-
*/
|
|
34
|
-
export declare function When_I_click_on_element(this: CustomWorld, selector: string, ...rest: any[]): Promise<void>;
|
|
35
|
-
/**
|
|
36
|
-
* Clicks on a button with the given label.
|
|
37
|
-
*
|
|
38
|
-
* ```gherkin
|
|
39
|
-
* When I click on button {string}
|
|
40
|
-
* ```
|
|
41
|
-
*
|
|
42
|
-
* @example
|
|
43
|
-
* ```gherkin
|
|
44
|
-
* When I click on button "Submit"
|
|
45
|
-
* ```
|
|
46
|
-
* @remarks
|
|
47
|
-
* Stores the clicked button for later use.
|
|
48
|
-
* @category Click Steps
|
|
49
|
-
*/
|
|
50
|
-
export declare function When_I_click_on_button(this: CustomWorld, label: string, ...rest: any[]): Promise<void>;
|
|
51
|
-
/**
|
|
52
|
-
* Clicks on a link with the given text.
|
|
53
|
-
*
|
|
54
|
-
* ```gherkin
|
|
55
|
-
* When I click on link {string}
|
|
56
|
-
* ```
|
|
57
|
-
*
|
|
58
|
-
* @example
|
|
59
|
-
* ```gherkin
|
|
60
|
-
* When I click on link "Home"
|
|
61
|
-
* ```
|
|
62
|
-
* @remarks
|
|
63
|
-
* Stores the clicked link for later use.
|
|
64
|
-
* @category Click Steps
|
|
65
|
-
*/
|
|
66
|
-
export declare function When_I_click_on_link(this: CustomWorld, text: string, ...rest: any[]): Promise<void>;
|
|
67
|
-
/**
|
|
68
|
-
* Clicks on a label with the given text.
|
|
69
|
-
*
|
|
70
|
-
* ```gherkin
|
|
71
|
-
* When I click on label {string}
|
|
72
|
-
* ```
|
|
73
|
-
*
|
|
74
|
-
* @example
|
|
75
|
-
* ```gherkin
|
|
76
|
-
* When I click on label "Username"
|
|
77
|
-
* ```
|
|
78
|
-
* @remarks
|
|
79
|
-
* Stores the clicked label for later use.
|
|
80
|
-
* @category Click Steps
|
|
81
|
-
*/
|
|
82
|
-
export declare function When_I_click_on_label(this: CustomWorld, labelText: string, ...rest: any[]): Promise<void>;
|
|
83
|
-
/**
|
|
84
|
-
* Clicks on an element containing the given text (not exact match). Supports aliasing with @alias.
|
|
85
|
-
*
|
|
86
|
-
* ```gherkin
|
|
87
|
-
* When I click on text {string}
|
|
88
|
-
* ```
|
|
89
|
-
*
|
|
90
|
-
* @example
|
|
91
|
-
* ```gherkin
|
|
92
|
-
* When I click on text "Welcome"
|
|
93
|
-
* When I click on text "@username"
|
|
94
|
-
* ```
|
|
95
|
-
* @remarks
|
|
96
|
-
* Stores the clicked element for later use.
|
|
97
|
-
* @category Click Steps
|
|
98
|
-
*/
|
|
99
|
-
export declare function When_I_click_on_text(this: CustomWorld, rawText: string, ...rest: any[]): Promise<void>;
|
|
100
|
-
/**
|
|
101
|
-
* Clicks on an element containing the exact given text.
|
|
102
|
-
*
|
|
103
|
-
* ```gherkin
|
|
104
|
-
* When I click on exact text {string}
|
|
105
|
-
* ```
|
|
106
|
-
*
|
|
107
|
-
* @example
|
|
108
|
-
* ```gherkin
|
|
109
|
-
* When I click on exact text "Log out"
|
|
110
|
-
* ```
|
|
111
|
-
* @remarks
|
|
112
|
-
* Stores the clicked element for later use.
|
|
113
|
-
* @category Click Steps
|
|
114
|
-
*/
|
|
115
|
-
export declare function When_I_click_on_exact_text(this: CustomWorld, exactText: string, ...rest: any[]): Promise<void>;
|
|
116
|
-
/**
|
|
117
|
-
* Clicks all previously stored elements.
|
|
118
|
-
*
|
|
119
|
-
* ```gherkin
|
|
120
|
-
* When I click all
|
|
121
|
-
* ```
|
|
122
|
-
*
|
|
123
|
-
* @example
|
|
124
|
-
* ```gherkin
|
|
125
|
-
* When I click all
|
|
126
|
-
* ```
|
|
127
|
-
* @remarks
|
|
128
|
-
* Requires a previous step that stores elements.
|
|
129
|
-
* @category Click Steps
|
|
130
|
-
*/
|
|
131
|
-
export declare function When_I_click_all(this: CustomWorld, ...rest: any[]): Promise<void>;
|
|
132
|
-
/**
|
|
133
|
-
* Double-clicks on an element containing the given text.
|
|
134
|
-
*
|
|
135
|
-
* ```gherkin
|
|
136
|
-
* When I double click on text {string}
|
|
137
|
-
* ```
|
|
138
|
-
*
|
|
139
|
-
* @example
|
|
140
|
-
* ```gherkin
|
|
141
|
-
* When I double click on text "Edit"
|
|
142
|
-
* ```
|
|
143
|
-
* @remarks
|
|
144
|
-
* Uses the previously stored element if available.
|
|
145
|
-
* @category Click Steps
|
|
146
|
-
*/
|
|
147
|
-
export declare function When_I_double_click_on_text(this: CustomWorld, text: string, ...rest: any[]): Promise<void>;
|
|
148
|
-
/**
|
|
149
|
-
* Double-clicks at the given page coordinates.
|
|
150
|
-
*
|
|
151
|
-
* ```gherkin
|
|
152
|
-
* When I double click position {int} {int}
|
|
153
|
-
* ```
|
|
154
|
-
*
|
|
155
|
-
* @example
|
|
156
|
-
* ```gherkin
|
|
157
|
-
* When I double click position 100 200
|
|
158
|
-
* ```
|
|
159
|
-
* @category Click Steps
|
|
160
|
-
*/
|
|
161
|
-
export declare function When_I_double_click_position(this: CustomWorld, x: number, y: number, ...rest: any[]): Promise<void>;
|
|
162
|
-
/**
|
|
163
|
-
* Double-clicks on the previously stored element.
|
|
164
|
-
*
|
|
165
|
-
* ```gherkin
|
|
166
|
-
* When I double click
|
|
167
|
-
* ```
|
|
168
|
-
*
|
|
169
|
-
* @example
|
|
170
|
-
* ```gherkin
|
|
171
|
-
* When I double click
|
|
172
|
-
* ```
|
|
173
|
-
* @remarks
|
|
174
|
-
* Requires a previous step that stores an element.
|
|
175
|
-
* @category Click Steps
|
|
176
|
-
*/
|
|
177
|
-
export declare function When_I_double_click(this: CustomWorld, ...rest: any[]): Promise<void>;
|
|
178
|
-
/**
|
|
179
|
-
* Right-clicks on the previously stored element.
|
|
180
|
-
*
|
|
181
|
-
* ```gherkin
|
|
182
|
-
* When I right click
|
|
183
|
-
* ```
|
|
184
|
-
*
|
|
185
|
-
* @example
|
|
186
|
-
* ```gherkin
|
|
187
|
-
* When I right click
|
|
188
|
-
* ```
|
|
189
|
-
* @remarks
|
|
190
|
-
* Requires a previous step that stores an element.
|
|
191
|
-
* @category Click Steps
|
|
192
|
-
*/
|
|
193
|
-
export declare function When_I_right_click(this: CustomWorld, ...rest: any[]): Promise<void>;
|
|
194
|
-
/**
|
|
195
|
-
* Right-clicks on an element containing the given text.
|
|
196
|
-
*
|
|
197
|
-
* ```gherkin
|
|
198
|
-
* When I right click on text {string}
|
|
199
|
-
* ```
|
|
200
|
-
*
|
|
201
|
-
* @example
|
|
202
|
-
* ```gherkin
|
|
203
|
-
* When I right click on text "Options"
|
|
204
|
-
* ```
|
|
205
|
-
* @category Click Steps
|
|
206
|
-
*/
|
|
207
|
-
export declare function When_I_right_click_on_text(this: CustomWorld, text: string, ...rest: any[]): Promise<void>;
|
|
208
|
-
/**
|
|
209
|
-
* Right-clicks at the given page coordinates.
|
|
210
|
-
*
|
|
211
|
-
* ```gherkin
|
|
212
|
-
* When I right click position {int} {int}
|
|
213
|
-
* ```
|
|
214
|
-
*
|
|
215
|
-
* @example
|
|
216
|
-
* ```gherkin
|
|
217
|
-
* When I right click position 50 50
|
|
218
|
-
* ```
|
|
219
|
-
* @category Click Steps
|
|
220
|
-
*/
|
|
221
|
-
export declare function When_I_right_click_position(this: CustomWorld, x: number, y: number, ...rest: any[]): Promise<void>;
|
|
222
|
-
/**
|
|
223
|
-
* Clicks all stored elements (alternative signature).
|
|
224
|
-
*
|
|
225
|
-
* ```gherkin
|
|
226
|
-
* When I click all
|
|
227
|
-
* ```
|
|
228
|
-
*
|
|
229
|
-
* @example
|
|
230
|
-
* ```gherkin
|
|
231
|
-
* When I click all
|
|
232
|
-
* ```
|
|
233
|
-
* @remarks
|
|
234
|
-
* Requires a previous step that stores elements.
|
|
235
|
-
* @category Click Steps
|
|
236
|
-
*/
|
|
237
|
-
export declare function When_I_click_all_alt(this: CustomWorld, dataTable?: DataTable): Promise<void>;
|
|
238
|
-
/**
|
|
239
|
-
* Clicks on an element matching the given selector (regex step).
|
|
240
|
-
*
|
|
241
|
-
* ```gherkin
|
|
242
|
-
* When I click on selector {string}
|
|
243
|
-
* ```
|
|
244
|
-
*
|
|
245
|
-
* @example
|
|
246
|
-
* ```gherkin
|
|
247
|
-
* When I click on selector ".my-selector"
|
|
248
|
-
* ```
|
|
249
|
-
* @category Click Steps
|
|
250
|
-
*/
|
|
251
|
-
export declare function When_I_click_on_selector(this: CustomWorld, selector: string): Promise<void>;
|