@zohodesk/testinglibrary 0.4.6-experimental → 2.9.1
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 +4 -19
- package/build/bdd-framework/cli/commands/env.js +42 -0
- package/build/bdd-framework/cli/commands/export.js +62 -0
- package/build/bdd-framework/cli/commands/test.js +64 -0
- package/build/bdd-framework/cli/index.js +11 -0
- package/build/bdd-framework/cli/options.js +19 -0
- package/build/bdd-framework/cli/worker.js +13 -0
- package/build/bdd-framework/config/configDir.js +35 -0
- package/build/bdd-framework/config/enrichReporterData.js +23 -0
- package/build/bdd-framework/config/env.js +50 -0
- package/build/bdd-framework/config/index.js +94 -0
- package/build/bdd-framework/config/lang.js +14 -0
- package/build/bdd-framework/cucumber/buildStepDefinition.js +43 -0
- package/build/bdd-framework/cucumber/createTestStep.js +43 -0
- package/build/bdd-framework/cucumber/formatter/EventDataCollector.js +126 -0
- package/build/bdd-framework/cucumber/formatter/GherkinDocumentParser.js +72 -0
- package/build/bdd-framework/cucumber/formatter/PickleParser.js +25 -0
- package/build/bdd-framework/cucumber/formatter/durationHelpers.js +13 -0
- package/build/bdd-framework/cucumber/formatter/getColorFns.js +57 -0
- package/build/bdd-framework/cucumber/formatter/index.js +16 -0
- package/build/bdd-framework/cucumber/formatter/locationHelpers.js +16 -0
- package/build/bdd-framework/cucumber/loadConfig.js +17 -0
- package/build/bdd-framework/cucumber/loadFeatures.js +70 -0
- package/build/bdd-framework/cucumber/loadSnippetBuilder.js +20 -0
- package/build/bdd-framework/cucumber/loadSteps.js +47 -0
- package/build/bdd-framework/cucumber/resolveFeaturePaths.js +62 -0
- package/build/bdd-framework/cucumber/stepArguments.js +21 -0
- package/build/bdd-framework/cucumber/types.js +5 -0
- package/build/bdd-framework/cucumber/valueChecker.js +23 -0
- package/build/bdd-framework/decorators.js +18 -0
- package/build/bdd-framework/gen/fixtures.js +48 -0
- package/build/bdd-framework/gen/formatter.js +167 -0
- package/build/bdd-framework/gen/i18n.js +39 -0
- package/build/bdd-framework/gen/index.js +197 -0
- package/build/bdd-framework/gen/specialTags.js +70 -0
- package/build/bdd-framework/gen/testFile.js +470 -0
- package/build/bdd-framework/gen/testMeta.js +60 -0
- package/build/bdd-framework/gen/testNode.js +35 -0
- package/build/bdd-framework/gen/testPoms.js +133 -0
- package/build/bdd-framework/hooks/scenario.js +130 -0
- package/build/bdd-framework/hooks/worker.js +89 -0
- package/build/bdd-framework/index.js +52 -0
- package/build/bdd-framework/playwright/fixtureParameterNames.js +93 -0
- package/build/bdd-framework/playwright/getLocationInFile.js +79 -0
- package/build/bdd-framework/playwright/loadConfig.js +42 -0
- package/build/bdd-framework/playwright/loadUtils.js +33 -0
- package/build/bdd-framework/playwright/testTypeImpl.js +79 -0
- package/build/bdd-framework/playwright/transform.js +88 -0
- package/build/bdd-framework/playwright/types.js +12 -0
- package/build/bdd-framework/playwright/utils.js +56 -0
- package/build/bdd-framework/reporter/cucumber/base.js +52 -0
- package/build/bdd-framework/reporter/cucumber/custom.js +73 -0
- package/build/bdd-framework/reporter/cucumber/helper.js +12 -0
- package/build/bdd-framework/reporter/cucumber/html.js +40 -0
- package/build/bdd-framework/reporter/cucumber/index.js +74 -0
- package/build/bdd-framework/reporter/cucumber/json.js +312 -0
- package/build/bdd-framework/reporter/cucumber/junit.js +205 -0
- package/build/bdd-framework/reporter/cucumber/message.js +20 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/AttachmentMapper.js +82 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/Builder.js +197 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/GherkinDocument.js +43 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/GherkinDocumentClone.js +52 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/GherkinDocuments.js +105 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/Hook.js +70 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/Meta.js +45 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/Pickles.js +27 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/Projects.js +38 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/TestCase.js +128 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/TestCaseRun.js +154 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/TestCaseRunHooks.js +123 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/TestStepAttachments.js +67 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/TestStepRun.js +114 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/index.js +30 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/pwStepUtils.js +70 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/timing.js +35 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/types.js +5 -0
- package/build/bdd-framework/run/StepInvoker.js +69 -0
- package/build/bdd-framework/run/bddData/index.js +59 -0
- package/build/bdd-framework/run/bddData/types.js +5 -0
- package/build/bdd-framework/run/bddFixtures.js +192 -0
- package/build/bdd-framework/run/bddWorld.js +79 -0
- package/build/bdd-framework/run/bddWorldInternal.js +11 -0
- package/build/bdd-framework/snippets/index.js +132 -0
- package/build/bdd-framework/snippets/snippetSyntax.js +43 -0
- package/build/bdd-framework/snippets/snippetSyntaxDecorators.js +26 -0
- package/build/bdd-framework/snippets/snippetSyntaxTs.js +18 -0
- package/build/bdd-framework/stepDefinitions/createBdd.js +66 -0
- package/build/bdd-framework/stepDefinitions/decorators/class.js +68 -0
- package/build/bdd-framework/stepDefinitions/decorators/steps.js +99 -0
- package/build/bdd-framework/stepDefinitions/defineStep.js +62 -0
- package/build/bdd-framework/stepDefinitions/stepConfig.js +24 -0
- package/build/bdd-framework/steps/createBdd.js +78 -0
- package/build/bdd-framework/steps/decorators/class.js +68 -0
- package/build/bdd-framework/steps/decorators/steps.js +98 -0
- package/build/bdd-framework/steps/defineStep.js +62 -0
- package/build/bdd-framework/steps/stepConfig.js +24 -0
- package/build/bdd-framework/utils/AutofillMap.js +20 -0
- package/build/bdd-framework/utils/exit.js +62 -0
- package/build/bdd-framework/utils/index.js +93 -0
- package/build/bdd-framework/utils/jsStringWrap.js +44 -0
- package/build/bdd-framework/utils/logger.js +30 -0
- package/build/bdd-framework/utils/stripAnsiEscapes.js +20 -0
- package/build/core/playwright/helpers/auth/getUsers.js +12 -25
- package/build/core/playwright/index.js +23 -10
- package/build/core/playwright/setup/config-creator.js +3 -3
- package/build/core/playwright/setup/config-utils.js +25 -8
- package/build/core/playwright/tagProcessor.js +79 -0
- package/build/core/playwright/test-runner.js +4 -3
- package/build/core/playwright/validateFeature.js +3 -33
- package/build/decorators.d.ts +1 -1
- package/build/decorators.js +1 -1
- package/build/setup-folder-structure/samples/auth-setup-sample.js +66 -14
- package/build/setup-folder-structure/samples/authUsers-sample.json +9 -0
- package/build/setup-folder-structure/samples/env-config-sample.json +21 -0
- package/build/setup-folder-structure/setupProject.js +5 -18
- package/build/test/core/playwright/__tests__/tagProcessor.test.js +94 -0
- package/build/test/core/playwright/__tests__/validateFeature.test.js +10 -5
- package/build/test/core/playwright/helpers/__tests__/getUsers_ListOfActors.test.js +80 -0
- package/nobdd/src/App.js +7 -0
- package/npm-shrinkwrap.json +2175 -5825
- package/package.json +7 -7
- package/build/core/playwright/fixtures.js +0 -24
- package/build/core/playwright/tag-processor.js +0 -68
- package/build/setup-folder-structure/samples/actors-index.js +0 -3
- package/build/setup-folder-structure/samples/editions-index.js +0 -3
- package/build/setup-folder-structure/samples/free-sample.json +0 -25
- package/build/setup-folder-structure/samples/settings.json +0 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohodesk/testinglibrary",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.9.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"license": "ISC",
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@babel/preset-react": "7.22.5",
|
|
25
|
-
"@cucumber/cucumber": "
|
|
26
|
-
"@playwright/test": "1.
|
|
25
|
+
"@cucumber/cucumber": "9.2.0",
|
|
26
|
+
"@playwright/test": "1.42.1",
|
|
27
27
|
"@testing-library/jest-dom": "5.11.9",
|
|
28
28
|
"@testing-library/react": "11.2.7",
|
|
29
29
|
"@testing-library/react-hooks": "7.0.2",
|
|
@@ -33,9 +33,8 @@
|
|
|
33
33
|
"jest": "29.6.2",
|
|
34
34
|
"jest-environment-jsdom": "29.6.2",
|
|
35
35
|
"msw": "1.2.3",
|
|
36
|
-
"playwright": "1.
|
|
37
|
-
"supports-color": "8.1.1"
|
|
38
|
-
"playwright-bdd": "7.5.0"
|
|
36
|
+
"playwright": "1.42.1",
|
|
37
|
+
"supports-color": "8.1.1"
|
|
39
38
|
},
|
|
40
39
|
"bin": {
|
|
41
40
|
"ZDTestingFramework": "./bin/cli.js"
|
|
@@ -54,6 +53,7 @@
|
|
|
54
53
|
"@babel/preset-env": "7.22.15",
|
|
55
54
|
"@babel/runtime": "7.22.15",
|
|
56
55
|
"commander": "^11.0.0",
|
|
57
|
-
"jest-html-reporter": "^3.10.2"
|
|
56
|
+
"jest-html-reporter": "^3.10.2",
|
|
57
|
+
"typescript": "^5.4.2"
|
|
58
58
|
}
|
|
59
59
|
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _test = require("@playwright/test");
|
|
5
|
-
var _playwrightBdd = require("playwright-bdd");
|
|
6
|
-
var _readConfigFile = require("./readConfigFile");
|
|
7
|
-
var _builtInFixtures = _interopRequireDefault(require("./builtInFixtures"));
|
|
8
|
-
var _getUserFixtures = _interopRequireDefault(require("./helpers/getUserFixtures"));
|
|
9
|
-
const {
|
|
10
|
-
bddMode
|
|
11
|
-
} = (0, _readConfigFile.generateConfigFromFile)();
|
|
12
|
-
let base = bddMode ? _playwrightBdd.test : _test.test;
|
|
13
|
-
const buildInFixtures = (0, _builtInFixtures.default)();
|
|
14
|
-
const buildInFixturesTest = base.extend({
|
|
15
|
-
...buildInFixtures
|
|
16
|
-
});
|
|
17
|
-
const userFixtures = (0, _getUserFixtures.default)();
|
|
18
|
-
const userFixturesTest = base.extend({
|
|
19
|
-
...userFixtures
|
|
20
|
-
});
|
|
21
|
-
const test = (0, _test.mergeTests)(buildInFixturesTest, userFixturesTest);
|
|
22
|
-
module.exports = {
|
|
23
|
-
test
|
|
24
|
-
};
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.tagProcessor = tagProcessor;
|
|
7
|
-
var _logger = require("../../utils/logger");
|
|
8
|
-
/* eslint-disable dot-notation */
|
|
9
|
-
|
|
10
|
-
function getTagsString(tags, editionTags) {
|
|
11
|
-
return tags && tags !== '' ? `${tags} and not (${editionTags})` : `not (${editionTags})`;
|
|
12
|
-
}
|
|
13
|
-
function getEdition(edition) {
|
|
14
|
-
if (edition.startsWith('<=')) {
|
|
15
|
-
return ['<=', edition.slice(2)];
|
|
16
|
-
} else if (edition.startsWith('>=')) {
|
|
17
|
-
return ['>=', edition.slice(2)];
|
|
18
|
-
} else if (edition.startsWith('<')) {
|
|
19
|
-
return ['<', edition.slice(1)];
|
|
20
|
-
} else if (edition.startsWith('>')) {
|
|
21
|
-
return ['>', edition.slice(1)];
|
|
22
|
-
}
|
|
23
|
-
return [null, edition];
|
|
24
|
-
}
|
|
25
|
-
function editionPreprocessing(editionOrder, selectedEdition) {
|
|
26
|
-
const [operator, editionToBeSearched] = getEdition(selectedEdition.toLowerCase());
|
|
27
|
-
const index = editionOrder.findIndex(edition => edition.toLowerCase() === editionToBeSearched);
|
|
28
|
-
if (index !== -1) {
|
|
29
|
-
let resultArray;
|
|
30
|
-
if (operator === '<=') {
|
|
31
|
-
resultArray = editionOrder.slice(index + 1);
|
|
32
|
-
} else if (operator === '>=') {
|
|
33
|
-
resultArray = editionOrder.slice(0, index);
|
|
34
|
-
} else if (operator === '<') {
|
|
35
|
-
resultArray = editionOrder.slice(index);
|
|
36
|
-
} else if (operator === '>') {
|
|
37
|
-
resultArray = editionOrder.slice(0, index + 1);
|
|
38
|
-
} else {
|
|
39
|
-
resultArray = editionOrder.filter((_, order) => order !== index);
|
|
40
|
-
}
|
|
41
|
-
return resultArray;
|
|
42
|
-
}
|
|
43
|
-
_logger.Logger.log(_logger.Logger.INFO_TYPE, `No matching editions ${selectedEdition} found. Running with default edition`);
|
|
44
|
-
return [];
|
|
45
|
-
}
|
|
46
|
-
function buildEditionTags(editionArgs, operator) {
|
|
47
|
-
return editionArgs.map(edition => `@edition_${edition}`).join(` ${operator} `);
|
|
48
|
-
}
|
|
49
|
-
function tagProcessor(userArgsObject, editionOrder) {
|
|
50
|
-
let tagArgs = userArgsObject['tags'];
|
|
51
|
-
const edition = userArgsObject['edition'] || null;
|
|
52
|
-
if (edition !== null) {
|
|
53
|
-
let editionsArray = edition.split(',');
|
|
54
|
-
if (editionsArray.length === 1) {
|
|
55
|
-
const editionArgs = editionPreprocessing(editionOrder, edition);
|
|
56
|
-
if (editionArgs && editionArgs.length > 0) {
|
|
57
|
-
const editionTags = buildEditionTags(editionArgs, 'or');
|
|
58
|
-
tagArgs = `${getTagsString(tagArgs, editionTags)}`;
|
|
59
|
-
}
|
|
60
|
-
} else {
|
|
61
|
-
// More than one edition given
|
|
62
|
-
const filteredEditions = editionOrder.filter(edition => !editionsArray.includes(edition));
|
|
63
|
-
const editionTags = buildEditionTags(filteredEditions, 'or');
|
|
64
|
-
tagArgs = `${getTagsString(tagArgs, editionTags)}`;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return tagArgs;
|
|
68
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"id": "1",
|
|
4
|
-
"edition": "free",
|
|
5
|
-
"orgName": "orgFree",
|
|
6
|
-
"profiles": [
|
|
7
|
-
{
|
|
8
|
-
"profile": "admin",
|
|
9
|
-
"email": "admin+free@zohotest.com",
|
|
10
|
-
"password": "password@0987"
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"profile": "agent",
|
|
14
|
-
"email": "agent@zohotest.com",
|
|
15
|
-
"password": "password@12345"
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
"profile": "lightagent",
|
|
19
|
-
"email": "lightagent@zohotest.com",
|
|
20
|
-
"password": "password@12345"
|
|
21
|
-
}
|
|
22
|
-
]
|
|
23
|
-
}
|
|
24
|
-
]
|
|
25
|
-
|