@zohodesk/testinglibrary 0.2.5 → 0.2.7-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.
@@ -21,7 +21,7 @@ function addHelperLogsForEnvInitialization() {
21
21
  _logger.Logger.log(_logger.Logger.INFO_TYPE, `Please specify --mode='dev/prod' while running ZDTestingFramework test`);
22
22
  _logger.Logger.log(_logger.Logger.INFO_TYPE, `Going to use default mode as dev`);
23
23
  }
24
- function initializeEnvConfig(mode) {
24
+ function initializeEnvConfig(mode, isAuthMode) {
25
25
  try {
26
26
  if (!mode) {
27
27
  addHelperLogsForEnvInitialization();
@@ -33,9 +33,6 @@ function initializeEnvConfig(mode) {
33
33
  ...configJSON,
34
34
  mode
35
35
  });
36
- const {
37
- isAuthMode
38
- } = (0, _readConfigFile.generateConfigFromFile)();
39
36
  if (isAuthMode) {
40
37
  const defaultActorConfiguration = (0, _getUsers.getDefaultActorConf)();
41
38
  setEnvironmentVariables(defaultActorConfiguration);
@@ -31,12 +31,8 @@ function isDevelopmentSetup() {
31
31
  }
32
32
  function getDefaultActorConf() {
33
33
  const {
34
- uatDirectory,
35
- isAuthMode
34
+ uatDirectory
36
35
  } = (0, _readConfigFile.generateConfigFromFile)();
37
- if (!isAuthMode) {
38
- return {};
39
- }
40
36
  const defaultSettingFile = `conf/${getRunMode()}/settings.json`;
41
37
  const filePath = _path.default.join(uatDirectory, defaultSettingFile);
42
38
  if (!(0, _fs.existsSync)(filePath)) {
@@ -53,15 +49,8 @@ function getDefaultActor() {
53
49
  }
54
50
  function getListOfActors() {
55
51
  const {
56
- uatDirectory,
57
- isAuthMode
52
+ uatDirectory
58
53
  } = (0, _readConfigFile.generateConfigFromFile)();
59
- if (!isAuthMode) {
60
- return {
61
- editions: [],
62
- beta: []
63
- };
64
- }
65
54
  const mode = getRunMode();
66
55
  const configFile = `conf/${mode}/actors/index`;
67
56
  const filePath = _path.default.join(uatDirectory, configFile);
@@ -71,12 +60,6 @@ function getListOfActors() {
71
60
  return require(filePath);
72
61
  }
73
62
  function getUserForSelectedEditionAndProfile(preferedEdition, preferredProfile, betaFeature, testDataPortal = null) {
74
- const {
75
- isAuthMode
76
- } = (0, _readConfigFile.generateConfigFromFile)();
77
- if (!isAuthMode) {
78
- return {};
79
- }
80
63
  const {
81
64
  editions: userdata,
82
65
  beta: betaPortals
@@ -23,7 +23,8 @@ const {
23
23
  viewport,
24
24
  featureFilesFolder,
25
25
  stepDefinitionsFolder,
26
- testIdAttribute
26
+ testIdAttribute,
27
+ globalTimeout
27
28
  } = (0, _readConfigFile.generateConfigFromFile)();
28
29
  const projects = (0, _configUtils.getProjects)({
29
30
  browsers,
@@ -52,6 +53,7 @@ const testOptions = (0, _configUtils.getTestUseOptions)({
52
53
  function getPlaywrightConfig() {
53
54
  return {
54
55
  testDir,
56
+ globalTimeout: globalTimeout || 3600000,
55
57
  outputDir: _path.default.join(process.cwd(), 'uat', 'test-results'),
56
58
  fullyParallel: true,
57
59
  forbidOnly: !!process.env.CI,
@@ -98,13 +98,15 @@ function runPlaywright(command, args) {
98
98
  }
99
99
  function main() {
100
100
  const userArgsObject = (0, _parseUserArgs.default)();
101
- (0, _envInitializer.initializeEnvConfig)(userArgsObject.mode);
101
+ const uatConfig = (0, _readConfigFile.generateConfigFromFile)();
102
102
  const {
103
103
  debug,
104
104
  bddMode = false,
105
105
  headless = false,
106
- editionOrder
107
- } = (0, _readConfigFile.generateConfigFromFile)();
106
+ editionOrder,
107
+ isAuthMode
108
+ } = uatConfig;
109
+ (0, _envInitializer.initializeEnvConfig)(userArgsObject.mode, isAuthMode);
108
110
  const tagArgs = (0, _tagProcessor.tagProcessor)(userArgsObject, editionOrder);
109
111
  const playwrightArgs = getPlaywrightArgs(userArgsObject, debug, bddMode, tagArgs, headless);
110
112
  const playwrightPath = _path.default.resolve((0, _rootPath.getExecutableBinaryPath)('playwright'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/testinglibrary",
3
- "version": "0.2.5",
3
+ "version": "0.2.7-experimental",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {
@@ -21,8 +21,6 @@ export default defineConfig({
21
21
  forbidOnly: !!process.env.CI,
22
22
  /* Retry on CI only */
23
23
  retries: process.env.CI ? 2 : 0,
24
- /* Opt out of parallel tests on CI. */
25
- workers: process.env.CI ? 1 : 1,
26
24
  /* Reporter to use. See https://playwright.dev/docs/test-reporters */
27
25
  reporter: [['html', { outputFolder: path.join(process.cwd(), 'uat', 'playwright-report'), open: "always" }]],
28
26
  timeout: 60 * 1000,