@zohodesk/testinglibrary 0.1.9-exp-actors → 0.1.12-experimental
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/.babelrc +4 -2
- package/.claude/settings.local.json +14 -0
- package/.gitlab-ci.yml +206 -0
- package/README.md +264 -1
- package/build/common/data-generator/steps/DataGenerator.spec.js +19 -0
- package/build/common/data-generator/steps/DataGeneratorStepsHelper.js +21 -0
- package/build/common/multi-actor/steps/multiActorHandling.spec.js +26 -0
- package/build/common/searchFake/helpers/rpcRequestHelper.js +52 -0
- package/build/common/searchFake/steps/searchFake.spec.js +85 -0
- package/build/core/dataGenerator/DataGenerator.js +161 -0
- package/build/core/dataGenerator/DataGeneratorError.js +60 -0
- package/build/core/dataGenerator/DataGeneratorHelper.js +121 -0
- package/build/core/dataGenerator/authenticator/Authenticator.js +37 -0
- package/build/core/dataGenerator/authenticator/CookieAuthenticator.js +48 -0
- package/build/core/dataGenerator/authenticator/JWTauthenticator.js +59 -0
- package/build/core/dataGenerator/authenticator/OAuthAuthenticator.js +26 -0
- package/build/core/dataGenerator/authenticator/OrgOAuthAuthenticator.js +26 -0
- package/build/core/dataGenerator/authenticator/cookieAuthConfig.js +11 -0
- package/build/core/jest/preprocessor/jsPreprocessor.js +2 -7
- package/build/core/jest/setup/index.js +1 -7
- package/build/core/playwright/builtInFixtures/actorContext.js +78 -0
- package/build/core/playwright/builtInFixtures/caseTimeout.js +20 -0
- package/build/core/playwright/builtInFixtures/context.js +34 -16
- package/build/core/playwright/builtInFixtures/executionContext.js +17 -0
- package/build/core/playwright/builtInFixtures/i18N.js +8 -0
- package/build/core/playwright/builtInFixtures/index.js +7 -1
- package/build/core/playwright/builtInFixtures/page.js +22 -84
- package/build/core/playwright/clear-caches.js +17 -5
- package/build/core/playwright/codegen.js +4 -21
- package/build/core/playwright/configuration/Configuration.js +25 -0
- package/build/core/playwright/configuration/ConfigurationHelper.js +45 -0
- package/build/core/playwright/configuration/UserArgs.js +12 -0
- package/build/core/playwright/constants/configConstants.js +17 -0
- package/build/core/playwright/constants/failureTagConstants.js +17 -0
- package/build/core/playwright/constants/fileMutexConfig.js +9 -0
- package/build/core/playwright/constants/reporterConstants.js +20 -0
- package/build/core/playwright/constants/retryConstants.js +8 -0
- package/build/core/playwright/custom-commands.js +1 -1
- package/build/core/playwright/env-initializer.js +26 -7
- package/build/core/playwright/fixtures.js +24 -0
- package/build/core/playwright/helpers/additionalProfiles.js +25 -0
- package/build/core/playwright/helpers/auth/accountLogin.js +4 -1
- package/build/core/playwright/helpers/auth/checkAuthCookies.js +20 -19
- package/build/core/playwright/helpers/auth/getUsers.js +57 -49
- package/build/core/playwright/helpers/auth/index.js +14 -1
- package/build/core/playwright/helpers/auth/loginDefaultStepsHelper.js +62 -0
- package/build/core/playwright/helpers/auth/loginSteps.js +40 -22
- package/build/core/playwright/helpers/browserTimeoutFactor.js +16 -0
- package/build/core/playwright/helpers/caseTimeoutResolver.js +37 -0
- package/build/core/playwright/helpers/checkAuthDirectory.js +27 -0
- package/build/core/playwright/helpers/configFileNameProvider.js +21 -7
- package/build/core/playwright/helpers/configPathResolver.js +38 -0
- package/build/core/playwright/helpers/contextFailureHandler.js +81 -0
- package/build/core/playwright/helpers/customFixturesHelper.js +58 -0
- package/build/core/playwright/helpers/failureTagClassifier.js +197 -0
- package/build/core/playwright/helpers/fileMutex.js +71 -0
- package/build/core/playwright/helpers/logCollector.js +147 -0
- package/build/core/playwright/helpers/parseUserArgs.js +2 -3
- package/build/core/playwright/helpers/runtimeLogAnnotator.js +140 -0
- package/build/core/playwright/helpers/runtimeLogPath.js +61 -0
- package/build/core/playwright/helpers/runtimeLogReader.js +54 -0
- package/build/core/playwright/helpers/thirdPartyLib.js +13 -0
- package/build/core/playwright/index.js +8 -88
- package/build/core/playwright/patterns/casePatterns.js +9 -0
- package/build/core/playwright/patterns/codePatterns.js +9 -0
- package/build/core/playwright/patterns/environmentPatterns.js +15 -0
- package/build/core/playwright/patterns/index.js +33 -0
- package/build/core/playwright/patterns/logCollectorIgnorePatterns.js +15 -0
- package/build/core/playwright/patterns/toolPatterns.js +26 -0
- package/build/core/playwright/readConfigFile.js +49 -16
- package/build/core/playwright/reporter/PlaywrightReporter.js +58 -0
- package/build/core/playwright/reporter/Reporter.js +65 -0
- package/build/core/playwright/reporter/ShardReporter.js +58 -0
- package/build/core/playwright/reporter/UnitReporter.js +27 -0
- package/build/core/playwright/reporter/helpers/mergeAbortedTests.js +78 -0
- package/build/core/playwright/runner/Runner.js +22 -0
- package/build/core/playwright/runner/RunnerHelper.js +43 -0
- package/build/core/playwright/runner/RunnerTypes.js +17 -0
- package/build/core/playwright/runner/SpawnRunner.js +93 -0
- package/build/core/playwright/setup/Project.js +35 -0
- package/build/core/playwright/setup/ProjectConfiguration.js +66 -0
- package/build/core/playwright/setup/config-creator.js +58 -40
- package/build/core/playwright/setup/config-utils.js +68 -37
- package/build/core/playwright/setup/custom-reporter.js +137 -14
- package/build/core/playwright/setup/merge-config.js +32 -0
- package/build/core/playwright/setup/qc-custom-reporter.js +342 -0
- package/build/core/playwright/spawnInheritChild.js +71 -0
- package/build/core/playwright/tagProcessor.js +69 -0
- package/build/core/playwright/test-runner.js +44 -97
- package/build/core/playwright/types.js +4 -1
- package/build/core/playwright/validateFeature.js +28 -0
- package/build/decorators.d.ts +1 -1
- package/build/decorators.js +1 -1
- package/build/index.d.ts +2 -22
- package/build/index.js +12 -2
- package/build/lib/cli.js +42 -7
- package/build/setup-folder-structure/helper.js +2 -0
- package/build/setup-folder-structure/samples/accountLogin-sample.js +19 -0
- package/build/setup-folder-structure/samples/actors-index.js +2 -0
- package/build/setup-folder-structure/samples/auth-setup-sample.js +10 -66
- package/build/setup-folder-structure/samples/editions-index.js +3 -0
- package/build/setup-folder-structure/samples/free-sample.json +25 -0
- package/build/setup-folder-structure/samples/settings.json +7 -0
- package/build/setup-folder-structure/samples/testSetup-sample.js +14 -0
- package/build/setup-folder-structure/samples/uat-config-sample.js +7 -2
- package/build/setup-folder-structure/setupProject.js +23 -5
- package/build/test/core/dataGenerator/__tests__/DataGenerator.test.js +311 -0
- package/build/test/core/dataGenerator/__tests__/DataGeneratorHelper.test.js +204 -0
- package/build/test/core/dataGenerator/__tests__/DataGeneratorResolution.test.js +126 -0
- package/build/test/core/dataGenerator/authenticator/__tests__/Authenticator.test.js +88 -0
- package/build/test/core/dataGenerator/authenticator/__tests__/JWTauthenticator.test.js +136 -0
- package/build/test/core/dataGenerator/authenticator/__tests__/OAuthAuthenticator.test.js +39 -0
- package/build/test/core/dataGenerator/authenticator/__tests__/OrgOAuthAuthenticator.test.js +39 -0
- package/build/test/core/playwright/__tests__/spawnInheritChild.test.js +148 -0
- package/build/test/core/playwright/__tests__/tagProcessor.test.js +94 -0
- package/build/test/core/playwright/__tests__/validateFeature.test.js +72 -0
- package/build/test/core/playwright/buildInFixtures/__tests__/caseTimeout.test.js +96 -0
- package/build/test/core/playwright/buildInFixtures/__tests__/executionContext.test.js +27 -0
- package/build/test/core/playwright/configuration/__tests__/Configuration.test.js +53 -0
- package/build/test/core/playwright/helpers/__tests__/additionalProfiles.test.js +45 -0
- package/build/test/core/playwright/helpers/__tests__/configFileNameProvider.test.js +75 -0
- package/build/test/core/playwright/helpers/__tests__/configPathResolver.test.js +55 -0
- package/build/test/core/playwright/helpers/__tests__/customFixturesHelper.test.js +51 -0
- package/build/test/core/playwright/helpers/__tests__/failureTagClassifier.test.js +604 -0
- package/build/test/core/playwright/helpers/__tests__/fileMutex.test.js +79 -0
- package/build/test/core/playwright/helpers/__tests__/getUsers_ListOfActors.test.js +83 -0
- package/build/test/core/playwright/helpers/__tests__/logCollector.test.js +163 -0
- package/build/test/core/playwright/helpers/__tests__/runtimeLogReader.test.js +112 -0
- package/build/test/core/playwright/helpers/auth/__tests__/checkAuthCookies.test.js +92 -0
- package/build/test/core/playwright/runner/__tests__/RunnerHelper.test.js +19 -0
- package/build/test/core/playwright/runner/__tests__/SpawnRunner.test.js +30 -0
- package/build/utils/cliArgsToObject.js +3 -0
- package/build/utils/commonUtils.js +20 -0
- package/build/utils/fileUtils.js +43 -1
- package/build/utils/logger.js +1 -30
- package/changelog.md +23 -0
- package/docs/CODE-REVIEW-AGENT.md +399 -0
- package/docs/code-review-instructions.md +157 -0
- package/jest.config.js +29 -11
- package/npm-shrinkwrap.json +14994 -4793
- package/package.json +39 -28
- package/playwright.config.js +13 -57
- package/unit_reports/unit-report.html +277 -0
- package/build/bdd-framework/cli/commands/env.js +0 -42
- package/build/bdd-framework/cli/commands/export.js +0 -47
- package/build/bdd-framework/cli/commands/test.js +0 -64
- package/build/bdd-framework/cli/index.js +0 -11
- package/build/bdd-framework/cli/options.js +0 -19
- package/build/bdd-framework/cli/worker.js +0 -13
- package/build/bdd-framework/config/configDir.js +0 -35
- package/build/bdd-framework/config/enrichReporterData.js +0 -23
- package/build/bdd-framework/config/env.js +0 -50
- package/build/bdd-framework/config/index.js +0 -94
- package/build/bdd-framework/config/lang.js +0 -14
- package/build/bdd-framework/cucumber/buildStepDefinition.js +0 -43
- package/build/bdd-framework/cucumber/createTestStep.js +0 -43
- package/build/bdd-framework/cucumber/formatter/EventDataCollector.js +0 -126
- package/build/bdd-framework/cucumber/formatter/GherkinDocumentParser.js +0 -72
- package/build/bdd-framework/cucumber/formatter/PickleParser.js +0 -25
- package/build/bdd-framework/cucumber/formatter/durationHelpers.js +0 -13
- package/build/bdd-framework/cucumber/formatter/getColorFns.js +0 -57
- package/build/bdd-framework/cucumber/formatter/index.js +0 -16
- package/build/bdd-framework/cucumber/formatter/locationHelpers.js +0 -16
- package/build/bdd-framework/cucumber/loadConfig.js +0 -17
- package/build/bdd-framework/cucumber/loadFeatures.js +0 -70
- package/build/bdd-framework/cucumber/loadSnippetBuilder.js +0 -20
- package/build/bdd-framework/cucumber/loadSteps.js +0 -47
- package/build/bdd-framework/cucumber/resolveFeaturePaths.js +0 -62
- package/build/bdd-framework/cucumber/stepArguments.js +0 -21
- package/build/bdd-framework/cucumber/types.js +0 -5
- package/build/bdd-framework/cucumber/valueChecker.js +0 -23
- package/build/bdd-framework/decorators.js +0 -18
- package/build/bdd-framework/gen/fixtures.js +0 -48
- package/build/bdd-framework/gen/formatter.js +0 -123
- package/build/bdd-framework/gen/i18n.js +0 -39
- package/build/bdd-framework/gen/index.js +0 -185
- package/build/bdd-framework/gen/testFile.js +0 -465
- package/build/bdd-framework/gen/testMeta.js +0 -60
- package/build/bdd-framework/gen/testNode.js +0 -60
- package/build/bdd-framework/gen/testPoms.js +0 -133
- package/build/bdd-framework/hooks/scenario.js +0 -130
- package/build/bdd-framework/hooks/worker.js +0 -89
- package/build/bdd-framework/index.js +0 -52
- package/build/bdd-framework/playwright/fixtureParameterNames.js +0 -93
- package/build/bdd-framework/playwright/getLocationInFile.js +0 -79
- package/build/bdd-framework/playwright/loadConfig.js +0 -42
- package/build/bdd-framework/playwright/loadUtils.js +0 -33
- package/build/bdd-framework/playwright/testTypeImpl.js +0 -61
- package/build/bdd-framework/playwright/transform.js +0 -88
- package/build/bdd-framework/playwright/types.js +0 -5
- package/build/bdd-framework/playwright/utils.js +0 -34
- package/build/bdd-framework/reporter/cucumber/base.js +0 -57
- package/build/bdd-framework/reporter/cucumber/custom.js +0 -73
- package/build/bdd-framework/reporter/cucumber/helper.js +0 -12
- package/build/bdd-framework/reporter/cucumber/html.js +0 -35
- package/build/bdd-framework/reporter/cucumber/index.js +0 -74
- package/build/bdd-framework/reporter/cucumber/json.js +0 -312
- package/build/bdd-framework/reporter/cucumber/junit.js +0 -205
- package/build/bdd-framework/reporter/cucumber/message.js +0 -20
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/AttachmentMapper.js +0 -64
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/Builder.js +0 -196
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/GherkinDocument.js +0 -43
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/GherkinDocumentClone.js +0 -52
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/GherkinDocuments.js +0 -105
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/Hook.js +0 -70
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/Meta.js +0 -45
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/Pickles.js +0 -27
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/Projects.js +0 -38
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/TestCase.js +0 -128
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/TestCaseRun.js +0 -126
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/TestCaseRunHooks.js +0 -102
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/TestStepAttachments.js +0 -50
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/TestStepRun.js +0 -88
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/index.js +0 -30
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/pwUtils.js +0 -51
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/timing.js +0 -35
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/types.js +0 -5
- package/build/bdd-framework/run/StepInvoker.js +0 -68
- package/build/bdd-framework/run/bddDataAttachment.js +0 -46
- package/build/bdd-framework/run/bddFixtures.js +0 -191
- package/build/bdd-framework/run/bddWorld.js +0 -79
- package/build/bdd-framework/run/bddWorldInternal.js +0 -15
- package/build/bdd-framework/snippets/index.js +0 -132
- package/build/bdd-framework/snippets/snippetSyntax.js +0 -43
- package/build/bdd-framework/snippets/snippetSyntaxDecorators.js +0 -26
- package/build/bdd-framework/snippets/snippetSyntaxTs.js +0 -18
- package/build/bdd-framework/stepDefinitions/createBdd.js +0 -66
- package/build/bdd-framework/stepDefinitions/decorators/class.js +0 -68
- package/build/bdd-framework/stepDefinitions/decorators/steps.js +0 -99
- package/build/bdd-framework/stepDefinitions/defineStep.js +0 -62
- package/build/bdd-framework/stepDefinitions/stepConfig.js +0 -24
- package/build/bdd-framework/utils/AutofillMap.js +0 -20
- package/build/bdd-framework/utils/exit.js +0 -62
- package/build/bdd-framework/utils/index.js +0 -93
- package/build/bdd-framework/utils/jsStringWrap.js +0 -44
- package/build/bdd-framework/utils/logger.js +0 -30
- package/build/bdd-framework/utils/stripAnsiEscapes.js +0 -20
- package/build/core/playwright/report-generator.js +0 -42
- package/build/core/playwright/tag-processor.js +0 -68
- package/build/setup-folder-structure/samples/authUsers-sample.json +0 -9
- package/build/setup-folder-structure/samples/env-config-sample.json +0 -21
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.MessagesBuilder = void 0;
|
|
8
|
-
var _TestCaseRun = require("./TestCaseRun");
|
|
9
|
-
var _TestCase = require("./TestCase");
|
|
10
|
-
var _Meta = require("./Meta");
|
|
11
|
-
var _timing = require("./timing");
|
|
12
|
-
var _events = _interopRequireDefault(require("events"));
|
|
13
|
-
var _EventDataCollector = _interopRequireDefault(require("../../../cucumber/formatter/EventDataCollector"));
|
|
14
|
-
var _AutofillMap = require("../../../utils/AutofillMap");
|
|
15
|
-
var _GherkinDocuments = require("./GherkinDocuments");
|
|
16
|
-
var _Pickles = require("./Pickles");
|
|
17
|
-
class MessagesBuilder {
|
|
18
|
-
report = {
|
|
19
|
-
meta: null,
|
|
20
|
-
source: [],
|
|
21
|
-
gherkinDocument: [],
|
|
22
|
-
pickle: [],
|
|
23
|
-
stepDefinition: [],
|
|
24
|
-
hook: [],
|
|
25
|
-
testRunStarted: null,
|
|
26
|
-
testCase: [],
|
|
27
|
-
testCaseRuns: [],
|
|
28
|
-
testRunFinished: null
|
|
29
|
-
};
|
|
30
|
-
fullResult;
|
|
31
|
-
onTestEnds = [];
|
|
32
|
-
testCaseRuns = [];
|
|
33
|
-
testCases = new _AutofillMap.AutofillMap();
|
|
34
|
-
hooks = new _AutofillMap.AutofillMap();
|
|
35
|
-
gherkinDocuments = new _GherkinDocuments.GherkinDocuments();
|
|
36
|
-
fullResultTiming;
|
|
37
|
-
onEndPromise;
|
|
38
|
-
onEndPromiseResolve = () => {};
|
|
39
|
-
buildMessagesPromise;
|
|
40
|
-
eventDataCollectorEmitter = new _events.default();
|
|
41
|
-
eventDataCollector = new _EventDataCollector.default(this.eventDataCollectorEmitter);
|
|
42
|
-
constructor() {
|
|
43
|
-
this.onEndPromise = new Promise(resolve => this.onEndPromiseResolve = resolve);
|
|
44
|
-
}
|
|
45
|
-
onTestEnd(test, result) {
|
|
46
|
-
this.onTestEnds.push({
|
|
47
|
-
test,
|
|
48
|
-
result
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
onEnd(fullResult) {
|
|
52
|
-
this.fullResult = fullResult;
|
|
53
|
-
this.onEndPromiseResolve();
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Builds Cucumber messages.
|
|
57
|
-
* Note: wrapped into promise to build messages once for all reporters.
|
|
58
|
-
*/
|
|
59
|
-
async buildMessages() {
|
|
60
|
-
if (!this.buildMessagesPromise) {
|
|
61
|
-
this.buildMessagesPromise = this.doBuildMessages();
|
|
62
|
-
}
|
|
63
|
-
return this.buildMessagesPromise;
|
|
64
|
-
}
|
|
65
|
-
// eslint-disable-next-line max-statements
|
|
66
|
-
async doBuildMessages() {
|
|
67
|
-
await this.onEndPromise;
|
|
68
|
-
// order here is important
|
|
69
|
-
this.createTestCaseRuns();
|
|
70
|
-
await this.loadFeatures();
|
|
71
|
-
this.createTestCases();
|
|
72
|
-
this.addMeta();
|
|
73
|
-
this.addSourcesAndDocuments();
|
|
74
|
-
this.addPickles();
|
|
75
|
-
this.addHooks();
|
|
76
|
-
this.addTestRunStarted();
|
|
77
|
-
this.addTestCases();
|
|
78
|
-
this.addTestCaseRuns();
|
|
79
|
-
this.addTestRunFinished();
|
|
80
|
-
this.buildEventDataCollector();
|
|
81
|
-
}
|
|
82
|
-
emitMessages(eventBroadcaster) {
|
|
83
|
-
Object.values(this.report).forEach(value => {
|
|
84
|
-
if (!value) {
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
const messages = Array.isArray(value) ? value : [value];
|
|
88
|
-
messages.forEach(message => eventBroadcaster.emit('envelope', message));
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
createTestCases() {
|
|
92
|
-
this.testCaseRuns.forEach(testCaseRun => {
|
|
93
|
-
const testId = testCaseRun.test.id;
|
|
94
|
-
const gherkinDocsForProject = this.gherkinDocuments.getDocumentsForProject(testCaseRun.projectInfo);
|
|
95
|
-
const testCase = this.testCases.getOrCreate(testId, () => new _TestCase.TestCase(testId, gherkinDocsForProject));
|
|
96
|
-
testCase.addRun(testCaseRun);
|
|
97
|
-
testCaseRun.testCase = testCase;
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
async loadFeatures() {
|
|
101
|
-
await this.gherkinDocuments.load(this.testCaseRuns);
|
|
102
|
-
}
|
|
103
|
-
createTestCaseRuns() {
|
|
104
|
-
this.onTestEnds.forEach(({
|
|
105
|
-
test,
|
|
106
|
-
result
|
|
107
|
-
}) => {
|
|
108
|
-
// For skipped tests Playwright doesn't run fixtures
|
|
109
|
-
// and we don't have bddData attachment -> don't know feature uri.
|
|
110
|
-
// Don't add such test run to report.
|
|
111
|
-
if (test.expectedStatus === 'skipped') {
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
const testCaseRun = new _TestCaseRun.TestCaseRun(test, result, this.hooks);
|
|
115
|
-
this.testCaseRuns.push(testCaseRun);
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
addMeta() {
|
|
119
|
-
this.report.meta = new _Meta.Meta().buildMessage();
|
|
120
|
-
}
|
|
121
|
-
addSourcesAndDocuments() {
|
|
122
|
-
const {
|
|
123
|
-
sources,
|
|
124
|
-
gherkinDocuments
|
|
125
|
-
} = this.gherkinDocuments.buildMessages();
|
|
126
|
-
this.report.source = sources;
|
|
127
|
-
this.report.gherkinDocument = gherkinDocuments;
|
|
128
|
-
}
|
|
129
|
-
addPickles() {
|
|
130
|
-
this.report.pickle = new _Pickles.Pickles().buildMessages(this.testCases);
|
|
131
|
-
}
|
|
132
|
-
addHooks() {
|
|
133
|
-
this.hooks.forEach(hook => {
|
|
134
|
-
const message = hook.buildMessage();
|
|
135
|
-
this.report.hook.push(message);
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
addTestCases() {
|
|
139
|
-
this.testCases.forEach(testCase => {
|
|
140
|
-
const message = testCase.buildMessage();
|
|
141
|
-
this.report.testCase.push(message);
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
addTestCaseRuns() {
|
|
145
|
-
this.testCaseRuns.map(testCaseRun => {
|
|
146
|
-
const messages = testCaseRun.buildMessages();
|
|
147
|
-
this.report.testCaseRuns.push(...messages);
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
addTestRunStarted() {
|
|
151
|
-
const {
|
|
152
|
-
startTime
|
|
153
|
-
} = this.getFullResultTiming();
|
|
154
|
-
const testRunStarted = {
|
|
155
|
-
timestamp: (0, _timing.toCucumberTimestamp)(startTime.getTime())
|
|
156
|
-
};
|
|
157
|
-
this.report.testRunStarted = {
|
|
158
|
-
testRunStarted
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
addTestRunFinished() {
|
|
162
|
-
const {
|
|
163
|
-
startTime,
|
|
164
|
-
duration
|
|
165
|
-
} = this.getFullResultTiming();
|
|
166
|
-
const testRunFinished = {
|
|
167
|
-
success: this.fullResult.status === 'passed',
|
|
168
|
-
timestamp: (0, _timing.toCucumberTimestamp)(startTime.getTime() + duration)
|
|
169
|
-
};
|
|
170
|
-
this.report.testRunFinished = {
|
|
171
|
-
testRunFinished
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
buildEventDataCollector() {
|
|
175
|
-
this.emitMessages(this.eventDataCollectorEmitter);
|
|
176
|
-
}
|
|
177
|
-
getFullResultTiming() {
|
|
178
|
-
if (this.fullResultTiming) {
|
|
179
|
-
return this.fullResultTiming;
|
|
180
|
-
}
|
|
181
|
-
// result.startTime and result.duration were added in pw 1.37
|
|
182
|
-
// see: https://github.com/microsoft/playwright/pull/26760
|
|
183
|
-
if ('startTime' in this.fullResult && 'duration' in this.fullResult) {
|
|
184
|
-
this.fullResultTiming = {
|
|
185
|
-
startTime: this.fullResult.startTime,
|
|
186
|
-
duration: this.fullResult.duration
|
|
187
|
-
};
|
|
188
|
-
} else {
|
|
189
|
-
// Calculate overall startTime and duration based on test timings
|
|
190
|
-
const items = this.testCaseRuns.map(t => t.result);
|
|
191
|
-
this.fullResultTiming = (0, _timing.calcMinMaxByArray)(items);
|
|
192
|
-
}
|
|
193
|
-
return this.fullResultTiming;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
exports.MessagesBuilder = MessagesBuilder;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.GherkinDocumentMessage = void 0;
|
|
7
|
-
var _utils = require("../../../utils");
|
|
8
|
-
var _Projects = require("./Projects");
|
|
9
|
-
const gherkinDocumentMetaSymbol = Symbol('gherkinDocumentMeta');
|
|
10
|
-
class GherkinDocumentMessage {
|
|
11
|
-
projectInfo;
|
|
12
|
-
gherkinDocument;
|
|
13
|
-
static extractMeta(gherkinDocument) {
|
|
14
|
-
return gherkinDocument[gherkinDocumentMetaSymbol];
|
|
15
|
-
}
|
|
16
|
-
constructor(projectInfo, gherkinDocument) {
|
|
17
|
-
this.projectInfo = projectInfo;
|
|
18
|
-
this.gherkinDocument = gherkinDocument;
|
|
19
|
-
}
|
|
20
|
-
build() {
|
|
21
|
-
const gherkinDocument = this.copyDocumentWithoutPickles();
|
|
22
|
-
this.setUriWithProject(gherkinDocument);
|
|
23
|
-
this.setMeta(gherkinDocument);
|
|
24
|
-
return {
|
|
25
|
-
gherkinDocument
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
copyDocumentWithoutPickles() {
|
|
29
|
-
return (0, _utils.omit)(this.gherkinDocument, 'pickles');
|
|
30
|
-
}
|
|
31
|
-
setUriWithProject(gherkinDocument) {
|
|
32
|
-
gherkinDocument.uri = (0, _Projects.getFeatureUriWithProject)(this.projectInfo, this.gherkinDocument.uri);
|
|
33
|
-
}
|
|
34
|
-
setMeta(gherkinDocument) {
|
|
35
|
-
var _this$projectInfo, _this$projectInfo2;
|
|
36
|
-
gherkinDocument[gherkinDocumentMetaSymbol] = {
|
|
37
|
-
originalUri: this.gherkinDocument.uri || '',
|
|
38
|
-
projectName: (_this$projectInfo = this.projectInfo) === null || _this$projectInfo === void 0 ? void 0 : _this$projectInfo.projectName,
|
|
39
|
-
browserName: (_this$projectInfo2 = this.projectInfo) === null || _this$projectInfo2 === void 0 ? void 0 : _this$projectInfo2.browserName
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
exports.GherkinDocumentMessage = GherkinDocumentMessage;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.GherkinDocumentClone = void 0;
|
|
7
|
-
var _crypto = require("crypto");
|
|
8
|
-
var _AutofillMap = require("../../../utils/AutofillMap");
|
|
9
|
-
/**
|
|
10
|
-
* Creates gherkin document copy with re-generated ast node IDs,
|
|
11
|
-
* pickle IDs and pickle steps IDs.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
class GherkinDocumentClone {
|
|
15
|
-
gherkinDocument;
|
|
16
|
-
oldNewIds = new _AutofillMap.AutofillMap();
|
|
17
|
-
constructor(gherkinDocument) {
|
|
18
|
-
this.gherkinDocument = gherkinDocument;
|
|
19
|
-
}
|
|
20
|
-
getClone() {
|
|
21
|
-
const copiedDoc = this.getDocumentCopyWithNewIds();
|
|
22
|
-
this.remapPickleAstNodeIds(copiedDoc);
|
|
23
|
-
return copiedDoc;
|
|
24
|
-
}
|
|
25
|
-
getDocumentCopyWithNewIds() {
|
|
26
|
-
return JSON.parse(JSON.stringify(this.gherkinDocument, (key, value) => {
|
|
27
|
-
return key === 'id' ? this.getOrGenerateNewId(value) : value;
|
|
28
|
-
}));
|
|
29
|
-
}
|
|
30
|
-
remapPickleAstNodeIds(copiedDoc) {
|
|
31
|
-
copiedDoc.pickles.forEach(pickle => {
|
|
32
|
-
pickle.astNodeIds = pickle.astNodeIds.map(oldId => this.getNewId(oldId));
|
|
33
|
-
this.remapPickleStepsAstNodeIds(pickle);
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
remapPickleStepsAstNodeIds(pickle) {
|
|
37
|
-
pickle.steps.forEach(step => {
|
|
38
|
-
step.astNodeIds = step.astNodeIds.map(oldId => this.getNewId(oldId));
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
getOrGenerateNewId(oldId) {
|
|
42
|
-
return this.oldNewIds.getOrCreate(oldId, () => (0, _crypto.randomUUID)());
|
|
43
|
-
}
|
|
44
|
-
getNewId(oldId) {
|
|
45
|
-
const newId = this.oldNewIds.get(oldId);
|
|
46
|
-
if (!newId) {
|
|
47
|
-
throw new Error(`New ID is not found for old ID: ${oldId}`);
|
|
48
|
-
}
|
|
49
|
-
return newId;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
exports.GherkinDocumentClone = GherkinDocumentClone;
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.GherkinDocuments = void 0;
|
|
7
|
-
var _AutofillMap = require("../../../utils/AutofillMap");
|
|
8
|
-
var _loadFeatures = require("../../../cucumber/loadFeatures");
|
|
9
|
-
var _configDir = require("../../../config/configDir");
|
|
10
|
-
var _GherkinDocumentClone = require("./GherkinDocumentClone");
|
|
11
|
-
var _GherkinDocument = require("./GherkinDocument");
|
|
12
|
-
var _Projects = require("./Projects");
|
|
13
|
-
var _env = require("../../../config/env");
|
|
14
|
-
var _lang = require("../../../config/lang");
|
|
15
|
-
class GherkinDocuments {
|
|
16
|
-
featuresLoader = new _loadFeatures.FeaturesLoader();
|
|
17
|
-
projectsPerFeaturePath = new _AutofillMap.AutofillMap();
|
|
18
|
-
gherkinDocumentsPerProject = new _AutofillMap.AutofillMap();
|
|
19
|
-
constructor() {}
|
|
20
|
-
async load(testCaseRuns) {
|
|
21
|
-
this.fillProjectsPerFeaturePath(testCaseRuns);
|
|
22
|
-
const cwd = (0, _configDir.getPlaywrightConfigDir)();
|
|
23
|
-
const featurePaths = [...this.projectsPerFeaturePath.keys()];
|
|
24
|
-
await this.featuresLoader.load(featurePaths, {
|
|
25
|
-
relativeTo: cwd,
|
|
26
|
-
defaultDialect: this.getFeaturesLang()
|
|
27
|
-
});
|
|
28
|
-
this.fillGherkinDocumentsPerProject();
|
|
29
|
-
}
|
|
30
|
-
getDocumentsForProject(projectInfo) {
|
|
31
|
-
const docs = this.gherkinDocumentsPerProject.get(projectInfo);
|
|
32
|
-
if (!docs) {
|
|
33
|
-
throw new Error(`No gherkin docs for project ${projectInfo === null || projectInfo === void 0 ? void 0 : projectInfo.projectName}`);
|
|
34
|
-
}
|
|
35
|
-
return docs;
|
|
36
|
-
}
|
|
37
|
-
buildMessages() {
|
|
38
|
-
const sources = [];
|
|
39
|
-
const gherkinDocuments = [];
|
|
40
|
-
this.gherkinDocumentsPerProject.forEach((docs, project) => {
|
|
41
|
-
docs.forEach(doc => {
|
|
42
|
-
sources.push(this.buildSourceMessage(project, doc));
|
|
43
|
-
gherkinDocuments.push(new _GherkinDocument.GherkinDocumentMessage(project, doc).build());
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
return {
|
|
47
|
-
sources,
|
|
48
|
-
gherkinDocuments
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
fillProjectsPerFeaturePath(testCaseRuns) {
|
|
52
|
-
testCaseRuns.forEach(testCaseRun => {
|
|
53
|
-
const projects = this.projectsPerFeaturePath.getOrCreate(testCaseRun.bddData.uri, () => new Set());
|
|
54
|
-
projects.add(testCaseRun.projectInfo);
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
fillGherkinDocumentsPerProject() {
|
|
58
|
-
this.featuresLoader.getDocumentsWithPickles().forEach(gherkinDocument => {
|
|
59
|
-
if (!gherkinDocument.uri) {
|
|
60
|
-
throw new Error(`Feature without uri`);
|
|
61
|
-
}
|
|
62
|
-
const projects = this.projectsPerFeaturePath.get(gherkinDocument.uri);
|
|
63
|
-
if (!projects) {
|
|
64
|
-
throw new Error(`Feature without projects: ${gherkinDocument.uri}`);
|
|
65
|
-
}
|
|
66
|
-
projects.forEach(project => {
|
|
67
|
-
this.addGherkinDocumentToProject(project, gherkinDocument);
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
addGherkinDocumentToProject(projectInfo, gherkinDocument) {
|
|
72
|
-
const projectDocs = this.gherkinDocumentsPerProject.getOrCreate(projectInfo, () => []);
|
|
73
|
-
const clonedDocument = new _GherkinDocumentClone.GherkinDocumentClone(gherkinDocument).getClone();
|
|
74
|
-
projectDocs.push(clonedDocument);
|
|
75
|
-
}
|
|
76
|
-
buildSourceMessage(projectInfo, doc) {
|
|
77
|
-
if (!doc.uri) {
|
|
78
|
-
throw new Error(`Doc without uri`);
|
|
79
|
-
}
|
|
80
|
-
const originalSource = this.featuresLoader.gherkinQuery.getSource(doc.uri);
|
|
81
|
-
if (!originalSource) {
|
|
82
|
-
throw new Error(`No source`);
|
|
83
|
-
}
|
|
84
|
-
const source = {
|
|
85
|
-
...originalSource,
|
|
86
|
-
uri: (0, _Projects.getFeatureUriWithProject)(projectInfo, doc.uri)
|
|
87
|
-
};
|
|
88
|
-
return {
|
|
89
|
-
source
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
getFeaturesLang() {
|
|
93
|
-
const langsSet = new Set();
|
|
94
|
-
const envConfigs = (0, _env.getEnvConfigs)();
|
|
95
|
-
Object.values(envConfigs).forEach(config => {
|
|
96
|
-
langsSet.add(config.language || _lang.LANG_EN);
|
|
97
|
-
});
|
|
98
|
-
const langs = [...langsSet];
|
|
99
|
-
if (langs.length > 1) {
|
|
100
|
-
throw new Error([`Multi-language features are not supported yet.`, `Detected languages: ${langs.join(', ')}`].join(' '));
|
|
101
|
-
}
|
|
102
|
-
return langs[0];
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
exports.GherkinDocuments = GherkinDocuments;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.Hook = void 0;
|
|
8
|
-
var _crypto = require("crypto");
|
|
9
|
-
var _configDir = require("../../../config/configDir");
|
|
10
|
-
var _path = _interopRequireDefault(require("path"));
|
|
11
|
-
/**
|
|
12
|
-
* Hook that can be used in different test cases.
|
|
13
|
-
* Builds Cucumber's hook message.
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
class Hook {
|
|
17
|
-
internalId;
|
|
18
|
-
static getInternalId(pwStep) {
|
|
19
|
-
const {
|
|
20
|
-
file,
|
|
21
|
-
line,
|
|
22
|
-
column
|
|
23
|
-
} = pwStep.location || {};
|
|
24
|
-
return [pwStep.category, ...pwStep.titlePath(), file, line, column].join('|');
|
|
25
|
-
}
|
|
26
|
-
id;
|
|
27
|
-
name;
|
|
28
|
-
sourceReference;
|
|
29
|
-
constructor(internalId, /* one of pwSteps for this hook */
|
|
30
|
-
pwStep) {
|
|
31
|
-
this.internalId = internalId;
|
|
32
|
-
this.id = (0, _crypto.randomUUID)();
|
|
33
|
-
this.name = this.getName(pwStep);
|
|
34
|
-
this.sourceReference = this.getSourceReference(pwStep);
|
|
35
|
-
}
|
|
36
|
-
buildMessage() {
|
|
37
|
-
const hook = {
|
|
38
|
-
id: this.id,
|
|
39
|
-
name: this.name,
|
|
40
|
-
sourceReference: this.sourceReference
|
|
41
|
-
};
|
|
42
|
-
return {
|
|
43
|
-
hook
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
getName(pwStep) {
|
|
47
|
-
// These fixture names are for anonymous hooks
|
|
48
|
-
// created with Before() / After() functions.
|
|
49
|
-
// Keep name empty for them to be consistent with Cucumber.
|
|
50
|
-
// const bddSystemFixtures = ['fixture: $before', 'fixture: $after'];
|
|
51
|
-
// if (!pwStep.title || bddSystemFixtures.includes(pwStep.title)) return undefined;
|
|
52
|
-
return pwStep.title;
|
|
53
|
-
}
|
|
54
|
-
getSourceReference(pwStep) {
|
|
55
|
-
const {
|
|
56
|
-
file,
|
|
57
|
-
line,
|
|
58
|
-
column
|
|
59
|
-
} = pwStep.location || {};
|
|
60
|
-
const uri = file ? _path.default.relative((0, _configDir.getPlaywrightConfigDir)(), file) : undefined;
|
|
61
|
-
return {
|
|
62
|
-
uri,
|
|
63
|
-
location: {
|
|
64
|
-
line: line || 0,
|
|
65
|
-
column
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
exports.Hook = Hook;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.Meta = void 0;
|
|
8
|
-
var _os = _interopRequireDefault(require("os"));
|
|
9
|
-
var messages = _interopRequireWildcard(require("@cucumber/messages"));
|
|
10
|
-
var _utils = require("../../../utils");
|
|
11
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
|
-
/**
|
|
14
|
-
* Builds meta message.
|
|
15
|
-
* See: https://github.com/cucumber/cucumber-js/blob/main/src/cli/helpers.ts#L100
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
class Meta {
|
|
19
|
-
buildMessage() {
|
|
20
|
-
const playwrightBddVersion = (0, _utils.getPackageVersion)('playwright-bdd');
|
|
21
|
-
const playwrightVersion = (0, _utils.getPackageVersion)('@playwright/test');
|
|
22
|
-
const meta = {
|
|
23
|
-
protocolVersion: messages.version,
|
|
24
|
-
implementation: {
|
|
25
|
-
version: `${playwrightBddVersion} (playwright ${playwrightVersion})`,
|
|
26
|
-
name: 'playwright-bdd'
|
|
27
|
-
},
|
|
28
|
-
cpu: {
|
|
29
|
-
name: _os.default.arch()
|
|
30
|
-
},
|
|
31
|
-
os: {
|
|
32
|
-
name: _os.default.platform(),
|
|
33
|
-
version: _os.default.release()
|
|
34
|
-
},
|
|
35
|
-
runtime: {
|
|
36
|
-
name: 'node.js',
|
|
37
|
-
version: process.versions.node
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
return {
|
|
41
|
-
meta
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
exports.Meta = Meta;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.Pickles = void 0;
|
|
7
|
-
var _utils = require("../../../utils");
|
|
8
|
-
var _Projects = require("./Projects");
|
|
9
|
-
class Pickles {
|
|
10
|
-
buildMessages(testCases) {
|
|
11
|
-
const messages = [];
|
|
12
|
-
testCases.forEach(testCase => {
|
|
13
|
-
messages.push(this.buildPickleMessage(testCase));
|
|
14
|
-
});
|
|
15
|
-
return messages;
|
|
16
|
-
}
|
|
17
|
-
buildPickleMessage(testCase) {
|
|
18
|
-
const pickle = {
|
|
19
|
-
...(0, _utils.omit)(testCase.pickle, 'location'),
|
|
20
|
-
uri: (0, _Projects.getFeatureUriWithProject)(testCase.projectInfo, testCase.pickle.uri)
|
|
21
|
-
};
|
|
22
|
-
return {
|
|
23
|
-
pickle
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
exports.Pickles = Pickles;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.TITLE_SEPARATOR = void 0;
|
|
7
|
-
exports.getFeatureNameWithProject = getFeatureNameWithProject;
|
|
8
|
-
exports.getFeatureUriWithProject = getFeatureUriWithProject;
|
|
9
|
-
exports.getProjectInfo = getProjectInfo;
|
|
10
|
-
var _AutofillMap = require("../../../utils/AutofillMap");
|
|
11
|
-
// title separator used in Playwright
|
|
12
|
-
const TITLE_SEPARATOR = exports.TITLE_SEPARATOR = ' › ';
|
|
13
|
-
const projectsMap = new _AutofillMap.AutofillMap();
|
|
14
|
-
function getProjectInfo(test) {
|
|
15
|
-
const project = test.parent.project();
|
|
16
|
-
const projectId = project === null || project === void 0 ? void 0 : project.name;
|
|
17
|
-
return projectsMap.getOrCreate(projectId, () => {
|
|
18
|
-
return {
|
|
19
|
-
projectName: project === null || project === void 0 ? void 0 : project.name,
|
|
20
|
-
// browserName will be empty if not defined in project
|
|
21
|
-
// todo: get browser info from bddData
|
|
22
|
-
browserName: (project === null || project === void 0 ? void 0 : project.use.browserName) || (project === null || project === void 0 ? void 0 : project.use.defaultBrowserType)
|
|
23
|
-
};
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Returns URI prepended with project name.
|
|
28
|
-
* It allows to separate PW projects runs of the same feature file.
|
|
29
|
-
*
|
|
30
|
-
* Now result should not contain spaces as Cucumber HTML report uses it as uuid.
|
|
31
|
-
* See: https://github.com/cucumber/react-components/issues/344
|
|
32
|
-
*/
|
|
33
|
-
function getFeatureUriWithProject(projectInfo, uri) {
|
|
34
|
-
return projectInfo !== null && projectInfo !== void 0 && projectInfo.projectName && uri ? `[${projectInfo.projectName}]:${uri}` : uri;
|
|
35
|
-
}
|
|
36
|
-
function getFeatureNameWithProject(projectName, featureName) {
|
|
37
|
-
return projectName ? `${projectName}${TITLE_SEPARATOR}${featureName}` : featureName;
|
|
38
|
-
}
|