codeceptjs 3.6.3-beta.3 → 3.6.3

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.
@@ -70,7 +70,7 @@ module.exports = function (genPath) {
70
70
  }
71
71
 
72
72
  config.gherkin = {
73
- features: "./features/*.feature",
73
+ features: './features/*.feature',
74
74
  steps: [`./step_definitions/steps.${extension}`],
75
75
  };
76
76
 
@@ -104,9 +104,7 @@ module.exports = function (config) {
104
104
  recorder.session.restore(`retryTo ${tries}`);
105
105
  if (tries <= maxTries) {
106
106
  debug(`Error ${err}... Retrying`);
107
- recorder.add(`retryTo ${tries}`, () =>
108
- setTimeout(tryBlock, pollInterval)
109
- );
107
+ recorder.add(`retryTo ${tries}`, () => setTimeout(tryBlock, pollInterval));
110
108
  } else {
111
109
  // if maxTries reached
112
110
  handleRetryException(err);
@@ -73,6 +73,10 @@ module.exports = function (config) {
73
73
  }
74
74
 
75
75
  event.dispatcher.on(event.test.failed, (test) => {
76
+ if (test.ctx?._runnable.title.includes('hook: ')) {
77
+ output.plugin('screenshotOnFail', 'BeforeSuite/AfterSuite do not have any access to the browser, hence it could not take screenshot.');
78
+ return;
79
+ }
76
80
  recorder.add('screenshot of failed test', async () => {
77
81
  let fileName = clearString(test.title);
78
82
  const dataType = 'image/png';
@@ -99,12 +99,12 @@ module.exports = function (config) {
99
99
  currentTest = test;
100
100
  });
101
101
 
102
- event.dispatcher.on(event.step.failed, persistStep);
103
-
104
- event.dispatcher.on(event.step.after, (step) => {
102
+ event.dispatcher.on(event.step.failed, (step) => {
105
103
  recorder.add('screenshot of failed test', async () => persistStep(step), true);
106
104
  });
107
105
 
106
+ event.dispatcher.on(event.step.after, persistStep);
107
+
108
108
  event.dispatcher.on(event.test.passed, (test) => {
109
109
  if (!config.deleteSuccessful) return persist(test);
110
110
  // cleanup
@@ -112,8 +112,10 @@ module.exports = function (config) {
112
112
  });
113
113
 
114
114
  event.dispatcher.on(event.test.failed, (test, err) => {
115
- // BeforeSuite/AfterSuite don't have any access to the browser, hence it could not take screenshot.
116
- if (test.ctx._runnable.title.includes('hook: BeforeSuite')) return;
115
+ if (test.ctx._runnable.title.includes('hook: ')) {
116
+ output.plugin('stepByStepReport', 'BeforeSuite/AfterSuite do not have any access to the browser, hence it could not take screenshot.');
117
+ return;
118
+ }
117
119
  persist(test, err);
118
120
  });
119
121
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeceptjs",
3
- "version": "3.6.3-beta.3",
3
+ "version": "3.6.3",
4
4
  "description": "Supercharged End 2 End Testing Framework for NodeJS",
5
5
  "keywords": [
6
6
  "acceptance",
@@ -179,4 +179,4 @@
179
179
  "strict": false
180
180
  }
181
181
  }
182
- }
182
+ }
@@ -1154,8 +1154,6 @@ declare namespace CodeceptJS {
1154
1154
  *
1155
1155
  * ## Methods
1156
1156
  */
1157
- // @ts-ignore
1158
- // @ts-ignore
1159
1157
  class ExpectHelper {
1160
1158
  expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1161
1159
  expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
@@ -1267,8 +1265,6 @@ declare namespace CodeceptJS {
1267
1265
  *
1268
1266
  * ## Methods
1269
1267
  */
1270
- // @ts-ignore
1271
- // @ts-ignore
1272
1268
  class ExpectHelper {
1273
1269
  expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1274
1270
  expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
@@ -1940,8 +1936,6 @@ declare namespace CodeceptJS {
1940
1936
  * @property [host = "0.0.0.0"] - Mock server host
1941
1937
  * @property [httpsOpts] - key & cert values are the paths to .key and .crt files
1942
1938
  */
1943
- // @ts-ignore
1944
- // @ts-ignore
1945
1939
  type MockServerConfig = {
1946
1940
  port?: number;
1947
1941
  host?: string;
@@ -2066,8 +2060,6 @@ declare namespace CodeceptJS {
2066
2060
  *
2067
2061
  * ## Methods
2068
2062
  */
2069
- // @ts-ignore
2070
- // @ts-ignore
2071
2063
  class MockServer {
2072
2064
  /**
2073
2065
  * Start the mock server
@@ -8030,12 +8022,12 @@ declare namespace CodeceptJS {
8030
8022
  */
8031
8023
  grabElementBoundingRect(locator: LocatorOrString, elementSize?: string): Promise<DOMRect> | Promise<number>;
8032
8024
  /**
8033
- * Mocks network request using [`Request Interception`](https://pptr.dev/next/guides/request-interception)
8025
+ * Mocks network request using [`Request Interception`](https://pptr.dev/guides/network-interception)
8034
8026
  *
8035
8027
  * ```js
8036
8028
  * I.mockRoute(/(\.png$)|(\.jpg$)/, route => route.abort());
8037
8029
  * ```
8038
- * This method allows intercepting and mocking requests & responses. [Learn more about it](https://pptr.dev/next/guides/request-interception)
8030
+ * This method allows intercepting and mocking requests & responses. [Learn more about it](https://pptr.dev/guides/network-interception)
8039
8031
  * @param [url] - URL, regex or pattern for to match URL
8040
8032
  * @param [handler] - a function to process request
8041
8033
  */
@@ -1178,8 +1178,6 @@ declare namespace CodeceptJS {
1178
1178
  *
1179
1179
  * ## Methods
1180
1180
  */
1181
- // @ts-ignore
1182
- // @ts-ignore
1183
1181
  class ExpectHelper {
1184
1182
  expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
1185
1183
  expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
@@ -1291,8 +1289,6 @@ declare namespace CodeceptJS {
1291
1289
  *
1292
1290
  * ## Methods
1293
1291
  */
1294
- // @ts-ignore
1295
- // @ts-ignore
1296
1292
  class ExpectHelper {
1297
1293
  expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
1298
1294
  expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
@@ -1967,8 +1963,6 @@ declare namespace CodeceptJS {
1967
1963
  * @property [host = "0.0.0.0"] - Mock server host
1968
1964
  * @property [httpsOpts] - key & cert values are the paths to .key and .crt files
1969
1965
  */
1970
- // @ts-ignore
1971
- // @ts-ignore
1972
1966
  type MockServerConfig = {
1973
1967
  port?: number;
1974
1968
  host?: string;
@@ -2093,8 +2087,6 @@ declare namespace CodeceptJS {
2093
2087
  *
2094
2088
  * ## Methods
2095
2089
  */
2096
- // @ts-ignore
2097
- // @ts-ignore
2098
2090
  class MockServer {
2099
2091
  /**
2100
2092
  * Start the mock server
@@ -8536,12 +8528,12 @@ declare namespace CodeceptJS {
8536
8528
  */
8537
8529
  grabElementBoundingRect(locator: LocatorOrString, elementSize?: string): Promise<DOMRect> | Promise<number>;
8538
8530
  /**
8539
- * Mocks network request using [`Request Interception`](https://pptr.dev/next/guides/request-interception)
8531
+ * Mocks network request using [`Request Interception`](https://pptr.dev/guides/network-interception)
8540
8532
  *
8541
8533
  * ```js
8542
8534
  * I.mockRoute(/(\.png$)|(\.jpg$)/, route => route.abort());
8543
8535
  * ```
8544
- * This method allows intercepting and mocking requests & responses. [Learn more about it](https://pptr.dev/next/guides/request-interception)
8536
+ * This method allows intercepting and mocking requests & responses. [Learn more about it](https://pptr.dev/guides/network-interception)
8545
8537
  * @param [url] - URL, regex or pattern for to match URL
8546
8538
  * @param [handler] - a function to process request
8547
8539
  */