persistence.spec.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /// <reference types="cypress" />
  2. describe('persisted stores', () => {
  3. it('should not fail when persisted store is initialised', () => {
  4. cy.visit('/tests/cypress/fixtures/persistence/init.html')
  5. cy.get('p').should('have.text', 'bar')
  6. })
  7. it('should persist data between visits', () => {
  8. cy.visit('/tests/cypress/fixtures/persistence/check-persisted.html')
  9. cy.get('p').should('have.text', 'bar')
  10. cy.get('button').click()
  11. cy.get('p').should('have.text', 'car')
  12. cy.reload()
  13. cy.get('p').should('have.text', 'car')
  14. })
  15. it('should persist data between visits using a custom driver', () => {
  16. cy.visit('/tests/cypress/fixtures/persistence/check-persisted.html')
  17. cy.get('p').should('have.text', 'bar')
  18. cy.get('button').click()
  19. cy.get('p').should('have.text', 'car')
  20. cy.reload()
  21. cy.get('p').should('have.text', 'car')
  22. })
  23. it('should be able to call store methods when persisted', () => {
  24. cy.visit('/tests/cypress/fixtures/persistence/store-methods.html')
  25. cy.get('p').should('have.text', 'bar')
  26. cy.get('button').click()
  27. cy.get('p').should('have.text', 'car')
  28. })
  29. })