artes 1.0.20 → 1.0.22

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.
@@ -17,7 +17,7 @@ try {
17
17
  module.exports = {
18
18
  default: {
19
19
  // File paths and patterns
20
- cucumberTimeout: artesConfig.timeout || 30, // Default timeout in milliseconds
20
+ timeout: artesConfig.timeout || 30, // Default timeout in milliseconds
21
21
  paths: artesConfig.features
22
22
  ? path.join(moduleConfig.projectPath, artesConfig.features)
23
23
  : [moduleConfig.featuresPath], // Paths to feature files
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "artes",
3
- "version": "1.0.20",
3
+ "version": "1.0.22",
4
4
  "description": "The package provide step definitions and user writes feature files, and the package handles automation, with optional POM files and custom step definitions.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -21,8 +21,11 @@ class Elements {
21
21
  this.elements?.[element]?.split("=")[1] ||
22
22
  element?.split("=")[1];
23
23
 
24
- const locator = [selectorType, selector];
25
-
24
+ const locator = [
25
+ selectorType.trim(),
26
+ selector != undefined ? selector.trim() : selector
27
+ ];
28
+
26
29
  const waitTime = this.elements[element]?.waitTime * 1000 || 0;
27
30
 
28
31
  switch (locator[0]) {
@@ -4,7 +4,6 @@ const {
4
4
  After,
5
5
  Status,
6
6
  setDefaultTimeout,
7
- AfterAll,
8
7
  } = require("@cucumber/cucumber");
9
8
  const { invokeBrowser } = require("../helper/contextManager/browserManager");
10
9
  const { invokeRequest } = require("../helper/contextManager/requestManager");
@@ -16,7 +15,7 @@ const fs = require("fs");
16
15
  let browser;
17
16
  let request;
18
17
 
19
- setDefaultTimeout(cucumberConfig.default.cucumberTimeout * 1000);
18
+ setDefaultTimeout(cucumberConfig.default.timeout * 1000);
20
19
 
21
20
  BeforeAll(async function () {
22
21
  pomCollector();
@@ -25,8 +24,12 @@ BeforeAll(async function () {
25
24
  Before(async function () {
26
25
  browser = await invokeBrowser();
27
26
  request = await invokeRequest();
27
+
28
28
  context.page = await browser.newPage();
29
+ await context.page.setDefaultTimeout(cucumberConfig.default.timeout * 1000);
30
+
29
31
  context.request = await request;
32
+
30
33
  await browser.tracing.start({
31
34
  sources: true,
32
35
  screenshots: true,
@@ -55,5 +58,3 @@ After(async function ({ pickle, result }) {
55
58
  await this.attach(webmBuffer, "video/webm");
56
59
  }
57
60
  });
58
-
59
- AfterAll(function () {});