Skip to content

Commit

Permalink
test: fixed remaining broken tests CU-1k6t94[closed]
Browse files Browse the repository at this point in the history
  • Loading branch information
mbetancurt committed Jul 13, 2020
1 parent d35bbbf commit 9e5288d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 40 deletions.
9 changes: 2 additions & 7 deletions cypress/integration/dsh_list_users.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,8 @@ const users = [

describe('SP2: (Dashboard): All Users', function () {
beforeEach('Auth', function () {
cy
.request('POST', API + 'auth/login', { username: 'admin', password: 'admin' })
.then((response) => {
// response.body is automatically serialized into JSON
cy.setCookie('user', 'admin');
cy.setCookie('jwt', response.body);
});
cy.setCookie('sneaky', 'admin');
cy.setCookie('hummingbird', 'admin');
cy.server(); // enable response stubbing
cy.route({
method: 'GET', // Route all GET requests
Expand Down
43 changes: 10 additions & 33 deletions cypress/integration/dsh_sidemenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,52 +4,29 @@ UseCase 01A: Create new Operation
import {API} from '../../src/consts';
describe('SP: Dashboard', function () {
it('All buttons of the sidemenu - admin', function() {
cy
.request('POST', API + 'auth/login', { username: 'admin', password: 'admin' })
.then((response) => {
// response.body is automatically serialized into JSON
cy.setCookie('user', 'admin');
cy.setCookie('jwt', response.body);
});

cy.setCookie('sneaky', 'admin');
cy.setCookie('hummingbird', 'admin');
cy.visit('http://localhost:2000/dashboard/');
cy.contains('dsh.returnmap').click();
cy.visit('http://localhost:2000/dashboard/');
});
it('All buttons of the sidemenu - admin', function() {
cy
.request('POST', API + 'auth/login', { username: 'admin', password: 'admin' })
.then((response) => {
// response.body is automatically serialized into JSON
cy.setCookie('user', 'admin');
cy.setCookie('jwt', response.body);
});
cy.setCookie('sneaky', 'admin');
cy.setCookie('hummingbird', 'admin');
cy.visit('http://localhost:2000/dashboard/');
cy.contains('dsh.all_users').click();
cy.contains('dsh.operations_list').click();
cy.contains('dsh.vehicles_list').click();
cy.contains('dsh.logout').click();
});
it('All buttons of the sidemenu - pilot', function() {
cy
.request('POST', API + 'auth/login', { username: 'RenatePenvarden', password: 'xD6lJ9ATuA' })
.then((response) => {
// response.body is automatically serialized into JSON
cy.setCookie('user', 'RenatePenvarden');
cy.setCookie('jwt', response.body);
});

cy.setCookie('sneaky', 'RenatePenvarden');
cy.setCookie('hummingbird', 'xD6lJ9ATuA');
cy.visit('http://localhost:2000/dashboard/');
cy.get('.dshSide > .bp3-menu > li:nth-child(1) > .bp3-menu-item > .bp3-text-overflow-ellipsis').click();
cy.get('.dshSide > .bp3-menu > li:nth-child(2) > .bp3-menu-item > .bp3-text-overflow-ellipsis').click();
cy.get('.dashboard > .dshSide > .bp3-menu > li:nth-child(2) > .bp3-menu-item').click();
cy.get('.dshSide > .bp3-menu > li:nth-child(5) > .bp3-menu-item > .bp3-text-overflow-ellipsis').click();
cy.get('.dshSide > .bp3-menu > li:nth-child(8) > .bp3-menu-item > .bp3-text-overflow-ellipsis').click();
cy.get('.dashboard > .dshSide > .bp3-menu > li:nth-child(10) > .bp3-menu-item').click();
cy.get('#dshContentCont > .bp3-form-group > .bp3-form-content > .bp3-input-group > #text-nNumber').click();
cy.get('.dshSide > .bp3-menu > li:nth-child(11) > .bp3-menu-item > .bp3-text-overflow-ellipsis').click();
cy.get('.dshSide > .bp3-menu > li:nth-child(6) > .bp3-menu-item > .bp3-text-overflow-ellipsis').click();
cy.get('.bp3-dialog-container > .bp3-dialog > .logoutButtons > .bp3-intent-success > .bp3-button-text').click();
cy.contains('dsh.edit_your_info').click();
cy.contains('dsh.operations_list_pilot').click();
cy.contains('dsh.vehicles_new').click();
cy.contains('dsh.vehicles_list_pilot').click();
});

});

0 comments on commit 9e5288d

Please sign in to comment.