Skip to content

Instantly share code, notes, and snippets.

@dejanvasic85
Created August 7, 2020 11:38
Show Gist options
  • Save dejanvasic85/6d72c1e3c334fd874744106fb7a8e84b to your computer and use it in GitHub Desktop.
Save dejanvasic85/6d72c1e3c334fd874744106fb7a8e84b to your computer and use it in GitHub Desktop.
Cypress Example
/// <reference types="cypress" />
context('Invite Client', () => {
after(() => {
cy.logout().then(() => {
cy.url().should('contains', Cypress.env('base_login_url'));
});
});
it('should display the profile page with confirmed email', () => {
const username = Cypress.env('accountant_username');
const password = Cypress.env('accountant_password');
cy.login(username, password).then(({ access_token }) => {
cy.log('logged in successfully', access_token);
// Menu Selection
cy.getByTag('profileMenu').click();
cy.getByTag('profileView').click();
// Confirm email
cy.getByTag('emailValue').should('contain.text', username);
cy.log('/api/graphql - me');
cy.getMe(access_token).then(({ body }) => {
const {
data: {
me: { firstName, lastName, phone },
},
} = body;
cy.get('#firstName').should('have.value', firstName);
cy.get('#lastName').should('have.value', lastName);
cy.get('#phone').should('have.value', phone);
});
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment