@zohodesk/testinglibrary 0.4.82-n18-experimental → 0.4.84-n18-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/.gitlab-ci.yml CHANGED
@@ -160,19 +160,4 @@ uat-smoketest:
160
160
  paths:
161
161
  - examples/uat/playwright-report
162
162
 
163
- uat-data_generator:
164
- stage: uat
165
- script:
166
- - cd examples
167
- - npm install $(npm pack ../../testing-framework | tail -1)
168
- - output=$(npm run uat-data_generator)
169
- - echo "$output"
170
- - node ../ValidateUATReport.js examples
171
-
172
- artifacts:
173
- when: always
174
- paths:
175
- - examples/uat/playwright-report
176
-
177
-
178
-
163
+
package/README.md CHANGED
@@ -12,12 +12,68 @@
12
12
  ### Run TestCase
13
13
 
14
14
  - npm run test
15
+
15
16
  ### Generate Report
16
17
 
17
18
  - npm run report
18
19
 
19
20
  ## Version History
20
21
 
22
+ ### v3.2.6 - 02-09-2025
23
+
24
+ #### Feature
25
+
26
+ - Multi-actor execution support – now possible to switch between multiple profile agents within scenarios using the new `actorCtx` custom fixture.
27
+
28
+ ### v3.2.5 - 28-08-2025
29
+
30
+ #### Enhancement
31
+
32
+ - Removed the searchFake dependency from the project level and adopted it inside the framework, reducing project-side maintenance.
33
+
34
+ ### v3.2.4 - 29-07-2025
35
+
36
+ #### Feature
37
+ - Data Generator steps are now supported directly via the framework.
38
+
39
+ ### Bug fix
40
+ - Feature File Root Directory not found issue fixed
41
+
42
+ ### v3.2.3 - 29-07-2025
43
+
44
+ #### Feature
45
+ - Added support for running Smoke Tests in the UAT stage.
46
+
47
+ ### v3.2.0 - 22-06-2025
48
+
49
+ #### Feature
50
+ - Default required spec files are now auto-imported from the library into the project.
51
+
52
+ ### v3.1.13 - 02-07-2025
53
+
54
+ #### Enhancement
55
+ - Below package versions are updated in this release.
56
+ - @cucumber/Cucumber - 11.3.0
57
+ - Playwright/test - 1.53.2
58
+ - Playwright - 1.53.2
59
+ - Playwright-bdd - 8.3.1
60
+ - QC custom reporter changes have been adopted into the framework.
61
+
62
+ ### v3.1.5 - 22-05-2025
63
+
64
+ #### Feature
65
+ - Added support for Module Based Execution UAT stage.
66
+
67
+ ### v3.1.4 - 12-05-2025
68
+
69
+ #### Enhancement
70
+ - Playwright version 1.52.0 adopted in testing framework
71
+
72
+ ### v3.1.3 - 25-04-2025
73
+
74
+ #### Enhancement
75
+ - Playwright version 1.51.0 adopted in testing framework
76
+
21
77
  ### v0.2.8 - 26-09-2024
22
78
 
23
79
  #### Feature
@@ -27,8 +83,6 @@
27
83
  - Updated the custom-reported to include the errors in tests during the executions. It will help us avoid the stage passed without the actual test execution.
28
84
 
29
85
 
30
- ## Version History
31
-
32
86
  ### v3.0.8 - 25-12-2024
33
87
 
34
88
  #### Enhancement
@@ -1,20 +1,13 @@
1
1
  "use strict";
2
2
 
