Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Last active October 5, 2020 10:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save velotiotech/92c324def128e451f97a90df7a254a5a to your computer and use it in GitHub Desktop.
Save velotiotech/92c324def128e451f97a90df7a254a5a to your computer and use it in GitHub Desktop.
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