|
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));
|
|
0 commit comments