Last active
January 5, 2019 21:24
-
-
Save M-Izadmehr/52411580ddaa481b17e542a4f8399648 to your computer and use it in GitHub Desktop.
End-to-End (E2E) code samples: searching medium with cypress
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('medium search', () => { | |
it('should successfully find my profile', () => { | |
cy.visit('https://medium.com/search'); | |
/** | |
* the functional chains used to: | |
* select search input, type values, press enter, and assert the first test | |
*/ | |
cy | |
.get('form [type="Search"]') | |
.type('Izadmehr') | |
.type('{enter}') | |
.should('have.value', 'Izadmehr'); | |
/** | |
* now click the profile link | |
*/ | |
cy.get('[data-user-id="43f4a4c78443"]:first').click(); | |
/** | |
* and here expect to find the avatar image, and it should have attribute of height | |
*/ | |
cy.get('img[alt="Mojtaba Izadmehr"]').should('have.attr', 'height'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment