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

@ -33,9 +33,9 @@ context('Delete Channel Browser Testing', () => {
cy.get(menuQuery.join(' '))
.invoke('attr', 'data-src')
.then(url => cy.encodeUrl(url).then(id => {
cy.visit('/circle/@' + id + '/circle-information');
cy.visit('/circles/@' + id + '/circles-information');
cy.location().should((loc) => {
expect(loc.pathname).to.eq('/circle/@' + id + '/circle-information');
expect(loc.pathname).to.eq('/circles/@' + id + '/circles-information');
});
}));
});
@ -43,18 +43,18 @@ context('Delete Channel Browser Testing', () => {
cy.get(menuCountQuery.join(' ')).its('length').then(length => channelsLength = length);
});
it('should click button to retire the channel', () => {
cy.get('#circle-profile solid-delete[data-label="Supprimer le canal"] button').click();
cy.get('#circles-profile solid-delete[data-label="Supprimer le canal"] button').click();
});
it('should stay on channel edit screen', () => {
cy.get(menuQuery.join(' '))
.invoke('attr', 'data-src')
.then(url => cy.encodeUrl(url).then(id => {
cy.location().should((loc) => {
expect(loc.pathname).to.eq('/circle/@' + id + '/circle-information');
expect(loc.pathname).to.eq('/circles/@' + id + '/circles-information');
});
}));
});
it('should check if chennel was retired', () => {
it('should check if channel was retired', () => {
cy.get(menuCountQuery.join(' ')).its('length').should(length => {
expect(length).to.eq(channelsLength - 1);
});

View File

@ -33,27 +33,27 @@ context('Edit Channel Browser Testing', () => {
cy.get(menuQuery.join(' '))
.invoke('attr', 'data-src')
.then(url => cy.encodeUrl(url).then(id => {
cy.visit('/circle/@' + id + '/circle-information/circle-edit');
cy.visit('/circles/@' + id + '/circles-information/circles-edit');
cy.location().should((loc) => {
expect(loc.pathname).to.eq('/circle/@' + id + '/circle-information/circle-edit');
expect(loc.pathname).to.eq('/circles/@' + id + '/circles-information/circles-edit');
});
}));
});
it('should enter new channel data', () => {
cy.get('#circle-edit input[name="name"]').clear().type(channelName);
cy.get('#circle-edit input[name="name"]').should('have.value', channelName);
cy.get('#circle-edit input[name="description"]').clear().type(description);
cy.get('#circle-edit input[name="description"]').should('have.value', description);
cy.get('#circles-edit input[name="name"]').clear().type(channelName);
cy.get('#circles-edit input[name="name"]').should('have.value', channelName);
cy.get('#circles-edit input[name="description"]').clear().type(description);
cy.get('#circles-edit input[name="description"]').should('have.value', description);
});
it('should click button to save the channel', () => {
cy.get('#circle-edit input[value="Enregistrer"]').click();
cy.get('#circles-edit input[value="Enregistrer"]').click();
});
it('should land on channel information screen', () => {
cy.get(menuQuery.join(' '))
.invoke('attr', 'data-src')
.then(url => cy.encodeUrl(url).then(id => {
cy.location().should((loc) => {
expect(loc.pathname).to.eq('/circle/@' + id + '/circle-information');
expect(loc.pathname).to.eq('/circles/@' + id + '/circles-information');
});
}));
});

View File

@ -35,29 +35,29 @@ context('Edit Project Browser Testing', () => {
cy.get(menuQuery.join(' '))
.invoke('attr', 'data-src')
.then(url => cy.encodeUrl(url).then(id => {
cy.visit('/project/@' + id + '/project-information/project-edit');
cy.visit('/projects/@' + id + '/projects-information/projects-edit');
cy.location().should((loc) => {
expect(loc.pathname).to.eq('/project/@' + id + '/project-information/project-edit');
expect(loc.pathname).to.eq('/projects/@' + id + '/projects-information/projects-edit');
});
}));
});
it('should enter new project data', () => {
cy.get('#project-edit input[name="customer.name"]').clear().type(customerName);
cy.get('#project-edit input[name="customer.name"]').should('have.value', customerName);
cy.get('#project-edit input[name="name"]').clear().type(projectName);
cy.get('#project-edit input[name="name"]').should('have.value', projectName);
cy.get('#project-edit textarea[name="description"]').clear().type(description);
cy.get('#project-edit textarea[name="description"]').should('have.value', description);
cy.get('#projects-edit input[name="customer.name"]').clear().type(customerName);
cy.get('#projects-edit input[name="customer.name"]').should('have.value', customerName);
cy.get('#projects-edit input[name="name"]').clear().type(projectName);
cy.get('#projects-edit input[name="name"]').should('have.value', projectName);
cy.get('#projects-edit textarea[name="description"]').clear().type(description);
cy.get('#projects-edit textarea[name="description"]').should('have.value', description);
});
it('should click button to save the project', () => {
cy.get('#project-edit input[value="Enregistrer"]').click();
cy.get('#projects-edit input[value="Enregistrer"]').click();
});
it('should land on project information screen', () => {
cy.get(menuQuery.join(' '))
.invoke('attr', 'data-src')
.then(url => cy.encodeUrl(url).then(id => {
cy.location().should((loc) => {
expect(loc.pathname).to.eq('/project/@' + id + '/project-information');
expect(loc.pathname).to.eq('/projects/@' + id + '/projects-information');
});
}));
});

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
});
});

