before()와 beforeEach()
before와 beforeEach
before()
위 테스트의 문제점
beforeEach
Last updated
before와 beforeEach
Last updated
describe('My first test', () => {
it('visit!!!', () => {
cy.visit('https://example.cypress.io');
cy.contains('type').click();
cy.url().should('include', 'commands/actions');
cy.get('.action-email')
.type('fake@email.com')
.should('have.value', 'fake@email.com');
})
it('doesnt isolated!!!', () => {
cy.visit('https://example.cypress.io');
cy.contains('type').click();
})
});describe('My first test', () => {
before(() => {
cy.visit('https://example.cypress.io');
})
it('visit!!!', () => {
cy.contains('type').click();
cy.url().should('include', 'commands/actions');
cy.get('.action-email')
.type('fake@email.com')
.should('have.value', 'fake@email.com');
})
it('doesnt isolated!!!', () => {
cy.contains('type').click();
})
});describe('My first test', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io');
})
it('visit!!!', () => {
cy.contains('type').click();
cy.url().should('include', 'commands/actions');
cy.get('.action-email')
.type('fake@email.com')
.should('have.value', 'fake@email.com');
})
it('doesnt isolated!!!', () => {
cy.contains('type').click();
})
});