-
-
Notifications
You must be signed in to change notification settings - Fork 758
Release 2.4 #2129
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
Release 2.4 #2129
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
0a1165e
preparing release
DavertMik b32a06d
updated changelog and docs
DavertMik 46bd98d
Merge branch 'master' into release-2.4
DavertMik 8614c87
preparing release
DavertMik afae376
renamed rerun command, docs
DavertMik 22fb615
increased timeout for definitions test
DavertMik eabde97
fixed tests for rerun command
DavertMik f52c27b
updated changes to basics
DavertMik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,3 +19,4 @@ testpullfilecache* | |
| package-lock.json | ||
| yarn.lock | ||
| /.vs | ||
| typings/types.d.ts | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -450,7 +450,7 @@ The interactive shell can be started outside of test context by running | |
| npx codeceptjs shell | ||
| ``` | ||
|
|
||
| ### Pause on Failure | ||
| ### Pause on Failure <Badge text="Since 2.4" type="warning"/> | ||
|
|
||
| To start interactive pause automatically for a failing test you can run tests with [pauseOnFail Plugin](/plugins/#pauseonfail). | ||
| When a test fails, the pause mode will be activated, so you can inspect current browser session before it is closed. | ||
|
|
@@ -465,14 +465,24 @@ This is an **essential feature to debug flaky tests**, as you can analyze them i | |
| By default CodeceptJS saves a screenshot of a failed test. | ||
| This can be configured in [screenshotOnFail Plugin](/plugins/#screenshotonfail) | ||
|
|
||
| > **screenshotOnFail plugin is enabled by default** for new setups | ||
|
|
||
| ### Step By Step Report | ||
|
|
||
| To see how the test was executed, use [stepByStepReport Plugin](/plugins/#stepbystepreport). It saves a screenshot of each passed step and shows them in a nice slideshow. | ||
|
|
||
| ## Retries | ||
|
|
||
| ### Auto Retry | ||
|
|
||
| You can auto-retry a failed step by enabling [retryFailedStep Plugin](/plugins/#retryfailedstep). | ||
|
|
||
| > **autoRetry plugin is enabled by default** for new setups since CodeceptJS 2.4 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why this differs from 463, 453 rows? Do we need badges or quoted messages?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, added quotes |
||
|
|
||
| ### Retry Step | ||
|
|
||
| Unless you use retryFailedStep plugin you can manually control retries in your project. | ||
|
|
||
| If you have a step which often fails, you can retry execution for this single step. | ||
| Use the `retry()` function before an action to ask CodeceptJS to retry it on failure: | ||
|
|
||
|
|
@@ -505,9 +515,6 @@ I.retry({ | |
|
|
||
| Pass a function to the `when` option to retry only when an error matches the expected one. | ||
|
|
||
| ### Auto Retry | ||
|
|
||
| You can auto-retry a failed step by enabling [retryFailedStep Plugin](/plugins/#retryfailedstep). | ||
|
|
||
| ### Retry Scenario | ||
|
|
||
|
|
@@ -601,8 +608,11 @@ within('.js-signup-form', () => { | |
| I.see('There were problems creating your account.'); | ||
| ``` | ||
|
|
||
| > ⚠ `within` can cause problems when used incorrectly. If you see a weired behavior of a test try to refactor it to not use `within`. It is recommended to keep within for simplest cases when possible. | ||
|
|
||
| `within` can also work with IFrames. A special `frame` locator is required to locate the iframe and get into its context. | ||
|
|
||
|
|
||
| See example: | ||
|
|
||
| ```js | ||
|
|
@@ -611,6 +621,8 @@ within({frame: "#editor"}, () => { | |
| }); | ||
| ``` | ||
|
|
||
| > ℹ IFrames can also be accessed via `I.switchTo` command of a corresponding helper. | ||
|
|
||
| Nested IFrames can be set by passing an array *(WebDriver, Nightmare & Puppeteer only)*: | ||
|
|
||
| ```js | ||
|
|
@@ -759,12 +771,14 @@ Like in Mocha you can use `x` and `only` to skip tests or to run a single test. | |
| * `xScenario` - skips current test | ||
| * `Scenario.only` - executes only the current test | ||
|
|
||
| ## Todo test | ||
| ## Todo Test <Badge text="Since 2.4" type="warning"/> | ||
|
|
||
| You can use `Scenario.todo` when you are planning on writing tests. | ||
|
|
||
| You can use `Scenario.todo` when you are planning on writing tests. This test will be skipped like with usual `skip`. | ||
| But this method to adds skip-message: `Test not implemented!` to test instance. | ||
| This test will be skipped like with regular `Scenario.skip` but with additional message "Test not implemented!": | ||
|
|
||
| Use it with a test body as a test plan: | ||
|
|
||
| Example #1 - with callback: | ||
| ```js | ||
| Scenario.todo('Test', I => { | ||
| /** | ||
|
|
@@ -774,19 +788,11 @@ Scenario.todo('Test', I => { | |
| * Result: | ||
| * 3. Field contains text | ||
| */ | ||
| }) | ||
| ``` | ||
|
|
||
| Example #2 - without callback: | ||
| ```js | ||
| Scenario.todo('Test') | ||
| }); | ||
| ``` | ||
|
|
||
| And you can access the `message` of `test.opts.skipInfo` in the events | ||
| Or even without a test body: | ||
|
|
||
| Example #3 - access into event hooks | ||
| ```js | ||
| event.dispatcher.on(event.test.before, (test) => { | ||
| test.opts.skipInfo // contains {message and description} | ||
| }); | ||
| ``` | ||
| Scenario.todo('Test'); | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this to ignore conflicts in our PRs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should
types.d.tsbe deleted?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not, to accidentally not to release a package without types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And types will stay outdated in code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, you mean remove from git? Ok