Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
9ee7da7
Update CONTRIBUTING.md (#3545)
kobenguyent Dec 23, 2022
eb4d293
fix: bump node version to 14.x (#3550)
kobenguyent Dec 23, 2022
63eb2a6
fix bag 3551 (#3552)
KaledinaDARIA Dec 23, 2022
b2e9950
fix: optional params of some ApiDataFactory functions (#3523)
kobenguyent Dec 23, 2022
69384f3
bump testcafe version (#3521)
kobenguyent Dec 23, 2022
06db663
fix: bump faker version (#3509)
kobenguyent Dec 23, 2022
986c542
clean up (#3513)
kobenguyent Jan 30, 2023
dc5e81f
fix: handle the case ts config is not loaded with codeceptjs-ui (#3548)
kobenguyent Jan 30, 2023
9d11758
feature(allure): Add framework and language labels to tests (#3539)
vovsemenv Jan 30, 2023
f561a6a
docs(typescript): fix typo (#3575)
val1984 Feb 4, 2023
f1523f6
fix: stabilize the init tests (#3582)
kobenguyent Feb 9, 2023
eba5314
fix(types): missing def for PW config (#3581)
kobenguyent Feb 11, 2023
7df51f5
docs: Update README.md (#3579)
kobenguyent Feb 12, 2023
6e8e171
feat(allure): screen diff block from allure 2 (#3573)
EgorBodnar Feb 12, 2023
22bbf28
fix: cannot load wdio helper (#3578)
kobenguyent Feb 12, 2023
36a7cd7
fix(playwright): requires param for handleDownloads (#3511)
kobenguyent Feb 12, 2023
429c609
fix(gpo): codeceptjs config is contaminated when having includes() (#…
kobenguyent Feb 12, 2023
ac92fe5
JsDoc: Remove promise from `Actor.say` (#3535)
danielrentz Feb 12, 2023
7bc422a
fix(docs): typo in best practices (#3524)
aldovelco Feb 12, 2023
2092cf7
bump version of @faker-js/faker used by plugin fakerTransform to late…
fijijavis Feb 12, 2023
c7626b9
Retry befores (#3580)
DavertMik Feb 12, 2023
02af78b
fix: inform user when there is no delete request is configured (#3525)
kobenguyent Feb 15, 2023
da04914
3.4.0 release (#3584)
DavertMik Feb 15, 2023
b0df2e2
chore: remove wdio v5 leftover (#3587)
kobenguyent Feb 15, 2023
d89441f
updated docs
DavertMik Feb 15, 2023
fc4d9aa
updated mocha to 10 (#3594)
DavertMik Feb 17, 2023
62c51c0
fixed before hook when retires not executed (#3593)
DavertMik Feb 17, 2023
ad5f4af
version bump
DavertMik Feb 17, 2023
e41ae93
fix: typings issues (#3602)
kobenguyent Feb 26, 2023
2bdfeef
Merge branch '3.x' of https://github.com/codeceptjs/CodeceptJS into c…
gaainf Mar 19, 2023
9124125
Merge branch 'codeceptjs-3.x' into update_to_3.4
gaainf Mar 19, 2023
7aff12c
Merge 91241256a24a9ec881dd454862c5a142ae63e341 into 8b30a7b0e19d0da55…
gaainf Mar 19, 2023
de8af33
3.3.7-rc.7
github-actions[bot] Mar 19, 2023
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
2 changes: 2 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Thanks for getting here. If you have a good will to improve CodeceptJS we are always glad to help. Ask questions, raise issues, ping in Twitter.

Go over the steps in [this](https://github.com/firstcontributions/first-contributions) guide as first contributions

To start you need:

1. Fork and clone the repo.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dtslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-18.04
strategy:
matrix:
node-version: [12.x]
node-version: [14.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/puppeteer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

strategy:
matrix:
node-version: [12.x]
node-version: [14.x]

steps:
- uses: actions/checkout@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/webdriver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

strategy:
matrix:
node-version: [12.x]
node-version: [14.x]

steps:
- run: docker run -d --net=host --shm-size=2g selenium/standalone-chrome:3.141.59-oxygen
Expand Down
52 changes: 52 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,55 @@
## 3.4.1

* Updated mocha to v 10.2. Fixes #3591
* Fixes executing a faling Before hook. Resolves #3592

## 3.4.0

* **Updated to latest mocha and modern Cucumber**
* **Allure plugin moved to [@codeceptjs/allure-legacy](https://github.com/codeceptjs/allure-legacy) package**. This happened because allure-commons package v1 was not updated and caused vulnarabilities. Fixes #3422. We don't plan to maintain allure v2 plugin so it's up to community to take this initiative. Current allure plugin will print a warning message without interfering the run, so it won't accidentally fail your builds.
* Added ability to **[retry Before](https://codecept.io/basics/#retry-before), BeforeSuite, After, AfterSuite** hooks by @davertmik:
```js
Feature('flaky Before & BeforeSuite', { retryBefore: 2, retryBeforeSuite: 3 })
```

* **Flexible [retries configuration](https://codecept.io/basics/#retry-configuration) introduced** by @davertmik:

```js
retry: [
{
// enable this config only for flaky tests
grep: '@flaky',
Before: 3 // retry Before 3 times
Scenario: 3 // retry Scenario 3 times
},
{
// retry less when running slow tests
grep: '@slow'
Scenario: 1
Before: 1
}, {
// retry all BeforeSuite 3 times
BeforeSuite: 3
}
]
```
* **Flexible [timeout configuration](https://codecept.io/advanced/#timeout-configuration)** introduced by @davertmik:

```js
timeout: [
10, // default timeout is 10secs
{ // but increase timeout for slow tests
grep: '@slow',
Feature: 50
},
]
```

* JsDoc: Removed promise from `I.say`. See #3535 by @danielrentz
* [Playwright] `handleDownloads` requires now a filename param. See #3511 by @PeterNgTr
* [WebDriver] Added support for v8, removed support for webdriverio v5 and lower. See #3578 by @PeterNgTr


## 3.3.7

🛩️ Features
Expand Down
63 changes: 31 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ npx codeceptjs def .
Later you can even automagically update Type Definitions to include your own custom [helpers methods](docs/helpers.md).

Note:
- CodeceptJS requires Node.js version `8.9.1+` or later.
- To use the parallel tests execution, requiring Node.js version `11.7` or later.
- CodeceptJS requires Node.js version `12+` or later.

## Usage

Expand Down Expand Up @@ -291,36 +290,36 @@ When using Typescript, replace `module.exports` with `export` for autocompletion
Thanks all to those who are and will have contributing to this awesome project!

[//]: contributor-faces
<a href="https://github.com/DavertMik"><img src="https://avatars0.githubusercontent.com/u/220264?v=4" title="DavertMik" width="80" height="80"></a>
<a href="https://github.com/PeterNgTr"><img src="https://avatars0.githubusercontent.com/u/7845001?v=4" title="PeterNgTr" width="80" height="80"></a>
<a href="https://github.com/Vorobeyko"><img src="https://avatars3.githubusercontent.com/u/11293201?v=4" title="Vorobeyko" width="80" height="80"></a>
<a href="https://github.com/APshenkin"><img src="https://avatars1.githubusercontent.com/u/14344430?v=4" title="APshenkin" width="80" height="80"></a>
<a href="https://github.com/reubenmiller"><img src="https://avatars0.githubusercontent.com/u/3029781?v=4" title="reubenmiller" width="80" height="80"></a>
<a href="https://github.com/fabioel"><img src="https://avatars1.githubusercontent.com/u/9824235?v=4" title="fabioel" width="80" height="80"></a>
<a href="https://github.com/pablopaul"><img src="https://avatars1.githubusercontent.com/u/635526?v=4" title="pablopaul" width="80" height="80"></a>
<a href="https://github.com/koushikmohan1996"><img src="https://avatars3.githubusercontent.com/u/24666922?v=4" title="koushikmohan1996" width="80" height="80"></a>
<a href="https://github.com/Arhell"><img src="https://avatars2.githubusercontent.com/u/26163841?v=4" title="Arhell" width="80" height="80"></a>
<a href="https://github.com/tsuemura"><img src="https://avatars1.githubusercontent.com/u/17092259?v=4" title="tsuemura" width="80" height="80"></a>
<a href="https://github.com/VikalpP"><img src="https://avatars2.githubusercontent.com/u/11846339?v=4" title="VikalpP" width="80" height="80"></a>
<a href="https://github.com/elukoyanov"><img src="https://avatars3.githubusercontent.com/u/11647141?v=4" title="elukoyanov" width="80" height="80"></a>
<a href="https://github.com/MercifulCode"><img src="https://avatars2.githubusercontent.com/u/1740822?v=4" title="MercifulCode" width="80" height="80"></a>
<a href="https://github.com/Georgegriff"><img src="https://avatars3.githubusercontent.com/u/9056958?v=4" title="Georgegriff" width="80" height="80"></a>
<a href="https://github.com/hubidu"><img src="https://avatars2.githubusercontent.com/u/13134082?v=4" title="hubidu" width="80" height="80"></a>
<a href="https://github.com/BorisOsipov"><img src="https://avatars0.githubusercontent.com/u/6514276?v=4" title="BorisOsipov" width="80" height="80"></a>
<a href="https://github.com/jploskonka"><img src="https://avatars3.githubusercontent.com/u/669483?v=4" title="jploskonka" width="80" height="80"></a>
<a href="https://github.com/martomo"><img src="https://avatars2.githubusercontent.com/u/1850135?v=4" title="martomo" width="80" height="80"></a>
<a href="https://github.com/denis-sokolov"><img src="https://avatars0.githubusercontent.com/u/113721?v=4" title="denis-sokolov" width="80" height="80"></a>
<a href="https://github.com/lennym"><img src="https://avatars3.githubusercontent.com/u/117398?v=4" title="lennym" width="80" height="80"></a>
<a href="https://github.com/petehouston"><img src="https://avatars0.githubusercontent.com/u/9006720?v=4" title="petehouston" width="80" height="80"></a>
<a href="https://github.com/Holorium"><img src="https://avatars1.githubusercontent.com/u/10815542?v=4" title="Holorium" width="80" height="80"></a>
<a href="https://github.com/nitschSB"><img src="https://avatars0.githubusercontent.com/u/39341455?v=4" title="nitschSB" width="80" height="80"></a>
<a href="https://github.com/johnyb"><img src="https://avatars2.githubusercontent.com/u/86358?v=4" title="johnyb" width="80" height="80"></a>
<a href="https://github.com/jamesgeorge007"><img src="https://avatars2.githubusercontent.com/u/25279263?v=4" title="jamesgeorge007" width="80" height="80"></a>
<a href="https://github.com/jinjorge"><img src="https://avatars3.githubusercontent.com/u/2208083?v=4" title="jinjorge" width="80" height="80"></a>
<a href="https://github.com/gkushang"><img src="https://avatars1.githubusercontent.com/u/3663389?v=4" title="gkushang" width="80" height="80"></a>
<a href="https://github.com/galkin"><img src="https://avatars3.githubusercontent.com/u/5930544?v=4" title="galkin" width="80" height="80"></a>
<a href="https://github.com/orihomie"><img src="https://avatars2.githubusercontent.com/u/29889683?v=4" title="orihomie" width="80" height="80"></a>
<a href="https://github.com/radhey1851"><img src="https://avatars2.githubusercontent.com/u/22446528?v=4" title="radhey1851" width="80" height="80"></a>
<a href="https://github.com/DavertMik"><img src="https://avatars.githubusercontent.com/u/220264?v=4" title="DavertMik" width="80" height="80"></a>
<a href="https://github.com/PeterNgTr"><img src="https://avatars.githubusercontent.com/u/7845001?v=4" title="PeterNgTr" width="80" height="80"></a>
<a href="https://github.com/Vorobeyko"><img src="https://avatars.githubusercontent.com/u/11293201?v=4" title="Vorobeyko" width="80" height="80"></a>
<a href="https://github.com/reubenmiller"><img src="https://avatars.githubusercontent.com/u/3029781?v=4" title="reubenmiller" width="80" height="80"></a>
<a href="https://github.com/Arhell"><img src="https://avatars.githubusercontent.com/u/26163841?v=4" title="Arhell" width="80" height="80"></a>
<a href="https://github.com/APshenkin"><img src="https://avatars.githubusercontent.com/u/14344430?v=4" title="APshenkin" width="80" height="80"></a>
<a href="https://github.com/fabioel"><img src="https://avatars.githubusercontent.com/u/9824235?v=4" title="fabioel" width="80" height="80"></a>
<a href="https://github.com/pablopaul"><img src="https://avatars.githubusercontent.com/u/635526?v=4" title="pablopaul" width="80" height="80"></a>
<a href="https://github.com/Georgegriff"><img src="https://avatars.githubusercontent.com/u/9056958?v=4" title="Georgegriff" width="80" height="80"></a>
<a href="https://github.com/mirao"><img src="https://avatars.githubusercontent.com/u/12584138?v=4" title="mirao" width="80" height="80"></a>
<a href="https://github.com/KMKoushik"><img src="https://avatars.githubusercontent.com/u/24666922?v=4" title="KMKoushik" width="80" height="80"></a>
<a href="https://github.com/nikocanvacom"><img src="https://avatars.githubusercontent.com/u/83254493?v=4" title="nikocanvacom" width="80" height="80"></a>
<a href="https://github.com/elukoyanov"><img src="https://avatars.githubusercontent.com/u/11647141?v=4" title="elukoyanov" width="80" height="80"></a>
<a href="https://github.com/gkushang"><img src="https://avatars.githubusercontent.com/u/3663389?v=4" title="gkushang" width="80" height="80"></a>
<a href="https://github.com/tsuemura"><img src="https://avatars.githubusercontent.com/u/17092259?v=4" title="tsuemura" width="80" height="80"></a>
<a href="https://github.com/VikalpP"><img src="https://avatars.githubusercontent.com/u/11846339?v=4" title="VikalpP" width="80" height="80"></a>
<a href="https://github.com/BorisOsipov"><img src="https://avatars.githubusercontent.com/u/6514276?v=4" title="BorisOsipov" width="80" height="80"></a>
<a href="https://github.com/elaichenkov"><img src="https://avatars.githubusercontent.com/u/29764053?v=4" title="elaichenkov" width="80" height="80"></a>
<a href="https://github.com/nitschSB"><img src="https://avatars.githubusercontent.com/u/39341455?v=4" title="nitschSB" width="80" height="80"></a>
<a href="https://github.com/hubidu"><img src="https://avatars.githubusercontent.com/u/13134082?v=4" title="hubidu" width="80" height="80"></a>
<a href="https://github.com/jploskonka"><img src="https://avatars.githubusercontent.com/u/669483?v=4" title="jploskonka" width="80" height="80"></a>
<a href="https://github.com/maojunxyz"><img src="https://avatars.githubusercontent.com/u/28778042?v=4" title="maojunxyz" width="80" height="80"></a>
<a href="https://github.com/abhimanyupandian"><img src="https://avatars.githubusercontent.com/u/36107381?v=4" title="abhimanyupandian" width="80" height="80"></a>
<a href="https://github.com/martomo"><img src="https://avatars.githubusercontent.com/u/1850135?v=4" title="martomo" width="80" height="80"></a>
<a href="https://github.com/denis-sokolov"><img src="https://avatars.githubusercontent.com/u/113721?v=4" title="denis-sokolov" width="80" height="80"></a>
<a href="https://github.com/lennym"><img src="https://avatars.githubusercontent.com/u/117398?v=4" title="lennym" width="80" height="80"></a>
<a href="https://github.com/petehouston"><img src="https://avatars.githubusercontent.com/u/9006720?v=4" title="petehouston" width="80" height="80"></a>
<a href="https://github.com/Holorium"><img src="https://avatars.githubusercontent.com/u/10815542?v=4" title="Holorium" width="80" height="80"></a>
<a href="https://github.com/jancorvus"><img src="https://avatars.githubusercontent.com/u/67001310?v=4" title="jancorvus" width="80" height="80"></a>
<a href="https://github.com/ngraf"><img src="https://avatars.githubusercontent.com/u/7094389?v=4" title="ngraf" width="80" height="80"></a>

[//]: contributor-faces

Expand Down
72 changes: 48 additions & 24 deletions docs/advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ You can use this options for build your own [plugins](https://codecept.io/hooks/
});
```

## Timeout <Badge text="Updated in 3.2" type="warning"/>
## Timeout

Tests can get stuck due to various reasons such as network connection issues, crashed browser, etc.
This can make tests process hang. To prevent these situations timeouts can be used. Timeouts can be set explicitly for flaky parts of code, or implicitly in a config.
Expand Down Expand Up @@ -236,38 +236,62 @@ A timeout for a group of tests can be set on Feature level via options.
Feature('flaky tests', { timeout: 30 })
```

### Sum Up
### Timeout Confguration

Let's list all available timeout options.
<Badge text="Updated in 3.4" type="warning"/>

Timeouts can be set globally in config:
Timeout rules can be set globally via config.

To set a timeout for all running tests provide a **number of seconds** to `timeout` config option:

```js
// in codecept.confg.js:
{ // ...
timeout: 30, // limit all tests in all suites to 30 secs

plugins: {
stepTimeout: {
enabled: true,
timeout: 10, // limit all steps except waiters to 10 secs
}
}
}

```js
// inside codecept.conf.js or codecept.conf.ts
timeout: 30, // limit all tests in all suites to 30 secs
```

or inside a test file:
It is possible to tune this configuration for a different groups of tests passing options as array and using `grep` option to filter tests:

```js
// limit all tests in this suite to 10 secs
Feature('tests with timeout', { timeout: 10 });
// inside codecept.conf.js or codecept.conf.ts

// limit this test to 20 secs
Scenario('a test with timeout', { timeout: 20 }, ({ I }) => {
// limit step to 5 seconds
I.limitTime(5).click('Link');
});
timeout: [
10, // default timeout is 10secs

// but increase timeout for slow tests
{
grep: '@slow',
Feature: 50
},
]
```

> ℹ️ `grep` value can be string or regexp

It is possible to set a timeout for Scenario or Feature:

```js
// inside codecept.conf.js or codecept.conf.ts
timeout: [

// timeout for Feature with @slow in title
{
grep: '@slow',
Feature: 50
},

// timeout for Scenario with 'flaky0' .. `flaky1` in title
{
// regexp can be passed to grep
grep: /flaky[0-9]/,
Scenario: 10
},

// timeout for all suites
{
Feature: 20
}
]
```

Global timeouts will be overridden by explicit timeouts of a test or steps.
Expand Down
Loading