Skip to content

Commit 4659fb8

Browse files
authored
Merge pull request #55 from codeceptjs/move-to-ts
fix: tests and move to TS
2 parents 54e66c5 + 33386ba commit 4659fb8

21 files changed

+210
-11989
lines changed

.github/workflows/main.yml

-18
This file was deleted.

.github/workflows/test.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Acceptance Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- main
8+
pull_request:
9+
branches:
10+
- '**'
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
matrix:
19+
node-version: [20.x]
20+
21+
steps:
22+
- uses: actions/checkout@v3
23+
- name: Use Node.js ${{ matrix.node-version }}
24+
uses: actions/setup-node@v3
25+
with:
26+
node-version: ${{ matrix.node-version }}
27+
- name: Run tests
28+
run: |
29+
npm i && npx playwright install chromium
30+
npx codeceptjs run --steps

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,6 @@ typings/
5959

6060
# next.js build output
6161
.next
62+
63+
package-lock.json
64+
.idea

README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -19,35 +19,35 @@ The default helper is Playwright.
1919

2020
## Playwright
2121

22-
Use `codecept.conf.js` to run tests with Playwright:
22+
Use `codecept.conf.ts` to run tests with Playwright:
2323

2424
```
2525
npx codeceptjs run --steps
2626
```
2727

2828
## Puppeteer
2929

30-
Use `codecept.puppeteer.conf.js` to run tests with Puppeteer:
30+
Use `codecept.puppeteer.conf.ts` to run tests with Puppeteer:
3131

3232
```
33-
npx codeceptjs run --steps -c codecept.puppeteer.conf.js
33+
npx codeceptjs run --steps -c codecept.puppeteer.conf.ts
3434
```
3535

3636

3737
## WebdriverIO
3838

39-
Use `codecept.webdriver.conf.js` to run tests with WebdriverIO in Chrome:
39+
Use `codecept.webdriver.conf.ts` to run tests with WebdriverIO in Chrome:
4040

4141
```
42-
npx codeceptjs run -c codecept.webdriver.conf.js --steps
42+
npx codeceptjs run -c codecept.webdriver.conf.ts --steps
4343
```
4444

4545
## TestCafe
4646

47-
Use `codecept.testcafe.conf.js` to run tests with TestCafe in Chrome:
47+
Use `codecept.testcafe.conf.ts` to run tests with TestCafe in Chrome:
4848

4949
```
50-
npx codeceptjs run -c codecept.testcafe.conf.js --steps
50+
npx codeceptjs run -c codecept.testcafe.conf.ts --steps
5151
```
5252

5353
## Headless Mode

codecept.conf.js renamed to codecept.conf.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,33 @@ const { setHeadlessWhen } = require('@codeceptjs/configure');
33
setHeadlessWhen(process.env.HEADLESS);
44

55
exports.config = {
6-
tests: './todomvc-tests/**/*_test.js',
6+
tests: './todomvc-tests/**/*_test.ts',
77
output: './output',
88
helpers: {
99
Playwright: {
1010
url: 'http://localhost',
1111
waitForTimeout: 5000,
12-
show: true,
12+
show: false,
1313
},
1414

1515
REST: {},
1616

1717
CustomHelper: {
18-
require: './todomvc-tests/helpers/custom.helper.js'
18+
require: './todomvc-tests/helpers/custom.helper.ts'
1919
}
2020
},
2121

2222
gherkin: {
2323
features: './todomvc-tests/features/*.feature',
2424
steps: [
25-
'./todomvc-tests/step-definitions/create-todos.steps.js'
25+
'./todomvc-tests/step-definitions/create-todos.steps.ts'
2626
]
2727
},
2828

2929
include: {
30-
TodosPage: './todomvc-tests/pages/todos.page.js'
30+
TodosPage: './todomvc-tests/pages/todos.page.ts'
3131
},
3232
bootstrap: null,
3333
mocha: {},
3434
name: 'codecept demo tests'
35-
}
35+
}

codecept.puppeteer.conf.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,21 @@ exports.config = {
1717
REST: {},
1818

1919
CustomHelper: {
20-
require: './todomvc-tests/helpers/custom.helper.js'
20+
require: './todomvc-tests/helpers/custom.helper.ts'
2121
}
2222
},
2323

2424
gherkin: {
2525
features: './todomvc-tests/features/*.feature',
2626
steps: [
27-
'./todomvc-tests/step-definitions/create-todos.steps.js'
27+
'./todomvc-tests/step-definitions/create-todos.steps.ts'
2828
]
2929
},
3030

3131
include: {
32-
TodosPage: './todomvc-tests/pages/todos.page.js'
32+
TodosPage: './todomvc-tests/pages/todos.page.ts'
3333
},
3434
bootstrap: null,
3535
mocha: {},
3636
name: 'codecept demo tests'
37-
}
37+
}

codecept.testcafe.conf.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,29 @@ exports.config = {
77
output: './output',
88
helpers: {
99
TestCafe: {
10-
url: 'http://localhost',
10+
url: 'http://localhost',
1111
browser: 'chrome',
1212
show: true,
1313
},
1414

1515
REST: {},
1616

1717
CustomHelper: {
18-
require: './todomvc-tests/helpers/custom.helper.js'
18+
require: './todomvc-tests/helpers/custom.helper.ts'
1919
}
2020
},
2121

2222
gherkin: {
2323
features: './todomvc-tests/features/*.feature',
2424
steps: [
25-
'./todomvc-tests/step-definitions/create-todos.steps.js'
25+
'./todomvc-tests/step-definitions/create-todos.steps.ts'
2626
]
2727
},
2828

2929
include: {
30-
TodosPage: './todomvc-tests/pages/todos.page.js'
30+
TodosPage: './todomvc-tests/pages/todos.page.ts'
3131
},
3232
bootstrap: null,
3333
mocha: {},
3434
name: 'codecept demo tests'
35-
}
35+
}

codecept.webdriver.conf.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,29 @@ exports.config = {
1414
REST: {},
1515

1616
CustomHelper: {
17-
require: './todomvc-tests/helpers/custom.helper.js'
17+
require: './todomvc-tests/helpers/custom.helper.ts'
1818
}
1919
},
2020

2121
gherkin: {
2222
features: './todomvc-tests/features/*.feature',
2323
steps: [
24-
'./todomvc-tests/step-definitions/create-todos.steps.js'
24+
'./todomvc-tests/step-definitions/create-todos.steps.ts'
2525
]
2626
},
2727

2828
include: {
29-
TodosPage: './todomvc-tests/pages/todos.page.js'
29+
TodosPage: './todomvc-tests/pages/todos.page.ts'
3030
},
3131

3232
plugins: {
3333
wdio: {
3434
enabled: true,
3535
services: ['selenium-standalone']
3636
}
37-
},
37+
},
3838

3939
bootstrap: null,
4040
mocha: {},
4141
name: 'codecept demo tests'
42-
}
42+
}

0 commit comments

Comments
 (0)