codeceptjs 3.4.0 → 3.4.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 3.4.1
2
+
3
+ * Updated mocha to v 10.2. Fixes #3591
4
+ * Fixes executing a faling Before hook. Resolves #3592
5
+
1
6
  ## 3.4.0
2
7
 
3
8
  * **Updated to latest mocha and modern Cucumber**
package/docs/changelog.md CHANGED
@@ -7,6 +7,11 @@ layout: Section
7
7
 
8
8
  # Releases
9
9
 
10
+ ## 3.4.1
11
+
12
+ * Updated mocha to v 10.2. Fixes [#3591](https://github.com/codeceptjs/CodeceptJS/issues/3591)
13
+ * Fixes executing a faling Before hook. Resolves [#3592](https://github.com/codeceptjs/CodeceptJS/issues/3592)
14
+
10
15
  ## 3.4.0
11
16
 
12
17
  * **Updated to latest mocha and modern Cucumber**
package/docs/tutorial.md CHANGED
@@ -3,9 +3,9 @@ permalink: /tutorial
3
3
  title: CoeceptJS Complete Tutorial
4
4
  ---
5
5
 
6
- **[CodeceptJS](https://codecept.io) is a popular open-source testing framework** for JavaScript. It is designed to simplify writing and maintain end-to-end tests for web applications, using a readable and intuitive syntax. To run tests in browser it uses **[Playwright](https://playwright.dev)** library from Microsoft.
6
+ # Tutorial: Writing Tests for Checkout Page
7
7
 
8
- CodeceptJS was started in 2015 and is widely used by organizations of all sizes, from startups to large enterprises.
8
+ **[CodeceptJS](https://codecept.io) is a popular open-source testing framework** for JavaScript. It is designed to simplify writing and maintain end-to-end tests for web applications, using a readable and intuitive syntax. To run tests in browser it uses **[Playwright](https://playwright.dev)** by default but ca execute tests via WebDriver, Puppeteer or Appium.
9
9
 
10
10
  ## Let's get CodeceptJS installed!
11
11
 
@@ -266,6 +266,6 @@ By applying more and more cases you can test a website to all behaviors.
266
266
 
267
267
  ## Summary
268
268
 
269
- This was a deep dive! If you think on just starting test automation, CodeceptJS is the best choice for you as it uses native language to pass commands to browser.
269
+ If you think on just starting test automation, CodeceptJS is the best choice for you as it uses native language to pass commands to browser.
270
270
 
271
271
  If you already skilled in JavaScript, with CodeceptJS you can focus on business level of your test, instead of writing code for browser. This way you can keep your tests stable and maintainable.
@@ -1,6 +1,4 @@
1
1
  const debug = require('debug')('codeceptjs:plugin:wdio');
2
- const path = require('path');
3
- const fs = require('fs');
4
2
 
5
3
  const container = require('../container');
6
4
  const mainConfig = require('../config');
@@ -100,21 +98,15 @@ module.exports = (config) => {
100
98
  const launchers = [];
101
99
 
102
100
  for (const name of config.services) {
103
- // webdriverio v5 style
104
101
  const Service = safeRequire(`@wdio/${name.toLowerCase()}-service`);
105
102
  if (Service) {
106
103
  if (Service.launcher && typeof Service.launcher === 'function') {
107
104
  const Launcher = Service.launcher;
108
105
 
109
- const version = JSON.parse(fs.readFileSync(path.join(require.resolve('webdriverio'), '/../../', 'package.json')).toString()).version;
110
- if (version.indexOf('5') === 0) {
111
- launchers.push(new Launcher(config));
112
- } else {
113
- const options = {
114
- logPath: global.output_dir, installArgs: seleniumInstallArgs, args: seleniumArgs, ...wdioOptions,
115
- };
116
- launchers.push(new Launcher(options, [config.capabilities], config));
117
- }
106
+ const options = {
107
+ logPath: global.output_dir, installArgs: seleniumInstallArgs, args: seleniumArgs, ...wdioOptions,
108
+ };
109
+ launchers.push(new Launcher(options, [config.capabilities], config));
118
110
  }
119
111
  if (typeof Service === 'function') {
120
112
  services.push(new Service(config, config.capabilities));
package/lib/scenario.js CHANGED
@@ -137,16 +137,18 @@ module.exports.injected = function (fn, suite, hookName) {
137
137
  const opts = suite.opts || {};
138
138
  const retries = opts[`retry${ucfirst(hookName)}`] || 0;
139
139
 
140
- promiseRetry(async (retry) => {
140
+ promiseRetry(async (retry, number) => {
141
141
  try {
142
142
  recorder.startUnlessRunning();
143
143
  await fn.call(this, getInjectedArguments(fn));
144
- await recorder.promise();
144
+ await recorder.promise().catch(err => retry(err));
145
145
  } catch (err) {
146
146
  retry(err);
147
147
  } finally {
148
- recorder.stop();
149
- recorder.start();
148
+ if (number < retries) {
149
+ recorder.stop();
150
+ recorder.start();
151
+ }
150
152
  }
151
153
  }, { retries })
152
154
  .then(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeceptjs",
3
- "version": "3.4.0",
3
+ "version": "3.4.1",
4
4
  "description": "Supercharged End 2 End Testing Framework for NodeJS",
5
5
  "keywords": [
6
6
  "acceptance",
@@ -79,7 +79,7 @@
79
79
  "lodash.clonedeep": "^4.5.0",
80
80
  "lodash.merge": "^4.6.2",
81
81
  "mkdirp": "^1.0.4",
82
- "mocha": "^8.2.0",
82
+ "mocha": "^10.2.0",
83
83
  "mocha-junit-reporter": "^1.23.3",
84
84
  "ms": "^2.1.3",
85
85
  "parse-function": "^5.6.4",