Skip to content

Commit

Permalink
Merge pull request #55 from codeceptjs/move-to-ts
Browse files Browse the repository at this point in the history
fix: tests and move to TS
  • Loading branch information
kobenguyent authored Feb 2, 2024
2 parents 54e66c5 + 33386ba commit 4659fb8
Show file tree
Hide file tree
Showing 21 changed files with 210 additions and 11,989 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/main.yml

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Acceptance Tests

on:
push:
branches:
- master
- main
pull_request:
branches:
- '**'

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Run tests
run: |
npm i && npx playwright install chromium
npx codeceptjs run --steps
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,6 @@ typings/

# next.js build output
.next

package-lock.json
.idea
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,35 +19,35 @@ The default helper is Playwright.

## Playwright

Use `codecept.conf.js` to run tests with Playwright:
Use `codecept.conf.ts` to run tests with Playwright:

```
npx codeceptjs run --steps
```

## Puppeteer

Use `codecept.puppeteer.conf.js` to run tests with Puppeteer:
Use `codecept.puppeteer.conf.ts` to run tests with Puppeteer:

```
npx codeceptjs run --steps -c codecept.puppeteer.conf.js
npx codeceptjs run --steps -c codecept.puppeteer.conf.ts
```


## WebdriverIO

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

```
npx codeceptjs run -c codecept.webdriver.conf.js --steps
npx codeceptjs run -c codecept.webdriver.conf.ts --steps
```

## TestCafe

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

```
npx codeceptjs run -c codecept.testcafe.conf.js --steps
npx codeceptjs run -c codecept.testcafe.conf.ts --steps
```

## Headless Mode
Expand Down
12 changes: 6 additions & 6 deletions codecept.conf.js → codecept.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,33 @@ const { setHeadlessWhen } = require('@codeceptjs/configure');
setHeadlessWhen(process.env.HEADLESS);

exports.config = {
tests: './todomvc-tests/**/*_test.js',
tests: './todomvc-tests/**/*_test.ts',
output: './output',
helpers: {
Playwright: {
url: 'http://localhost',
waitForTimeout: 5000,
show: true,
show: false,
},

REST: {},

CustomHelper: {
require: './todomvc-tests/helpers/custom.helper.js'
require: './todomvc-tests/helpers/custom.helper.ts'
}
},

gherkin: {
features: './todomvc-tests/features/*.feature',
steps: [
'./todomvc-tests/step-definitions/create-todos.steps.js'
'./todomvc-tests/step-definitions/create-todos.steps.ts'
]
},

include: {
TodosPage: './todomvc-tests/pages/todos.page.js'
TodosPage: './todomvc-tests/pages/todos.page.ts'
},
bootstrap: null,
mocha: {},
name: 'codecept demo tests'
}
}
8 changes: 4 additions & 4 deletions codecept.puppeteer.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ exports.config = {
REST: {},

CustomHelper: {
require: './todomvc-tests/helpers/custom.helper.js'
require: './todomvc-tests/helpers/custom.helper.ts'
}
},

gherkin: {
features: './todomvc-tests/features/*.feature',
steps: [
'./todomvc-tests/step-definitions/create-todos.steps.js'
'./todomvc-tests/step-definitions/create-todos.steps.ts'
]
},

include: {
TodosPage: './todomvc-tests/pages/todos.page.js'
TodosPage: './todomvc-tests/pages/todos.page.ts'
},
bootstrap: null,
mocha: {},
name: 'codecept demo tests'
}
}
10 changes: 5 additions & 5 deletions codecept.testcafe.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,29 @@ exports.config = {
output: './output',
helpers: {
TestCafe: {
url: 'http://localhost',
url: 'http://localhost',
browser: 'chrome',
show: true,
},

REST: {},

CustomHelper: {
require: './todomvc-tests/helpers/custom.helper.js'
require: './todomvc-tests/helpers/custom.helper.ts'
}
},

gherkin: {
features: './todomvc-tests/features/*.feature',
steps: [
'./todomvc-tests/step-definitions/create-todos.steps.js'
'./todomvc-tests/step-definitions/create-todos.steps.ts'
]
},

include: {
TodosPage: './todomvc-tests/pages/todos.page.js'
TodosPage: './todomvc-tests/pages/todos.page.ts'
},
bootstrap: null,
mocha: {},
name: 'codecept demo tests'
}
}
10 changes: 5 additions & 5 deletions codecept.webdriver.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,29 @@ exports.config = {
REST: {},

CustomHelper: {
require: './todomvc-tests/helpers/custom.helper.js'
require: './todomvc-tests/helpers/custom.helper.ts'
}
},

gherkin: {
features: './todomvc-tests/features/*.feature',
steps: [
'./todomvc-tests/step-definitions/create-todos.steps.js'
'./todomvc-tests/step-definitions/create-todos.steps.ts'
]
},

include: {
TodosPage: './todomvc-tests/pages/todos.page.js'
TodosPage: './todomvc-tests/pages/todos.page.ts'
},

plugins: {
wdio: {
enabled: true,
services: ['selenium-standalone']
}
},
},

bootstrap: null,
mocha: {},
name: 'codecept demo tests'
}
}
Loading

0 comments on commit 4659fb8

Please sign in to comment.