Skip to content
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

Add test retry attempts to after hooks #4722

Merged
merged 2 commits into from
Nov 3, 2019
Merged

Add test retry attempts to after hooks #4722

merged 2 commits into from
Nov 3, 2019

Conversation

mgrybyk
Copy link
Member

@mgrybyk mgrybyk commented Nov 3, 2019

Proposed changes

  • add TEST retries limit and attempts to after test / hook.

image

  • add SPEC FILE retries attempts to config browser.config.specFileRetryAttempts. We already have specFileRetries in config defined by user.
    image

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

works same in mocha, cucumber, etc

fixes #4662

Reviewers: @webdriverio/technical-committee

@mgrybyk mgrybyk added the PR: New Feature 🚀 PRs that contain new features label Nov 3, 2019
@codecov
Copy link

codecov bot commented Nov 3, 2019

Codecov Report

Merging #4722 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4722      +/-   ##
==========================================
+ Coverage   99.39%   99.39%   +<.01%     
==========================================
  Files         207      207              
  Lines        5302     5306       +4     
  Branches     1146     1145       -1     
==========================================
+ Hits         5270     5274       +4     
  Misses         29       29              
  Partials        3        3
Impacted Files Coverage Δ
...es/webdriverio/src/commands/element/isClickable.js 100% <ø> (ø) ⬆️
packages/wdio-runner/src/index.js 97.08% <100%> (+0.02%) ⬆️
...ges/wdio-utils/src/test-framework/testFnWrapper.js 100% <100%> (ø) ⬆️
...o-utils/src/test-framework/testInterfaceWrapper.js 100% <100%> (ø) ⬆️
packages/wdio-sync/src/index.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 137a01e...d07e250. Read the comment docs.

@mgrybyk
Copy link
Member Author

mgrybyk commented Nov 3, 2019

specFileRetryAttempts is not available in hooks in this because context of hooks is not config but a copy of config, see https://github.com/webdriverio/webdriverio/blob/master/packages/wdio-config/src/lib/ConfigParser.js#L49

we can use browser.config.specFileRetryAttempts instead

example

afterTest () {
    browser.config.specFileRetryAttempts // works!
    this.specFileRetryAttempts // not available
},

@mgrybyk mgrybyk marked this pull request as ready for review November 3, 2019 01:45
Copy link
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: New Feature 🚀 PRs that contain new features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Send number of retries to afterTest() hook
2 participants