major: startinblox-feature-requests#181

This commit is contained in:
Jean-Baptiste Pasquier
2021-02-22 21:27:58 +01:00
parent 5cc3e9b7f4
commit e28af8a048
97 changed files with 2166 additions and 1625 deletions

View File

@ -27,38 +27,38 @@ context('Edit User Browser Testing', () => {
it('should login', () => cy.login());
describe('User Edition process', () => {
it('should visit the user edit screen', () => {
cy.visit('/profile/solid-profile-edit-profile');
cy.visit('/members/members-edit-profile');
cy.location().should((loc) => {
expect(loc.pathname).to.eq('/profile/solid-profile-edit-profile');
expect(loc.pathname).to.eq('/members/members-edit-profile');
});
});
/// Workaround - Routing bug - user won't land on edit profile screen
it('should navigate to user edit screen', () => {
cy.get('#solid-profile-my-profile solid-link[next="solid-profile-edit-profile"]').click();
cy.get('#members-my-profile solid-link[next="members-edit-profile"]').click();
});
/// End workaround
it('should enter new user data', () => {
cy.get('#solid-profile-edit-profile input[name="first_name"]').clear().type(userFirstName);
cy.get('#solid-profile-edit-profile input[name="first_name"]').should('have.value', userFirstName);
cy.get('#solid-profile-edit-profile input[name="last_name"]').clear().type(userLastName);
cy.get('#solid-profile-edit-profile input[name="last_name"]').should('have.value', userLastName);
cy.get('#solid-profile-edit-profile textarea[name="profile.job"]').clear().type(jobDescription);
cy.get('#solid-profile-edit-profile textarea[name="profile.job"]').should('have.value', jobDescription);
cy.get('#solid-profile-edit-profile input[name="profile.city"]').clear().type(city);
cy.get('#solid-profile-edit-profile input[name="profile.city"]').should('have.value', city);
cy.get('#solid-profile-edit-profile input[name="profile.phone"]').clear().type(phone);
cy.get('#solid-profile-edit-profile input[name="profile.phone"]').should('have.value', phone);
cy.get('#solid-profile-edit-profile input[name="profile.website"]').clear().type(website);
cy.get('#solid-profile-edit-profile input[name="profile.website"]').should('have.value', website);
cy.get('#members-edit-profile input[name="first_name"]').clear().type(userFirstName);
cy.get('#members-edit-profile input[name="first_name"]').should('have.value', userFirstName);
cy.get('#members-edit-profile input[name="last_name"]').clear().type(userLastName);
cy.get('#members-edit-profile input[name="last_name"]').should('have.value', userLastName);
cy.get('#members-edit-profile textarea[name="profile.job"]').clear().type(jobDescription);
cy.get('#members-edit-profile textarea[name="profile.job"]').should('have.value', jobDescription);
cy.get('#members-edit-profile input[name="profile.city"]').clear().type(city);
cy.get('#members-edit-profile input[name="profile.city"]').should('have.value', city);
cy.get('#members-edit-profile input[name="profile.phone"]').clear().type(phone);
cy.get('#members-edit-profile input[name="profile.phone"]').should('have.value', phone);
cy.get('#members-edit-profile input[name="profile.website"]').clear().type(website);
cy.get('#members-edit-profile input[name="profile.website"]').should('have.value', website);
});
it('should click button to save the user', () => {
cy.get('#solid-profile-edit-profile input[value="ENREGISTRER"]').click();
cy.get('#members-edit-profile input[value="ENREGISTRER"]').click();
});
it('should land on user information screen', () => {
cy.location().should(location => {
/// Workaround - Routing bug - route pathname won't be /profile as it should
expect(location.pathname).to.eq('/');
// expect(location.pathname).to.eq('/profile');
// expect(location.pathname).to.eq('/members');
/// End workaround
});
});