3
- // import { createBdd , test } from '@zohodesk/testinglibrary';
4
- // import DataGenerator from '@zohodesk/testinglibrary/DataGenerator';
5
- // import { generateAndCacheTestData } from './DataGeneratorStepsHelper';
6
-
7
- // const { Given } = createBdd();
8
-
9
- const {
10
- createBdd
11
- } = require("@zohodesk/testinglibrary");
12
- const {
13
- generateAndCacheTestData
14
- } = require("./DataGeneratorStepsHelper");
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _testinglibrary = require("@zohodesk/testinglibrary");
5
+ var _DataGenerator = _interopRequireDefault(require("@zohodesk/testinglibrary/DataGenerator"));
6
+ var _DataGeneratorStepsHelper = require("./DataGeneratorStepsHelper");
15
7
  const {
16
8
  Given
17
- } = createBdd();
9
+ } = (0, _testinglibrary.createBdd)();
10
+ const dataGenerator = new _DataGenerator.default();
18
11
  Given('generate a {string} entity {string} with generator {string}', async ({
19
12
  page,
20
13
  context,
@@ -22,7 +15,7 @@ Given('generate a {string} entity {string} with generator {string}', async ({
22
15
  cacheLayer,
23
16
  executionContext
24
17
  }, module, entityName, generatorName, dataTable) => {
25
- await generateAndCacheTestData(executionContext, "template", generatorName, dataTable, cacheLayer, entityName);
18
+ await (0, _DataGeneratorStepsHelper.generateAndCacheTestData)(executionContext, "template", generatorName, dataTable, cacheLayer, entityName);
26
19
  });
27
20
  Given('generate a {string} entity {string} with API {string}', async ({
28
21
  page,
@@ -31,7 +24,7 @@ Given('generate a {string} entity {string} with API {string}', async ({
31
24
  cacheLayer,
32
25
  executionContext
33
26
  }, module, entityName, operationId, dataTable) => {
34
- await generateAndCacheTestData(executionContext, "API", operationId, dataTable, cacheLayer, entityName);
27
+ await (0, _DataGeneratorStepsHelper.generateAndCacheTestData)(executionContext, "API", operationId, dataTable, cacheLayer, entityName);
35
28
  });
36
29
  Given('generate a {string} entity {string} with generator {string} using {string} profile', async ({
37
30
  page,
@@ -40,7 +33,7 @@ Given('generate a {string} entity {string} with generator {string} using {string
40
33
  cacheLayer,
41
34
  executionContext
42
35
  }, module, entityName, generatorName, profile, dataTable) => {
43
- await generateAndCacheTestData(executionContext, "template", generatorName, dataTable, cacheLayer, entityName, profile);
36
+ await (0, _DataGeneratorStepsHelper.generateAndCacheTestData)(executionContext, "template", generatorName, dataTable, cacheLayer, entityName, profile);
44
37
  });
45
38
  Given('generate a {string} entity {string} with API {string} using {string} profile', async ({
46
39
  page,
@@ -49,5 +42,5 @@ Given('generate a {string} entity {string} with API {string} using {string} prof
49
42
  cacheLayer,
50
43
  executionContext
51
44
  }, module, entityName, operationId, profile, dataTable) => {
52
- await generateAndCacheTestData(executionContext, "API", operationId, dataTable, cacheLayer, entityName, profile);
45
+ await (0, _DataGeneratorStepsHelper.generateAndCacheTestData)(executionContext, "API", operationId, dataTable, cacheLayer, entityName, profile);
53
46
  });
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.generateAndCacheTestData = generateAndCacheTestData;
7
8
  var _testinglibrary = require("@zohodesk/testinglibrary");
8
- // import DataGenerator from '@zohodesk/testinglibrary/DataGenerator';
9
- const DataGenerator = require("@zohodesk/testinglibrary/DataGenerator").default;
10
- const dataGenerator = new DataGenerator();
9
+ var _DataGenerator = _interopRequireDefault(require("@zohodesk/testinglibrary/DataGenerator"));
10
+ const dataGenerator = new _DataGenerator.default();
11
11
  async function generateAndCacheTestData(executionContext, type, identifier, dataTable, cacheLayer, entityName, profile = null) {
12
12
  let actorInfo;
13
13
  const testInfo = _testinglibrary.test.info();
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ var _testinglibrary = require("@zohodesk/testinglibrary");
4
+ const {
5
+ BeforeScenario,
6
+ Given
7
+ } = (0, _testinglibrary.createBdd)();
8
+ BeforeScenario(async function ({
9
+ actorCtx,
10
+ page,
11
+ context,
12
+ browser,
13
+ executionContext
14
+ }) {
15
+ // This will run before each scenario and set all the fixtures into this context
16
+ this.page = page;
17
+ this.context = context;
18
+ this.browser = browser;
19
+ this.executionContext = executionContext;
20
+ this.setActor = async role => {
21
+ const userPage = actorCtx.userPages.find(up => up.role === role);
22
+ if (userPage) {
23
+ this.page = userPage.page;
24
+ this.context = userPage.context;
25
+ this.browser = userPage.browser;
26
+ this.executionContext = userPage.actorInfo;
27
+ } else {
28
+ throw new Error(`Actor ${role} not found`);
29
+ }
30
+ };
31
+ });
32
+ Given("switch to {string} profile user page", async function ({
33
+ page
34
+ }, userRole) {
35
+ await this.setActor(userRole);
36
+ });
@@ -71,9 +71,7 @@ async function _generateAPIGenerator(operationId) {
71
71
  }];
72
72
  }
73
73
  async function _constructApiPayload(scenarioName, processedGenerators, actorInfo) {
74
- const orgOauth = actorInfo['org_oauth'] || {};
75
74
  const dataGeneratorConfig = actorInfo['data-generator'] || {};
76
- dataGeneratorConfig.account.org_oauth = orgOauth;
77
75
  const apiPayload = {
78
76
  scenario_name: scenarioName,
79
77
  data_generation_templates: processedGenerators,
@@ -29,31 +29,19 @@ async function processGenerator(generators, dataTable) {
29
29
  return generator;
30
30
  });
31
31
  }
32
- async function makeRequest(url, payload, timeoutMs = 30000) {
33
- const controller = new AbortController();
34
- const timeoutId = setTimeout(() => controller.abort(), timeoutMs);
35
- try {
36
- const response = await fetch(url, {
37
- method: 'POST',
38
- headers: {
39
- 'Content-Type': 'application/json'
40
- },
41
- body: JSON.stringify(payload),
42
- signal: controller.signal
43
- });
44
- clearTimeout(timeoutId);
45
- if (!response.ok) {
46
- const errorBody = await response.text();
47
- throw new Error(`HTTP error! status: ${response.status}, body: ${errorBody}`);
48
- }
49
- return response.json();
50
- } catch (error) {
51
- clearTimeout(timeoutId);
52
- if (error.name === 'AbortError') {
53
- throw new Error(`Request timeout after ${timeoutMs}ms`);
54
- }
55
- throw error;
32
+ async function makeRequest(url, payload) {
33
+ const response = await fetch(url, {
34
+ method: 'POST',
35
+ headers: {
36
+ 'Content-Type': 'application/json'
37
+ },
38
+ body: JSON.stringify(payload)
39
+ });
40
+ if (!response.ok) {
41
+ const errorBody = await response.text();
42
+ throw new Error(`HTTP error! status: ${response.status}, body: ${errorBody}`);
56
43
  }
44
+ return response.json();
57
45
  }
58
46
  async function getGeneratorFilePath(featureFile) {
59
47
  let generatorPath = featureFile.replace(".features-gen/", "");
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _logger = require("../../../utils/logger");
8
+ var _customFixturesHelper = require("../helpers/customFixturesHelper");
9
+ class actorContext {
10
+ constructor() {
11
+ this.page = null;
12
+ this.browser = null;
13
+ this.context = null;
14
+ this.actorInfo = null;
15
+ this.userPages = [];
16
+ this.actorsList = {};
17
+ }
18
+ async setupAdditionalActors(browser, $tags, testInfo, defaultPage, defaultContext) {
19
+ const actorInfoMap = (0, _customFixturesHelper.getCustomAccountDetails)($tags);
20
+ const currentActor = actorInfoMap.additional;
21
+ await Promise.all(Object.entries(currentActor).map(async ([role, actorInfo], index) => {
22
+ let context, page;
23
+ if (index === 0) {
24
+ context = defaultContext;
25
+ page = defaultPage;
26
+ } else {
27
+ context = await browser.newContext();
28
+ page = await context.newPage();
29
+ }
30
+ let ctxTestDetails = {
31
+ page,
32
+ $tags,
33
+ context,
34
+ ...actorInfo
35
+ };
36
+ await (0, _customFixturesHelper.executeDefaultLoginSteps)(context, testInfo, ctxTestDetails, actorInfo);
37
+ this.actorsList[role] = {
38
+ role,
39
+ browser,
40
+ context,
41
+ page,
42
+ actorInfo,
43
+ isPrimary: index === 0
44
+ };
45
+ await this.addUserPage(role, browser, page, context, actorInfo);
46
+ }));
47
+ for (const actorObj of Object.values(this.actorsList)) {
48
+ await (0, _customFixturesHelper.performDefaultPageSteps)({
49
+ context: actorObj.context,
50
+ page: actorObj.page,
51
+ $tags,
52
+ ...actorObj.actorInfo
53
+ });
54
+ }
55
+ }
56
+ async addUserPage(role, browser, page, context, actorInfo) {
57
+ this.userPages.push({
58
+ role,
59
+ browser,
60
+ page,
61
+ context,
62
+ actorInfo
63
+ });
64
+ }
65
+ async cleanup() {
66
+ for (const actor of Object.values(this.actorsList)) {
67
+ if (!actor.isPrimary && actor.context) {
68
+ try {
69
+ await actor.context.close();
70
+ } catch (error) {
71
+ _logger.Logger.log(_logger.Logger.FAILURE_TYPE, `Failed to close context for actor ${actor.role}:`, error);
72
+ }
73
+ }
74
+ }
75
+ }
76
+ }
77
+ var _default = exports.default = {
78
+ actorCtx: async ({
79
+ $tags,
80
+ browser,
81
+ context,
82
+ page
83
+ }, use, testInfo) => {
84
+ const ctxObject = new actorContext();
85
+ await ctxObject.setupAdditionalActors(browser, $tags, testInfo, page, context);
86
+ await use(ctxObject);
87
+ await ctxObject.cleanup();
88
+ }
89
+ };
@@ -4,14 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _page = require("./page");
7
+ var _customFixturesHelper = require("../helpers/customFixturesHelper");
8
8
  var _default = exports.default = {
9
9
  executionContext: async ({
10
10
  $tags
11
11
  }, use) => {
12
- let testPortalActorDetails = {
13
- actorInfo: (0, _page.getCustomAccountDetails)($tags)
14
- };
15
- await use(testPortalActorDetails);
12
+ const allActorsObj = (0, _customFixturesHelper.getCustomAccountDetails)($tags);
13
+ const currentActor = allActorsObj.main;
14
+ await use(currentActor);
16
15
  }
17
16
  };
@@ -12,12 +12,14 @@ var _addTags = _interopRequireDefault(require("./addTags"));
12
12
  var _i18N = _interopRequireDefault(require("./i18N"));
13
13
  var _unauthenticatedPage = _interopRequireDefault(require("./unauthenticatedPage"));
14
14
  var _executionContext = _interopRequireDefault(require("./executionContext"));
15
+ var _actorCtx = _interopRequireDefault(require("./actorCtx"));
15
16
  function extractTagsFromTitle(text) {
16
17
  return text.match(/@\w+/g) || [];
17
18
  }
18
19
  function getBuiltInFixtures(bddMode) {
19
20
  let builtInFixtures = {
20
21
  ..._page.default,
22
+ ..._actorCtx.default,
21
23
  ..._context.default,
22
24
  ..._cacheLayer.default,
23
25
  ..._i18N.default,
@@ -4,58 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- exports.getCustomAccountDetails = getCustomAccountDetails;
8
- var _auth = require("../helpers/auth");
9
- var _readConfigFile = require("../readConfigFile");
7
+ var _customFixturesHelper = require("../helpers/customFixturesHelper");
10
8
  /* eslint-disable global-require */
11
-
12
- //import { additionProfiles } from '../helpers/additionalProfiles';
13
-
14
- function getTagInputFromSelectedTags(tags, inputString) {
15
- const selectedTag = [...tags].reverse().find(tag => tag.startsWith(inputString));
16
- let tagInput = null;
17
- if (selectedTag) {
18
- tagInput = selectedTag.split(`${inputString}_`).pop().toLowerCase();
19
- }
20
- return tagInput;
21
- }
22
- function getCustomAccountDetails(tags) {
23
- const tagsTobeFiltered = ['@profile', '@edition', '@beta', '@portal', '@additional_profile'];
24
- const filteredTags = tags.filter(tag => tagsTobeFiltered.some(prefix => tag.startsWith(prefix)));
25
- if (filteredTags && filteredTags.length > 0) {
26
- const portalInfo = getTagInputFromSelectedTags(filteredTags, '@portal');
27
- const betaFeature = getTagInputFromSelectedTags(filteredTags, '@beta');
28
- const profileInfo = getTagInputFromSelectedTags(filteredTags, '@profile');
29
- const editionInfo = getTagInputFromSelectedTags(filteredTags, '@edition');
30
- const user = (0, _auth.getUserForSelectedEditionAndProfile)(editionInfo, profileInfo, betaFeature, portalInfo);
31
- return user;
32
- }
33
- return (0, _auth.getDefaultActor)();
34
- }
35
- const {
36
- testSetup
37
- } = (0, _readConfigFile.generateConfigFromFile)();
38
- async function loginSteps(pageDetail) {
39
- const {
40
- page
41
- } = pageDetail;
42
- if (testSetup.loginSteps && typeof testSetup.loginSteps === 'function') {
43
- return await testSetup.loginSteps(pageDetail);
44
- } else {
45
- await page.goto(process.env.domain);
46
- }
47
- }
48
- async function performDefaultPageSteps(testInfo) {
49
- if (testSetup.page && typeof testSetup.page === 'function') {
50
- await testSetup.page(testInfo);
51
- }
52
- }
53
- async function verifyPageIsLoaded(testInfo) {
54
- if (testSetup.validateLogin && typeof testSetup.validateLogin === 'function') {
55
- return await testSetup.validateLogin(testInfo);
56
- }
57
- return true;
58
- }
59
9
  var _default = exports.default = {
60
10
  page: async ({
61
11
  context,
@@ -63,7 +13,7 @@ var _default = exports.default = {
63
13
  page,
64
14
  executionContext
65
15
  }, use, testInfo) => {
66
- let testPortalDetails = executionContext.actorInfo;
16
+ let testPortalDetails = executionContext;
67
17
  let testDetails = {
68
18
  page,
69
19
  $tags,
@@ -76,24 +26,11 @@ var _default = exports.default = {
76
26
  await context.clearCookies();
77
27
  return;
78
28
  }
79
- const {
80
- isAuthMode
81
- } = (0, _readConfigFile.generateConfigFromFile)();
82
- if (!isAuthMode) {
83
- return;
84
- }
85
- const projectName = testInfo.project.name;
86
- if (testPortalDetails && projectName !== 'setup' && projectName !== 'cleanup') {
87
- await context.clearCookies();
88
- await (0, _auth.performLoginSteps)(testDetails, async testInfo => {
89
- return await verifyPageIsLoaded(testInfo);
90
- }, loginSteps);
91
- process.env.actorInfo = JSON.stringify(testPortalDetails);
92
- }
29
+ await (0, _customFixturesHelper.executeDefaultLoginSteps)(context, testInfo, testDetails, testPortalDetails);
93
30
  } catch (e) {
94
31
  console.error('Error during page', e);
95
32
  } finally {
96
- await performDefaultPageSteps(testDetails);
33
+ await (0, _customFixturesHelper.performDefaultPageSteps)(testDetails);
97
34
  await use(page);
98
35
  await context.close();
99
36
  }
@@ -0,0 +1,96 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.executeDefaultLoginSteps = executeDefaultLoginSteps;
7
+ exports.getCustomAccountDetails = getCustomAccountDetails;
8
+ exports.loginSteps = loginSteps;
9
+ exports.performDefaultPageSteps = performDefaultPageSteps;
10
+ exports.verifyPageIsLoaded = verifyPageIsLoaded;
11
+ var _auth = require("../helpers/auth");
12
+ var _additionalProfiles = require("../helpers/additionalProfiles");
13
+ var _readConfigFile = require("../readConfigFile");
14
+ var _logger = require("../../../utils/logger");
15
+ /* eslint-disable global-require */
16
+
17
+ let {
18
+ testSetup,
19
+ isAuthMode
20
+ } = (0, _readConfigFile.generateConfigFromFile)();
21
+ function getTagInputFromSelectedTags(tags, inputString) {
22
+ const selectedTag = [...tags].reverse().find(tag => tag.startsWith(inputString));
23
+ let tagInput = null;
24
+ if (selectedTag) {
25
+ tagInput = selectedTag.split(`${inputString}_`).pop().toLowerCase();
26
+ }
27
+ return tagInput;
28
+ }
29
+ function getCustomAccountDetails(tags) {
30
+ try {
31
+ const tagsTobeFiltered = ['@profile', '@edition', '@beta', '@portal', '@additional_profile'];
32
+ const filteredTags = tags.filter(tag => tagsTobeFiltered.some(prefix => tag.startsWith(prefix)));
33
+ if (filteredTags && filteredTags.length > 0) {
34
+ const portalInfo = getTagInputFromSelectedTags(filteredTags, '@portal');
35
+ const betaFeature = getTagInputFromSelectedTags(filteredTags, '@beta');
36
+ const profileInfo = getTagInputFromSelectedTags(filteredTags, '@profile');
37
+ const editionInfo = getTagInputFromSelectedTags(filteredTags, '@edition');
38
+ const mainActor = (0, _auth.getUserForSelectedEditionAndProfile)(editionInfo, profileInfo, betaFeature, portalInfo);
39
+ const additionalProfileActors = (0, _additionalProfiles.additionProfiles)(tags, editionInfo, betaFeature, portalInfo);
40
+ const additionalProfileTags = tags.filter(tag => tag.startsWith('@additional_profile_'));
41
+ const additionalActors = {};
42
+ additionalProfileTags.forEach((tag, index) => {
43
+ const profileName = tag.replace('@additional_profile_', '');
44
+ additionalActors[profileName] = additionalProfileActors[index];
45
+ });
46
+ return {
47
+ main: mainActor,
48
+ additional: additionalActors
49
+ };
50
+ }
51
+ return {
52
+ main: (0, _auth.getDefaultActor)(),
53
+ additional: {}
54
+ };
55
+ } catch (err) {
56
+ _logger.Logger.log(_logger.Logger.FAILURE_TYPE, 'Error while getting custom account details:', err);
57
+ }
58
+ }
59
+ async function loginSteps(pageDetail) {
60
+ const {
61
+ page
62
+ } = pageDetail;
63
+ if (testSetup.loginSteps && typeof testSetup.loginSteps === 'function') {
64
+ return await testSetup.loginSteps(pageDetail);
65
+ } else {
66
+ await page.goto(process.env.domain);
67
+ }
68
+ }
69
+ async function performDefaultPageSteps(testInfo) {
70
+ if (testSetup.page && typeof testSetup.page === 'function') {
71
+ await testSetup.page(testInfo);
72
+ }
73
+ }
74
+ async function verifyPageIsLoaded(testInfo) {
75
+ if (testSetup.validateLogin && typeof testSetup.validateLogin === 'function') {
76
+ return await testSetup.validateLogin(testInfo);
77
+ }
78
+ return true;
79
+ }
80
+ async function executeDefaultLoginSteps(context, testInfo, testDetails, testPortalDetails) {
81
+ if (!isAuthMode) {
82
+ return;
83
+ }
84
+ try {
85
+ const projectName = testInfo.project.name;
86
+ if (testPortalDetails && projectName !== 'setup' && projectName !== 'cleanup') {
87
+ await context.clearCookies();
88
+ await (0, _auth.performLoginSteps)(testDetails, async testInfo => {
89
+ return await verifyPageIsLoaded(testInfo);
90
+ }, loginSteps);
91
+ process.env.actorInfo = JSON.stringify(testPortalDetails);
92
+ }
93
+ } catch (error) {
94
+ _logger.Logger.log(_logger.Logger.FAILURE_TYPE, 'Error while executing the default login steps:', error);
95
+ }
96
+ }
@@ -1,27 +1,29 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _page = require("../../../../../core/playwright/builtInFixtures/page");
4
+ var _customFixturesHelper = require("../../../../../core/playwright/helpers/customFixturesHelper");
5
5
  var _executionContext = _interopRequireDefault(require("../../../../../core/playwright/builtInFixtures/executionContext"));
6
- jest.mock('../../../../../core/playwright/builtInFixtures/page');
6
+ jest.mock('../../../../../core/playwright/helpers/customFixturesHelper');
7
7
  describe('executionContext', () => {
8
8
  test('should pass actorInfo with details from getCustomAccountDetails to use', async () => {
9
9
  const mockTags = ['tag1', 'tag2'];
10
- const mockActorInfo = {
10
+ const mockMainActorInfo = {
11
11
  id: '1',
12
12
  edition: 'enterprise',
13
13
  orgName: 'orgName',
14
14
  profile: 'admin',
15
15
  email: 'xxx.x+uat@zohotest.com'
16
16
  };
17
- _page.getCustomAccountDetails.mockReturnValue(mockActorInfo);
17
+ const mockActorInfo = {
18
+ main: mockMainActorInfo,
19
+ additional: {}
20
+ };
21
+ _customFixturesHelper.getCustomAccountDetails.mockReturnValue(mockActorInfo);
18
22
  const use = jest.fn();
19
23
  await _executionContext.default.executionContext({
20
24
  $tags: mockTags
21
25
  }, use);
22
- expect(_page.getCustomAccountDetails).toHaveBeenCalledWith(mockTags);
23
- expect(use).toHaveBeenCalledWith({
24
- actorInfo: mockActorInfo
25
- });
26
+ expect(_customFixturesHelper.getCustomAccountDetails).toHaveBeenCalledWith(mockTags);
27
+ expect(use).toHaveBeenCalledWith(mockMainActorInfo);
26
28
  });
27
29
  });