toast.spec.js 876 B

1234567891011121314151617
  1. // Start writing your Cypress tests below!
  2. // If you're unfamiliar with how Cypress works,
  3. // check out the link below and learn how to write your first test:
  4. // https://on.cypress.io/writing-first-test
  5. describe('toast', () => {
  6. it('useToast', () => {
  7. cy.visit("http://localhost:6006/iframe.html?id=toast--use-toast-demo&args=&viewMode=story");
  8. cy.get('.semi-button').click();
  9. cy.get('[data-cy=context-holder] .semi-toast').contains("ReachableContext: Light");
  10. cy.get('[data-cy=context-holder] .semi-toast').should("have.length", 5);
  11. cy.wait(100);
  12. cy.get('[data-cy=context-holder] .semi-toast').should("have.length", 4);
  13. cy.get('[data-cy=context-holder] .semi-toast .semi-toast-close-button .semi-button').first().click();
  14. cy.get('[data-cy=context-holder] .semi-toast').should("have.length", 3);
  15. });
  16. });