@zohodesk/testinglibrary 0.3.7-experimental → 0.3.9-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/README.md CHANGED
@@ -24,4 +24,9 @@
24
24
  - Added support for writing unitcases for framework implementations
25
25
 
26
26
  ### Bug fix
27
- - 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.
27
+ - 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
+
29
+ ### v0.2.9 - 08-10-2024
30
+
31
+ #### Feature
32
+ - Added support for scenario level tag support
@@ -11,7 +11,7 @@ var _readConfigFile = require("../readConfigFile");
11
11
  /* eslint-disable global-require */
12
12
 
13
13
  function getTagInputFromSelectedTags(tags, inputString) {
14
- const selectedTag = tags.find(tag => tag.startsWith(inputString));
14
+ const selectedTag = [...tags].reverse().find(tag => tag.startsWith(inputString));
15
15
  let tagInput = null;
16
16
  if (selectedTag) {
17
17
  tagInput = selectedTag.split(`${inputString}_`).pop().toLowerCase();
@@ -19,6 +19,8 @@ function getDefaultConfig() {
19
19
  uatDirectory: _path.default.join(process.cwd(), 'uat'),
20
20
  headless: false,
21
21
  browsers: ['Chrome'],
22
+ forbidOnly: false,
23
+ retries: 0,
22
24
  trace: false,
23
25
  video: false,
24
26
  isAuthMode: false,
@@ -9,6 +9,15 @@ var _test = require("@playwright/test");
9
9
  var _path = _interopRequireDefault(require("path"));
10
10
  var _readConfigFile = require("../readConfigFile");
11
11
  var _configUtils = require("./config-utils");
12
+ var _Configuration = _interopRequireDefault(require("./../configuration/Configuration"));
13
+ var _UserArgs = _interopRequireDefault(require("./../configuration/UserArgs"));
14
+ var _ConfigurationHelper = require("../configuration/ConfigurationHelper");
15
+ // overriding the application config's from project
16
+ const uatConfig = new _Configuration.default((0, _ConfigurationHelper.getApplicationConfig)());
17
+ const userArgConfig = new _Configuration.default(_UserArgs.default.parseToObject(process.argv.slice(2)));
18
+
19
+ // overriding the user config's from CLI
20
+ uatConfig.addAll(userArgConfig);
12
21
  const {
13
22
  browsers,
14
23
  trace,
@@ -25,7 +34,7 @@ const {
25
34
  stepDefinitionsFolder,
26
35
  testIdAttribute,
27
36
  globalTimeout
28
- } = (0, _readConfigFile.generateConfigFromFile)();
37
+ } = uatConfig.getAll();
29
38
  const projects = (0, _configUtils.getProjects)({
30
39
  browsers,
31
40
  isAuthMode,
@@ -51,13 +60,12 @@ const testOptions = (0, _configUtils.getTestUseOptions)({
51
60
  * @returns {import('@playwright/test').PlaywrightTestConfig}
52
61
  */
53
62
  function getPlaywrightConfig() {
54
- return {
63
+ const playwrightConfig = {
55
64
  testDir,
56
65
  globalTimeout: globalTimeout || 3600000,
57
66
  outputDir: _path.default.join(process.cwd(), 'uat', 'test-results'),
58
67
  fullyParallel: true,
59
- forbidOnly: !!process.env.CI,
60
- retries: process.env.CI ? 2 : 0,
68
+ forbidOnly: false,
61
69
  reporter: [['html', {
62
70
  outputFolder: reportPath,
63
71
  open: openReportOn
@@ -76,7 +84,9 @@ function getPlaywrightConfig() {
76
84
  name: 'cleanup',
77
85
  testMatch: /.*\.teardown\.js/,
78
86
  testDir: _path.default.join(process.cwd(), 'uat')
79
- }, ...projects] : [...projects]
87
+ }, ...projects] : [...projects],
88
+ ...uatConfig.getAll()
80
89
  };
90
+ return playwrightConfig;
81
91
  }
82
92
  var _default = exports.default = (0, _test.defineConfig)(getPlaywrightConfig());
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/testinglibrary",
3
- "version": "0.3.7-experimental",
3
+ "version": "0.3.8-experimental",
4
4
  "lockfileVersion": 1,
5
5
  "requires": true,
6
6
  "dependencies": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/testinglibrary",
3
- "version": "0.3.7-experimental",
3
+ "version": "0.3.9-experimental",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {
@@ -18,7 +18,7 @@ export default defineConfig({
18
18
  /* Run tests in files in parallel */
19
19
  fullyParallel: true,
20
20
  /* Fail the build on CI if you accidentally left test.only in the source code. */
21
- forbidOnly: !!process.env.CI,
21
+ //forbidOnly: !!process.env.CI,
22
22
  /* Retry on CI only */
23
23
  retries: process.env.CI ? 2 : 0,
24
24
  /* Reporter to use. See https://playwright.dev/docs/test-reporters */