Skip to content

fix: tests and move to TS #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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