View File

@ -33,7 +33,7 @@ context('Leave Channel Browser Testing', () => {
cy.get(tableListQuery.join(' ')).its('length').as('channelsLength');
cy.get(tableQuery.join(' ')).click();
});
it('should check if chennel was left', () => {
it('should check if channel was left', () => {
cy.get(tableListQuery.join(' ')).its('length').should(length => {
expect(length).to.eq(this.channelsLength - 1);
});

View File

@ -33,9 +33,9 @@ context('Retire Channel Browser Testing', () => {
cy.get(menuQuery.join(' '))
.invoke('attr', 'data-src')
.then(url => cy.encodeUrl(url).then(id => {
cy.visit('/circle/@' + id + '/circle-information/circle-edit');
cy.visit('/circles/@' + id + '/circles-information/circles-edit');
cy.location().should((loc) => {
expect(loc.pathname).to.eq('/circle/@' + id + '/circle-information/circle-edit');
expect(loc.pathname).to.eq('/circles/@' + id + '/circles-information/circles-edit');
});
}));
});
@ -50,11 +50,11 @@ context('Retire Channel Browser Testing', () => {
.invoke('attr', 'data-src')
.then(url => cy.encodeUrl(url).then(id => {
cy.location().should((loc) => {
expect(loc.pathname).to.eq('/circle/@' + id + '/circle-information/circle-edit');
expect(loc.pathname).to.eq('/circles/@' + id + '/circles-information/circles-edit');
});
}));
});
it('should check if chennel was retired', () => {
it('should check if channel was retired', () => {
cy.get(menuCountQuery.join(' ')).its('length').should(length => {
expect(length).to.eq(channelsLength - 1);
});

View File

@ -33,9 +33,9 @@ context('Retire Project Browser Testing', () => {
cy.get(menuQuery.join(' '))
.invoke('attr', 'data-src')
.then(url => cy.encodeUrl(url).then(id => {
cy.visit('/project/@' + id + '/project-information/project-edit');
cy.visit('/projects/@' + id + '/projects-information/projects-edit');
cy.location().should((loc) => {
expect(loc.pathname).to.eq('/project/@' + id + '/project-information/project-edit');
expect(loc.pathname).to.eq('/projects/@' + id + '/projects-information/projects-edit');
});
}));
});
@ -50,7 +50,7 @@ context('Retire Project Browser Testing', () => {
.invoke('attr', 'data-src')
.then(url => cy.encodeUrl(url).then(id => {
cy.location().should((loc) => {
expect(loc.pathname).to.eq('/project/@' + id + '/project-information/project-edit');
expect(loc.pathname).to.eq('/projects/@' + id + '/projects-information/projects-edit');
});
}));
});

View File

@ -78,7 +78,7 @@ context('Browser testing', () => {
// it('should open the circle information page', () => {
// cy.screenshot();
// cy.get('#navbar-router').contains(name).click();
// cy.get('[name="circle-information"] > li').click();
// cy.get('[name="circles-information"] > li').click();
// });
// it('should delete the circle', () => {
// cy.get('.box-button > solid-ac-checker > .button').click();