
Ví dụ về đoạn code cơ bản trong Cypress
//Mô tả function
describe('sign-in successfully', function() {
//Mô tả summary của testcase
it('should sign in successfully', function() {
//Steps
//truy cập vào trang web
cy.visit('https://blabla.com')
//nhập username
cy.get('#username').type('Nhựt đẹp trai')
//nhập password
cy.get('#password').type('123')
//click sign-in button
cy.get('#button').click()
//verify expected result
cy.url().should('include', 'chứa đoạn url')
})
})
0 Comments:
Đăng nhận xét