This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
beforeEach(function () { | |
cy.log('I run before every test in every spec file!!!!!!') | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('Hooks', function() { | |
before(function() { | |
// runs once before all tests in the block | |
}) | |
after(function() { | |
// runs once after all tests in the block | |
}) | |
beforeEach(function() { | |
// runs before each test in the block | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('Login Page', function () { | |
it('should login successfully', function () { | |
cy.visit('/'); | |
cy.get('[data-test=loginInput]').type('admin'); | |
cy.get('[data-test=passwordInput]').type('timmy'); | |
cy.get('[data-test=submitButton]').click(); | |
cy.url().should('eq', Cypress.env('baseUrl') + '/todo'); | |
}); | |
... | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cy.visit('localhost:5000/todos'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cy.get('button[type=submit]').click(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cy.get('[data-test=todoItem]') | |
.its('length') | |
.should('be.greaterThan', 0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//You can put a cy.get inside a expect to make assertions. | |
expect(true).to.be(true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cy.route('GET', '**/todos/list', 'fixture:todos-list.json'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Login | |
I want to log in the application | |
Scenario: Log in successful | |
Given I am at the login page | |
When I type the correct username | |
And I type the correct password | |
And I click to log in | |
Then I should be on the todo page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Tasting experience | |
Scenario: | |
When I put a banana in the bowl | |
And I put milk | |
And I taste it | |
Then The taste should be good | |
Scenario: | |
When I put a banana in the bowl |
OlderNewer