Skip to content

Commit 5143d38

Browse files
author
DavertMik
committed
added result object, improved transport of tests
1 parent 4c68dd7 commit 5143d38

30 files changed

+1024
-632
lines changed

.github/workflows/webdriver.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
3939
- name: start a server
4040
run: 'php -S 127.0.0.1:8000 -t test/data/app &'
41-
- name: Check CodeceptJS can be started
41+
- name: check
4242
run: './bin/codecept.js check -c test/acceptance/codecept.WebDriver.js'
4343
- name: run unit tests
4444
run: ./node_modules/.bin/mocha test/helper/WebDriver_test.js --exit

examples/codecept.config.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
require('./heal_recipes');
1+
require('./heal_recipes')
22

33
exports.config = {
44
output: './output',
@@ -34,22 +34,24 @@ exports.config = {
3434
},
3535
gherkin: {
3636
features: './features/*.feature',
37-
steps: [
38-
'./step_definitions/steps.js',
39-
],
37+
steps: ['./step_definitions/steps.js'],
4038
},
4139
plugins: {
4240
tryTo: {
4341
enabled: true,
4442
},
45-
heal: {
43+
analyze: {
4644
enabled: true,
4745
},
46+
// heal: {
47+
// enabled: true,
48+
// },
49+
// customReporter: {
50+
// enabled: true,
51+
// },
4852
wdio: {
4953
enabled: false,
50-
services: [
51-
'selenium-standalone',
52-
],
54+
services: ['selenium-standalone'],
5355
},
5456
stepByStepReport: {},
5557
autoDelay: {
@@ -65,6 +67,7 @@ exports.config = {
6567
enabled: true,
6668
},
6769
},
70+
6871
tests: './*_test.js',
6972
// timeout: 100,
7073
multiple: {
@@ -73,11 +76,8 @@ exports.config = {
7376
},
7477
default: {
7578
grep: 'signin',
76-
browsers: [
77-
'chrome',
78-
'firefox',
79-
],
79+
browsers: ['chrome', 'firefox'],
8080
},
8181
},
8282
name: 'tests',
83-
};
83+
}

examples/github_test.js

Lines changed: 43 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11
// / <reference path="./steps.d.ts" />
2-
Feature('GitHub');
2+
Feature('GitHub')
33

44
Before(({ I }) => {
5-
I.amOnPage('https://github.com');
6-
});
5+
I.amOnPage('https://github.com')
6+
I.see('GitLab')
7+
})
78

89
xScenario('test ai features', ({ I }) => {
9-
I.amOnPage('https://getbootstrap.com/docs/5.1/examples/checkout/');
10-
pause();
11-
});
10+
I.amOnPage('https://getbootstrap.com/docs/5.1/examples/checkout/')
11+
})
1212

1313
Scenario('Incorrect search for Codeceptjs', ({ I }) => {
14-
I.fillField('.search-input', 'CodeceptJS');
15-
I.pressKey('Enter');
16-
I.waitForElement('[data-testid=search-sub-header]', 10);
17-
I.see('Supercharged End 2 End Testing');
18-
});
14+
I.fillField('.search-input', 'CodeceptJS')
15+
I.pressKey('Enter')
16+
I.waitForElement('[data-testid=search-sub-header]', 10)
17+
I.see('Supercharged End 2 End Testing')
18+
})
1919

2020
Scenario('Visit Home Page @retry', async ({ I }) => {
2121
// .retry({ retries: 3, minTimeout: 1000 })
22-
I.retry(2).see('GitHub');
23-
I.retry(3).see('ALL');
24-
I.retry(2).see('IMAGES');
25-
});
22+
I.retry(2).see('GitHub')
23+
I.retry(3).see('ALL')
24+
I.retry(2).see('IMAGES')
25+
})
2626

2727
Scenario('search @grop', { timeout: 6 }, ({ I }) => {
28-
I.amOnPage('https://github.com/search');
28+
I.amOnPage('https://github.com/search')
2929
const a = {
3030
b: {
3131
c: 'asdasdasd',
3232
},
33-
};
33+
}
3434
const b = {
3535
users: {
3636
admin: {
@@ -42,35 +42,38 @@ Scenario('search @grop', { timeout: 6 }, ({ I }) => {
4242
other: (world = '') => `Hello ${world}`,
4343
},
4444
urls: {},
45-
};
46-
I.fillField('Search GitHub', 'CodeceptJS');
45+
}
46+
I.fillField('Search GitHub', 'CodeceptJS')
4747
// pause({ a, b });
48-
I.pressKey('Enter');
49-
I.wait(3);
48+
I.pressKey('Enter')
49+
I.wait(3)
5050
// pause();
51-
I.see('Codeception/CodeceptJS', locate('.repo-list .repo-list-item').first());
52-
});
51+
I.see('Codeception/CodeceptJS', locate('.repo-list .repo-list-item').first())
52+
})
5353

5454
Scenario('signin @sign', { timeout: 6 }, ({ I, loginPage }) => {
55-
I.say('it should not enter');
56-
loginPage.login('something@totest.com', '123456');
57-
I.see('Incorrect username or password.', '.flash-error');
58-
}).tag('normal').tag('important').tag('@slow');
55+
I.say('it should not enter')
56+
loginPage.login('something@totest.com', '123456')
57+
I.see('Incorrect username or password.', '.flash-error')
58+
})
59+
.tag('normal')
60+
.tag('important')
61+
.tag('@slow')
5962

6063
Scenario('signin2', { timeout: 1 }, ({ I, Smth }) => {
61-
Smth.openAndLogin();
62-
I.see('Incorrect username or password.', '.flash-error');
63-
});
64+
Smth.openAndLogin()
65+
I.see('Incorrect username or password.', '.flash-error')
66+
})
6467

6568
Scenario('register', ({ I }) => {
6669
within('.js-signup-form', () => {
67-
I.fillField('user[login]', 'User');
68-
I.fillField('user[email]', 'user@user.com');
69-
I.fillField('user[password]', 'user@user.com');
70-
I.fillField('q', 'aaa');
71-
I.click('button');
72-
});
73-
I.see('There were problems creating your account.');
74-
I.click('Explore');
75-
I.seeInCurrentUrl('/explore');
76-
});
70+
I.fillField('user[login]', 'User')
71+
I.fillField('user[email]', 'user@user.com')
72+
I.fillField('user[password]', 'user@user.com')
73+
I.fillField('q', 'aaa')
74+
I.click('button')
75+
})
76+
I.see('There were problems creating your account.')
77+
I.click('Explore')
78+
I.seeInCurrentUrl('/explore')
79+
})

examples/selenoid-example/browsers.json

Lines changed: 0 additions & 22 deletions
This file was deleted.

examples/selenoid-example/codecept.conf.js

Lines changed: 0 additions & 29 deletions
This file was deleted.

examples/selenoid-example/git_test.js

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)