Skip to content

Commit b7fc56c

Browse files
committed
Codecept
1 parent 9d8e265 commit b7fc56c

17,302 files changed

Lines changed: 2083401 additions & 1 deletion

File tree

Some content is hidden

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

README.md

Lines changed: 1 addition & 1 deletion

codecept.conf.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
const path = require('path')
2+
3+
const TestBaseDirectory = 'evo-app'
4+
5+
exports.config = {
6+
name: 'codeceptjs-evo',
7+
tests: path.join('.', TestBaseDirectory, '**', '*.test.js'), // Look for tests in all subfolders
8+
output: 'output', // Set output directory for screenshots, reports ...
9+
helpers: {
10+
TestCafe: {
11+
url: 'https://evo.co.uk', // just any value, url is set in test
12+
browser: 'chrome', // other values: 'firefox', 'ie' (windows)
13+
show: true, // set to false for headless mode
14+
waitForTimeout: 5000, // wait for elements to appear
15+
getPageTimeout: 20000 // wait for page to load
16+
},
17+
18+
CustomHelper: {
19+
require: './evo-app/helpers/custom.helper.js'
20+
},
21+
},
22+
23+
include: {
24+
HomePage: `./${TestBaseDirectory}/pages/home.page.js`,
25+
},
26+
27+
bootstrap: null, // For running additional code before test run starts
28+
29+
plugins: {},
30+
31+
mocha: {}
32+
}

evo-app/helpers/custom.helper.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
let Helper = codecept_helper;
2+
3+
const toString = sel => {
4+
if (typeof(sel) === 'string') return sel
5+
if (typeof(sel) === 'object') {
6+
return sel.value
7+
}
8+
}
9+
10+
class CustomHelper extends Helper {
11+
12+
async hover(selector) {
13+
let helper = this.helpers.TestCafe;
14+
15+
await helper.t.hover(toString(selector))
16+
}
17+
}
18+
19+
module.exports = CustomHelper;

evo-app/homepage.test.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Feature('Evo homepage')
2+
3+
Before(async (I, HomePage) => {
4+
HomePage.goto()
5+
})
6+
7+
/**
8+
* Happy Path tests
9+
*/
10+
Scenario('Navigate to Evo homepage and check Evo Logo is displayed', async (I, HomePage) => {
11+
I.say('Given I am on the Evo homepage')
12+
13+
I.say('Then I should see the header with the Evo logo')
14+
HomePage.seeHeader()
15+
16+
I.saveScreenshot('evo-home-logo.png')
17+
})
18+
19+
20+
21+
22+

evo-app/pages/README.md

Lines changed: 10 additions & 0 deletions

evo-app/pages/home.page.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const assert = require('assert')
2+
3+
const I = actor();
4+
5+
6+
module.exports = {
7+
goto() {
8+
I.amOnPage('https://evo.co.uk')
9+
},
10+
11+
seeHeader() {
12+
I.seeElement('.polaris__header--logo')
13+
}
14+
}

jsconfig.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"compilerOption": {
3+
"allowJs": true
4+
}
5+
}

node_modules/.bin/_mocha

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/asar

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/atob

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)