fix(tests): wait until lists are loaded

This commit is contained in:
kolaente 2022-01-30 14:10:46 +01:00
parent 6c1857b133
commit 6ab7aac5ce
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B

View file

@ -5,6 +5,7 @@ import '../../support/authenticateUser'
describe('List History', () => { describe('List History', () => {
it('should show a list history on the home page', () => { it('should show a list history on the home page', () => {
cy.intercept(Cypress.env('API_URL') + '/namespaces*').as('loadNamespaces') cy.intercept(Cypress.env('API_URL') + '/namespaces*').as('loadNamespaces')
cy.intercept(Cypress.env('API_URL') + '/lists/*').as('loadList')
const lists = ListFactory.create(6) const lists = ListFactory.create(6)
@ -15,16 +16,22 @@ describe('List History', () => {
cy.visit(`/lists/${lists[0].id}`) cy.visit(`/lists/${lists[0].id}`)
cy.wait('@loadNamespaces') cy.wait('@loadNamespaces')
cy.wait('@loadList')
cy.visit(`/lists/${lists[1].id}`) cy.visit(`/lists/${lists[1].id}`)
cy.wait('@loadNamespaces') cy.wait('@loadNamespaces')
cy.wait('@loadList')
cy.visit(`/lists/${lists[2].id}`) cy.visit(`/lists/${lists[2].id}`)
cy.wait('@loadNamespaces') cy.wait('@loadNamespaces')
cy.wait('@loadList')
cy.visit(`/lists/${lists[3].id}`) cy.visit(`/lists/${lists[3].id}`)
cy.wait('@loadNamespaces') cy.wait('@loadNamespaces')
cy.wait('@loadList')
cy.visit(`/lists/${lists[4].id}`) cy.visit(`/lists/${lists[4].id}`)
cy.wait('@loadNamespaces') cy.wait('@loadNamespaces')
cy.wait('@loadList')
cy.visit(`/lists/${lists[5].id}`) cy.visit(`/lists/${lists[5].id}`)
cy.wait('@loadNamespaces') cy.wait('@loadNamespaces')
cy.wait('@loadList')
cy.visit('/') cy.visit('/')
cy.wait('@loadNamespaces') cy.wait('@loadNamespaces')