Slide 9
Slide 9 text
FOR WHAT REASONS CAN TESTS BE (OR
BECOME) NON-DETERMINISTIC?
Shared
environment
Manual and automated
tests running against the
same environment.
Rendering
order
cy.get().first()
vs.
cy.get().should(‘have.length,
n).first()
Waiting times
(network)
cy.wait(10000)
vs.
cy.wait(‘@alias’)
Local vs. CI
Different computing
resources
Component
state
Example:
Disabled button
Not visible field
Animations/transitions
The Cypress way:
cy.get(‘button’).should(‘be.e
nabled’).click()
Lack of tool
knowledge
cy.visit()
cy.intercept().as(‘alias’)
cy.wait(‘@alias’)
vs.
cy.intercept().as(‘alias’)
cy.visit()
cy.wait(‘@alias’)
Dependency
between tests
describe(‘Test suite’, () => {
it(‘visits the page’, () => {
cy.visit(‘/’)
})
it(‘checks the title’, () => {
cy.get(‘h1’)
.should(‘be.visible’)
})
})
Parallelism
Data creation that
cannot be repeated
Tests using shared data
API limitations