Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 0 additions & 128 deletions .eslintrc

This file was deleted.

56 changes: 56 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"extends": "airbnb-base",
"env": {
"node": true
},
"rules": {
"prefer-destructuring": 0,
"func-names": 0,
"no-param-reassign": 0,
"no-multi-assign": 0,
"no-use-before-define": 0,
"prefer-rest-params": 0,
"no-return-assign": 0,
"prefer-spread": 0,
"class-methods-use-this": 0,
"no-shadow": 0,
"no-useless-escape": 0,
"no-array-constructor": 0,
"global-require": 0,
"guard-for-in": 0,
"no-restricted-syntax": 0,
"max-len": 0,
"no-continue": 0,
"no-console": 0,
"consistent-return": 0,
"import/no-dynamic-require": 0,
"no-underscore-dangle": 0,
"one-var": 0,
"prefer-const": 0,
"no-plusplus": 0,
"eqeqeq": 0,
"no-tabs": 0,
"default-case": 0,
"no-undef": 0,
"no-cond-assign": 0,
"import/no-extraneous-dependencies": 0,
"no-var": 0,
"no-redeclare": 0,
"radix": 0,
"require-yield": 0,
"no-bitwise": 0,
"no-buffer-constructor": 0,
"no-mixed-operators": 0,
"no-useless-return": 0,
"no-eval": 0,
"array-callback-return": 0,
"no-loop-func": 0,
"import/no-unresolved": 0,
"quotes": 0,
"camelcase": 0,
"no-empty": 0,
"function-paren-newline": 0,
"no-unused-expressions": 0,
"no-unused-vars": 0
}
}
26 changes: 12 additions & 14 deletions bin/codecept.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
#!/usr/bin/env node
'use strict';

var program = require('commander');
var path = require('path');
var Config = require('../lib/config');
var Codecept = require('../lib/codecept');
var print = require('../lib/output');
var fileExists = require('../lib/utils').fileExists;
var fs = require('fs');
const program = require('commander');
const path = require('path');
const Config = require('../lib/config');
const Codecept = require('../lib/codecept');
const print = require('../lib/output');
const fileExists = require('../lib/utils').fileExists;
const fs = require('fs');

program.command('init [path]')
.description('Creates dummy config in current dir or [path]')
Expand Down Expand Up @@ -67,15 +65,15 @@ program.command('run [test]')
.option('-G, --growl', 'enable growl notification support')
.option('-O, --reporter-options <k=v,k2=v2,...>', 'reporter-specific options')
.option('-R, --reporter <name>', 'specify the reporter to use')
.option('-S, --sort', "sort test files")
.option('-b, --bail', "bail after first test failure")
.option('-d, --debug', "enable node's debugger, synonym for node --debug")
.option('-S, --sort', 'sort test files')
.option('-b, --bail', 'bail after first test failure')
.option('-d, --debug', 'enable node\'s debugger, synonym for node --debug')
.option('-g, --grep <pattern>', 'only run tests matching <pattern>')
.option('-f, --fgrep <string>', 'only run tests containing <string>')
.option('-i, --invert', 'inverts --grep and --fgrep matches')
.option('--full-trace', 'display the full stack trace')
.option('--compilers <ext>:<module>,...', 'use the given module(s) to compile files')
.option('--debug-brk', "enable node's debugger breaking on the first line")
.option('--debug-brk', 'enable node\'s debugger breaking on the first line')
.option('--inline-diffs', 'display actual/expected differences inline within each string')
.option('--no-exit', 'require a clean shutdown of the event loop: mocha will not call process.exit')
.option('--recursive', 'include sub directories')
Expand All @@ -101,7 +99,7 @@ program.command('run-multiple [suites...]')
.action(require('../lib/command/run-multiple'));

if (process.argv.length <= 2) {
console.log('CodeceptJS v' + Codecept.version());
console.log(`CodeceptJS v${Codecept.version()}`);
program.outputHelp();
}
program.parse(process.argv);
10 changes: 5 additions & 5 deletions examples/absolutenet_test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
'use strict';

Feature('Testing Begins');

// test with some demo params
Scenario('ANI testing', { id: 123, user_id: 1235 } ,function*(I){
Scenario('ANI testing', { id: 123, user_id: 1235 }, function* (I) {
I.amOnPage('http://www.absolutenet.com/');
let title = yield I.grabTitle();
const title = yield I.grabTitle();
// console.info(title);
I.see('bogus text that is not there'); //this should give an error and not success.
});
I.see('bogus text that is not there'); // this should give an error and not success.
});
44 changes: 22 additions & 22 deletions examples/codecept.conf.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,27 @@ console.log('Use JS config file');
console.log(process.profile);

exports.config = {
"tests": "./*_test.js",
"timeout": 10000,
"output": "./output",
"helpers": {
"WebDriverIO": {
"url": "http://localhost",
"browser": process.profile || 'firefox',
"restart": true
}
tests: './*_test.js',
timeout: 10000,
output: './output',
helpers: {
WebDriverIO: {
url: 'http://localhost',
browser: process.profile || 'firefox',
restart: true,
},
},
"mocha": {
"reporterOptions": {
"mochaFile": "./output/result.xml"
}
mocha: {
reporterOptions: {
mochaFile: './output/result.xml',
},
},
"name": "tests",
"bootstrap": "./bootstrap.js",
"include": {
"I": "./custom_steps.js",
"Smth": "./pages/Smth.js",
"loginPage": "./pages/Login.js",
"signinFragment": "./fragments/Signin.js"
}
}
name: 'tests',
bootstrap: './bootstrap.js',
include: {
I: './custom_steps.js',
Smth: './pages/Smth.js',
loginPage: './pages/Login.js',
signinFragment: './fragments/Signin.js',
},
};
2 changes: 1 addition & 1 deletion examples/custom_steps.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = actor;
module.exports = actor;
5 changes: 2 additions & 3 deletions examples/fragments/Signin.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@

'use strict';

let I;

module.exports = {

_init() {
I = actor();
}
},

// insert your locators and methods here
}
};
4 changes: 2 additions & 2 deletions examples/github_test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="./steps.d.ts" />
// / <reference path="./steps.d.ts" />
Feature('GitHub');

Before((Smth) => {
Expand All @@ -23,7 +23,7 @@ Scenario('signin', (I) => {
});

Scenario('register', (I) => {
within('.js-signup-form', function () {
within('.js-signup-form', () => {
I.fillField('user[login]', 'User');
I.fillField('user[email]', '[email protected]');
I.fillField('user[password]', '[email protected]');
Expand Down
3 changes: 1 addition & 2 deletions examples/pages/Admin.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@

'use strict';

let I;

module.exports = {

_init() {
I = require('codeceptjs/actor')();
}
},

// insert your locators and methods here
};
5 changes: 2 additions & 3 deletions examples/pages/Login.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@

'use strict';

let I;

module.exports = {

_init() {
I = actor();
}
},

// insert your locators and methods here
}
};
7 changes: 3 additions & 4 deletions examples/pages/Smth.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

'use strict';

let I;

Expand All @@ -8,10 +7,10 @@ module.exports = {
_init() {
I = actor();
},

openGitHub() {
I.amOnPage('https://github.com');
}
},

// insert your locators and methods here
}
};
Loading