@zohodesk/testinglibrary 0.4.53-experimental → 0.4.54-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.
|
@@ -6,10 +6,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _page = require("./page");
|
|
8
8
|
var _default = exports.default = {
|
|
9
|
-
|
|
9
|
+
executionContext: async ({
|
|
10
10
|
$tags
|
|
11
11
|
}, use) => {
|
|
12
12
|
let testPortalDetails = (0, _page.getCustomAccountDetails)($tags);
|
|
13
|
-
|
|
13
|
+
let testActorInfo = {
|
|
14
|
+
actorInfo: testPortalDetails
|
|
15
|
+
};
|
|
16
|
+
await use(testActorInfo);
|
|
14
17
|
}
|
|
15
18
|
};
|
|
@@ -11,7 +11,7 @@ var _cacheLayer = _interopRequireDefault(require("./cacheLayer"));
|
|
|
11
11
|
var _addTags = _interopRequireDefault(require("./addTags"));
|
|
12
12
|
var _i18N = _interopRequireDefault(require("./i18N"));
|
|
13
13
|
var _unauthenticatedPage = _interopRequireDefault(require("./unauthenticatedPage"));
|
|
14
|
-
var
|
|
14
|
+
var _executionContext = _interopRequireDefault(require("./executionContext"));
|
|
15
15
|
function extractTagsFromTitle(text) {
|
|
16
16
|
return text.match(/@\w+/g) || [];
|
|
17
17
|
}
|
|
@@ -22,7 +22,7 @@ function getBuiltInFixtures(bddMode) {
|
|
|
22
22
|
..._cacheLayer.default,
|
|
23
23
|
..._i18N.default,
|
|
24
24
|
..._unauthenticatedPage.default,
|
|
25
|
-
...
|
|
25
|
+
..._executionContext.default
|
|
26
26
|
};
|
|
27
27
|
if (bddMode) {
|
|
28
28
|
builtInFixtures = {
|
|
@@ -59,13 +59,13 @@ var _default = exports.default = {
|
|
|
59
59
|
context,
|
|
60
60
|
$tags,
|
|
61
61
|
page,
|
|
62
|
-
|
|
62
|
+
executionContext
|
|
63
63
|
}, use, testInfo) => {
|
|
64
64
|
let testDetails = {
|
|
65
65
|
page,
|
|
66
66
|
$tags,
|
|
67
67
|
context,
|
|
68
|
-
...
|
|
68
|
+
...executionContext.actorInfo
|
|
69
69
|
};
|
|
70
70
|
try {
|
|
71
71
|
//This block is used to skip the login process if the @unauthenticated tag is added to the script
|
|
@@ -80,12 +80,12 @@ var _default = exports.default = {
|
|
|
80
80
|
return;
|
|
81
81
|
}
|
|
82
82
|
const projectName = testInfo.project.name;
|
|
83
|
-
if (
|
|
83
|
+
if (executionContext.actorInfo && projectName !== 'setup' && projectName !== 'cleanup') {
|
|
84
84
|
await context.clearCookies();
|
|
85
85
|
await (0, _auth.performLoginSteps)(testDetails, async testInfo => {
|
|
86
86
|
return await verifyPageIsLoaded(testInfo);
|
|
87
87
|
}, loginSteps);
|
|
88
|
-
process.env.actorInfo = JSON.stringify(
|
|
88
|
+
process.env.actorInfo = JSON.stringify(executionContext.actorInfo);
|
|
89
89
|
}
|
|
90
90
|
} catch (e) {
|
|
91
91
|
console.error('Error during page', e);
|