cypress-plugin-retries
Advanced tools
Comparing version 1.3.0 to 1.4.0
{ | ||
"name": "cypress-plugin-retries", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "Cypress plugin allowing tests to retry a configurable amount of times", | ||
@@ -5,0 +5,0 @@ "main": "src", |
@@ -19,3 +19,2 @@ | ||
![](docs/readme-screenshot.png) | ||
![](2019-02-12-13-29-53.png) | ||
@@ -52,3 +51,3 @@ ### Installation | ||
``` | ||
**or [undersirable]** Use `mocha`'s `this.retries(n)` inside of a test: | ||
**or [undesirable]** Use `mocha`'s `this.retries(n)` inside of a test: | ||
> Note: **must use `function()` notation, not arrows `()=>{}`** | ||
@@ -72,3 +71,6 @@ ```js | ||
### Extra Configuration | ||
- Use env var `RETRIES_HIDDEN=1` to hide previous attempts' command log entries (instead of marking them with an orange `x`) | ||
### License | ||
[MIT](LICENSE) |
let logs = [] | ||
const { $ } = Cypress | ||
const getDefaultRetries = () => { | ||
@@ -15,2 +17,4 @@ return Cypress.env('RETRIES') | ||
const _top = top | ||
const _clone = Cypress.mocha._mocha.Mocha.Test.prototype.clone | ||
@@ -34,2 +38,14 @@ | ||
setTimeout(() => { | ||
const a = $('.runnable-active', _top.document).find('.runnable-state') | ||
if (!$(`.runnable-active .retry-icon.retry-${ret._currentRetry}`, _top.document).length) { | ||
const b = $(`<i class="retry-icon retry retry-${ret._currentRetry} fa fa-x" />`, _top.document) | ||
b.prependTo(a.parent()) | ||
} | ||
}, 0) | ||
logs = [] | ||
@@ -148,3 +164,3 @@ | ||
.command.ignored .command-number:before { | ||
.command.ignored .command-number:before, .retry-icon:before { | ||
font: normal normal normal 12px/1 FontAwesome; | ||
@@ -154,2 +170,15 @@ content: " "; | ||
} | ||
.runnable-failed .retry-icon { | ||
display:none | ||
} | ||
.retry-icon { | ||
display: inline-block; | ||
line-height: 18px; | ||
margin-right: 3px; | ||
/* min-width: 6px; */ | ||
height: 18px; | ||
text-align: center; | ||
} | ||
/* .command.ignored.retry-0 .command-number:before { | ||
@@ -182,2 +211,4 @@ content: ""; | ||
$('#__plugin_retries_style__', _top.document).remove() | ||
head = window.top.document.getElementsByTagName('head')[0] | ||
@@ -189,2 +220,3 @@ if (!head) { | ||
style = window.top.document.createElement('style') | ||
style.id = '__plugin_retries_style__' | ||
style.type = 'text/css' | ||
@@ -191,0 +223,0 @@ style.innerHTML = css |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10577
199
74