codeceptjs 3.6.3-beta.3 → 3.6.4-beta.1

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
 
package/lib/heal.js CHANGED
@@ -154,7 +154,7 @@ module.exports = heal;
154
154
  function matchRecipes(recipes, contextName) {
155
155
  return Object.entries(recipes)
156
156
  .filter(([, recipe]) => !contextName || !recipe.grep || new RegExp(recipe.grep).test(contextName))
157
- .sort(([, a], [, b]) => b.priority - a.priority)
157
+ .sort(([, a], [, b]) => a.priority - b.priority)
158
158
  .map(([name, recipe]) => {
159
159
  recipe.name = name;
160
160
  return recipe;
@@ -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.4-beta.01",
4
4
  "description": "Supercharged End 2 End Testing Framework for NodeJS",
5
5
  "keywords": [
6
6
  "acceptance",
@@ -8030,12 +8030,12 @@ declare namespace CodeceptJS {
8030
8030
  */
8031
8031
  grabElementBoundingRect(locator: LocatorOrString, elementSize?: string): Promise<DOMRect> | Promise<number>;
8032
8032
  /**
8033
- * Mocks network request using [`Request Interception`](https://pptr.dev/next/guides/request-interception)
8033
+ * Mocks network request using [`Request Interception`](https://pptr.dev/guides/network-interception)
8034
8034
  *
8035
8035
  * ```js
8036
8036
  * I.mockRoute(/(\.png$)|(\.jpg$)/, route => route.abort());
8037
8037
  * ```
8038
- * This method allows intercepting and mocking requests & responses. [Learn more about it](https://pptr.dev/next/guides/request-interception)
8038
+ * This method allows intercepting and mocking requests & responses. [Learn more about it](https://pptr.dev/guides/network-interception)
8039
8039
  * @param [url] - URL, regex or pattern for to match URL
8040
8040
  * @param [handler] - a function to process request
8041
8041
  */
@@ -8536,12 +8536,12 @@ declare namespace CodeceptJS {
8536
8536
  */
8537
8537
  grabElementBoundingRect(locator: LocatorOrString, elementSize?: string): Promise<DOMRect> | Promise<number>;
8538
8538
  /**
8539
- * Mocks network request using [`Request Interception`](https://pptr.dev/next/guides/request-interception)
8539
+ * Mocks network request using [`Request Interception`](https://pptr.dev/guides/network-interception)
8540
8540
  *
8541
8541
  * ```js
8542
8542
  * I.mockRoute(/(\.png$)|(\.jpg$)/, route => route.abort());
8543
8543
  * ```
8544
- * This method allows intercepting and mocking requests & responses. [Learn more about it](https://pptr.dev/next/guides/request-interception)
8544
+ * This method allows intercepting and mocking requests & responses. [Learn more about it](https://pptr.dev/guides/network-interception)
8545
8545
  * @param [url] - URL, regex or pattern for to match URL
8546
8546
  * @param [handler] - a function to process request
8547
8547
  */