Skip to content
This repository has been archived by the owner on May 24, 2021. It is now read-only.

Commit

Permalink
feat(ui): add retry icon in browser gui (#30)
Browse files Browse the repository at this point in the history
when a test fails and retries, now we append an orange 'x' beside the test status icon, to let you know it failed.

If the test fails, we hide the orange 'x' and just show the red one.
  • Loading branch information
kuceb committed Oct 31, 2019
1 parent 7a17b59 commit 1eda165
Show file tree
Hide file tree
Showing 7 changed files with 9,268 additions and 717 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
> [Please refer to this issue for updates about official cypress retry support](https://github.com/cypress-io/cypress/issues/1313)
![](docs/readme-screenshot.png)
![](2019-02-12-13-29-53.png)

### Installation

Expand Down
2 changes: 2 additions & 0 deletions cypress/tests/unit/main.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ describe('deeply nested', () => {
'AE 0',
'AA 0',
])

expect(cy.$$('.runnable-title:contains(T 2)', top.document).parent().children('i').length).eq(5)
})
})

Expand Down
12 changes: 12 additions & 0 deletions cypress/tests/unit/pretty-demo.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
describe('Some flaky suite', () => {
let counter = 0

beforeEach(() => {
Cypress.currentTest.retries(4)
})

it('should pass on 3rd attempt', () => {
counter++
expect(counter === 3, 'some flaky assertion').eq(true)
})
})
7 changes: 4 additions & 3 deletions cypress/tests/unit/retries-hidden.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

const { _ } = Cypress

Cypress.env('RETRIES_HIDDEN', true)

if (!top.alreadyRan) {
Cypress.env('RETRIES_HIDDEN', true)
top.alreadyRan = true
cy.$$('.restart', top.document).click()
}

expect(Cypress.env('RETRIES_HIDDEN')).ok

const failTwice = _.before(3, () => {
throw new Error('foo')
})
Expand All @@ -20,7 +21,7 @@ describe('suite', () => {

cy.wait(10).should(() => {
failTwice()
cy.wrap(cy.$$('.retry-0', top.document)).should('not.be.visible')
cy.wrap(cy.$$('.command.retry-0', top.document)).should('not.be.visible')
})

})
Expand Down
Binary file modified docs/readme-screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 1eda165

Please sign in to comment.