Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Last active October 5, 2020 10:00
Embed
What would you like to do?
describe('Testing Google Search', () => {
// To Pass the Test Case 1
it('I can search for Valid Content on Google', () => {
cy.visit('https://www.google.com');
cy.get("input[title='Search']").type('Cypress').type({enter});
cy.contains('https://www.cypress.io');
});
// To Fail the Test Case 2
it('I can navigate to Wrong URL’', () => {
cy.visit('http://localhost:8080');
cy.get("input[title='Search']").type('Cypress').type({enter});
cy.contains('https://www.cypress.io');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment