Skip to content

Commit e5330f8

Browse files
AlexanderMoskovkininikulin
authored andcommitted
Split functional tests (fixtures and legacy-fixtures) - part 1 of #617 (#619)
* Split functional tests (legacy and new) - part 1 of #617 * Restore /legacy/api/click tests
1 parent 61fe201 commit e5330f8

File tree

198 files changed

+1428
-1375
lines changed

Some content is hidden

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

198 files changed

+1428
-1375
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ matrix:
1313
env: GULP_TASK="test-client-travis-mobile"
1414
- node_js: "stable"
1515
env: GULP_TASK="test-functional"
16+
- node_js: "stable"
17+
env: GULP_TASK="test-functional-legacy"
1618
fast_finish: true
1719

1820
branches:

Gulpfile.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,12 +428,21 @@ gulp.task('publish-website', ['build-website'], function () {
428428

429429
gulp.task('test-docs', ['test-website', 'lint']);
430430

431-
gulp.task('test-functional', ['build'], function () {
431+
432+
function testFunctional (fixturesDir) {
432433
return gulp
433-
.src(['test/functional/setup.js', 'test/functional/**/test.js'])
434+
.src(['test/functional/setup.js', fixturesDir + '/**/test.js'])
434435
.pipe(mocha({
435436
ui: 'bdd',
436437
reporter: 'spec',
437438
timeout: typeof v8debug === 'undefined' ? 30000 : Infinity // NOTE: disable timeouts in debug
438439
}));
440+
}
441+
442+
gulp.task('test-functional', ['build'], function () {
443+
return testFunctional('test/functional/fixtures');
444+
});
445+
446+
gulp.task('test-functional-legacy', ['build'], function () {
447+
return testFunctional('test/functional/legacy-fixtures');
439448
});

test/functional/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module.exports = {
4040
},
4141

4242
site: {
43-
viewsPath: './test/functional/fixtures/',
43+
viewsPath: './test/functional/',
4444
port1: 3000,
4545
port2: 3001
4646
}

test/functional/fixtures/.eslintrc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33
"no-unused-expressions": 0
44
},
55
"globals": {
6-
"handleConfirm": false,
7-
"handleBeforeUnload": false,
8-
"handleAlert": false,
9-
"handlePrompt": false,
10-
"getInput": true,
116
"fixture": true
127
}
138
}

test/functional/fixtures/api/es-next/before-after-each-hooks/test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe('[API] beforeEach/afterEach hooks', function () {
1515

1616
expect(errs[0].indexOf(
1717
'- Error in afterEach hook - ' +
18-
'Error on page "http://localhost:3000/api/es-next/before-after-each-hooks/pages/index.html": ' +
18+
'Error on page "http://localhost:3000/fixtures/api/es-next/before-after-each-hooks/pages/index.html": ' +
1919
'Uncaught Error: [beforeEach][test][afterEach]'
2020
)).eql(0);
2121

@@ -28,7 +28,7 @@ describe('[API] beforeEach/afterEach hooks', function () {
2828
.catch(function (errs) {
2929
expect(errs[0].indexOf(
3030
'- Error in beforeEach hook - ' +
31-
'Error on page "http://localhost:3000/api/es-next/before-after-each-hooks/pages/index.html": ' +
31+
'Error on page "http://localhost:3000/fixtures/api/es-next/before-after-each-hooks/pages/index.html": ' +
3232
'Uncaught Error: [beforeEach]'
3333
)).eql(0);
3434

@@ -40,13 +40,13 @@ describe('[API] beforeEach/afterEach hooks', function () {
4040
return runTests('./testcafe-fixtures/fail-in-test.js', 'Test', { shouldFail: true, only: 'chrome' })
4141
.catch(function (errs) {
4242
expect(errs[0].indexOf(
43-
'Error on page "http://localhost:3000/api/es-next/before-after-each-hooks/pages/index.html": ' +
43+
'Error on page "http://localhost:3000/fixtures/api/es-next/before-after-each-hooks/pages/index.html": ' +
4444
'Uncaught Error: [beforeEach] '
4545
)).eql(0);
4646

4747
expect(errs[1].indexOf(
4848
'- Error in afterEach hook - ' +
49-
'Error on page "http://localhost:3000/api/es-next/before-after-each-hooks/pages/index.html": ' +
49+
'Error on page "http://localhost:3000/fixtures/api/es-next/before-after-each-hooks/pages/index.html": ' +
5050
'Uncaught Error: [beforeEach][afterEach]'
5151
)).eql(0);
5252

test/functional/fixtures/api/es-next/before-after-each-hooks/testcafe-fixtures/fail-in-before-each.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
fixture `Fail in beforeEach`
2-
.page `http://localhost:3000/api/es-next/before-after-each-hooks/pages/index.html`
2+
.page `http://localhost:3000/fixtures/api/es-next/before-after-each-hooks/pages/index.html`
33
.beforeEach(async t => {
44
await t
55
.click('#beforeEach')

test/functional/fixtures/api/es-next/before-after-each-hooks/testcafe-fixtures/fail-in-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
fixture `Fail in test`
2-
.page `http://localhost:3000/api/es-next/before-after-each-hooks/pages/index.html`
2+
.page `http://localhost:3000/fixtures/api/es-next/before-after-each-hooks/pages/index.html`
33
.beforeEach(async t => await t.click('#beforeEach'))
44
.afterEach(async t => {
55
await t

test/functional/fixtures/api/es-next/before-after-each-hooks/testcafe-fixtures/run-all.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
fixture `Run all`
2-
.page `http://localhost:3000/api/es-next/before-after-each-hooks/pages/index.html`
2+
.page `http://localhost:3000/fixtures/api/es-next/before-after-each-hooks/pages/index.html`
33
.beforeEach(async t => await t.click('#beforeEach'))
44
.afterEach(async t => {
55
await t

test/functional/fixtures/api/es-next/click/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ describe('[API] t.click()', function () {
5555
'by a Selector, but "number" was passed.'
5656
);
5757
expect(errs[0]).to.contains(
58-
'7 | .page `http://localhost:3000/api/es-next/click/pages/index.html`;' +
58+
'7 | .page `http://localhost:3000/fixtures/api/es-next/click/pages/index.html`;' +
5959
' 8 |' +
6060
' 9 |const getClickOffset = ClientFunction(() => window.clickOffset);' +
6161
' 10 |' +

test/functional/fixtures/api/es-next/click/testcafe-fixtures/click-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { expect } from 'chai';
44
import { ClientFunction, Selector } from 'testcafe';
55

66
fixture `Click`
7-
.page `http://localhost:3000/api/es-next/click/pages/index.html`;
7+
.page `http://localhost:3000/fixtures/api/es-next/click/pages/index.html`;
88

99
const getClickOffset = ClientFunction(() => window.clickOffset);
1010

0 commit comments

Comments
 (0)