Skip to content

Commit 024ec5b

Browse files
committed
WIP
1 parent d9623f5 commit 024ec5b

File tree

375 files changed

+2009
-2084
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

375 files changed

+2009
-2084
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
module.exports = {
1+
export default {
22
"require": "./test/support/setup.js"
3-
}
3+
};

bin/codecept.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env node
2-
const program = require('commander');
3-
const Codecept = require('../lib/codecept');
4-
const { print, error } = require('../lib/output');
5-
const { printError } = require('../lib/command/utils');
2+
import program from 'commander';
3+
import Codecept from '../lib/codecept';
4+
import { print, error } from '../lib/output.js';
5+
import { printError } from '../lib/command/utils.js';
66

77
const errorHandler = (fn) => async (...args) => {
88
try {

docs/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ After running `codeceptjs init` it should be saved in test root.
2121
| `include?` | `any` | Include page objects to access them via dependency injection ```I: "./custom_steps.js", loginPage: "./pages/Login.js", User: "./pages/User.js", ``` Configured modules can be injected by name in a Scenario: ```Scenario('test', { I, loginPage, User }) ``` |
2222
| `mocha?` | `any` | [Mocha test runner options](https://mochajs.org/#configuring-mocha-nodejs), additional [reporters](https://codecept.io/reports/#xml) can be configured here. Example: ```mocha: { "mocha-junit-reporter": { stdout: "./output/console.log", options: { mochaFile: "./output/result.xml", attachments: true //add screenshot for a failed test } } } ``` |
2323
| `noGlobals?` | `boolean` | Disable registering global functions (Before, Scenario, etc). Not recommended |
24-
| `output` | `string` | Where to store failure screenshots, artifacts, etc ```output: './output' ``` |
24+
| `output` | `string` | Where to store failure screenshots, artifacts, etc ```output: './output.js' ``` |
2525
| `plugins?` | `any` | Enable CodeceptJS plugins. Example: ```plugins: { autoDelay: { enabled: true } } ``` |
2626
| `require?` | `string`[] | [Require additional JS modules](https://codecept.io/configuration/#require) Example: ``` require: ["should"] ``` |
2727
| `teardown?` | (() => `Promise`<`void`\>) \| `boolean` \| `string` | [Execute code after tests](https://codecept.io/bootstrap/) finished. Can be either JS module file or async function: ```teardown: async () => server.stop(), ``` or ```teardown: 'teardown.js', ``` |

examples/codecept.config.example.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ console.log(process.env.profile);
55
exports.config = {
66
tests: './*_test.js',
77
timeout: 10000,
8-
output: './output',
8+
output: './output.js',
99
helpers: {
1010
WebDriver: {
1111
url: 'http://localhost',

examples/codecept.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
exports.config = {
2-
output: './output',
2+
output: './output.js',
33
helpers: {
44
Playwright: {
55
url: 'http://github.com',

examples/selenoid-example/codecept.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
exports.config = {
22
tests: './*_test.js',
3-
output: './output',
3+
output: './output.js',
44
helpers: {
55
WebDriver: {
66
url: 'http://localhost',

lib/actor.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
const Step = require('./step');
2-
const { MetaStep } = require('./step');
3-
const container = require('./container');
4-
const { methodsOfObject } = require('./utils');
5-
const recorder = require('./recorder');
6-
const event = require('./event');
7-
const store = require('./store');
8-
const output = require('./output');
1+
import Step from './step.js';
2+
import { MetaStep } from './step.js';
3+
import container from './container.js';
4+
import { methodsOfObject } from './utils.js';
5+
import recorder from './recorder.js';
6+
import * as event from './event.js';
7+
import { store } from './store.js';
8+
import output from './output.js';
99

1010
/**
1111
* @interface
@@ -69,7 +69,7 @@ class Actor {
6969
* Wraps helper methods into promises.
7070
* @ignore
7171
*/
72-
module.exports = function (obj = {}) {
72+
export default function (obj = {}) {
7373
if (!store.actor) {
7474
store.actor = new Actor();
7575
}
@@ -117,7 +117,7 @@ module.exports = function (obj = {}) {
117117
});
118118

119119
return actor;
120-
};
120+
}
121121

122122
function recordStep(step, args) {
123123
step.status = 'queued';

lib/ai.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
const { Configuration, OpenAIApi } = require('openai');
2-
const debug = require('debug')('codeceptjs:ai');
3-
const config = require('./config');
4-
const output = require('./output');
5-
const { removeNonInteractiveElements, minifyHtml, splitByChunks } = require('./html');
1+
import { Configuration, OpenAIApi } from 'openai';
2+
import debug from 'debug';
3+
debug('codeceptjs:ai');
4+
import config from './config.js';
5+
import output from './output.js';
6+
import { removeNonInteractiveElements, minifyHtml, splitByChunks } from './html.js';
67

78
const defaultConfig = {
89
model: 'gpt-3.5-turbo-16k',
@@ -177,4 +178,4 @@ function parseCodeBlocks(response) {
177178
return modifiedSnippets.filter(snippet => !!snippet);
178179
}
179180

180-
module.exports = AiAssistant;
181+
export default AiAssistant;

lib/assert.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const AssertionFailedError = require('./assert/error');
1+
import AssertionFailedError from './assert/error.js';
22

33
/**
44
* Abstract assertion class introduced for more verbose and customizable messages.
@@ -20,7 +20,7 @@ const AssertionFailedError = require('./assert/error');
2020
* to get more customizable exception messages.
2121
*
2222
*/
23-
class Assertion {
23+
export default class Assertion {
2424
constructor(comparator, params) {
2525
this.comparator = comparator;
2626
this.params = params || {};
@@ -68,5 +68,3 @@ class Assertion {
6868
return this.getException();
6969
}
7070
}
71-
72-
module.exports = Assertion;

lib/assert/empty.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
const Assertion = require('../assert');
2-
const AssertionFailedError = require('./error');
3-
const { template } = require('../utils');
4-
const output = require('../output');
1+
import Assertion from '../assert.js';
2+
import AssertionFailedError from './error.js';
3+
import { template } from '../utils.js';
4+
import output from '../output.js';
55

66
class EmptinessAssertion extends Assertion {
77
constructor(params) {
@@ -37,7 +37,8 @@ class EmptinessAssertion extends Assertion {
3737
}
3838
}
3939

40-
module.exports = {
41-
Assertion: EmptinessAssertion,
40+
export { EmptinessAssertion as Assertion };
41+
42+
export default {
4243
empty: subject => new EmptinessAssertion({ subject }),
4344
};

0 commit comments

Comments
 (0)