Thẻ: cypress

  • Viết E2E test cho Angular bằng Cypress

    Viết E2E test cho Angular bằng Cypress

    Lý do viết E2E test 🛠️ 1. Thiết lập Cypress và viết test đầu tiên ✅ Các bước chính: 🧪 Viết test đầu tiên: // src/support/app.po.tsexport const getHeaderTitle = () => cy.get(‘.toolbar__title’);// src/e2e/app.cy.tsdescribe(‘ng-cypress-starter’, () => { beforeEach(() => cy.visit(‘/’)); it(‘should display the correct header title’, () => { getHeaderTitle().should(‘contain.text’,’Your first Cypress test in Angular’); });});…