Skip to content

Commit

Permalink
fix(e2e): typofix in e2e service tests
Browse files Browse the repository at this point in the history
This commit fixes a misleading typo in the services end-to-end tests
that labled the execution as "Projects Module".  It goes on to fix a
problematic upper-bound on the random choice of service to delete.
  • Loading branch information
jniles committed Mar 3, 2016
1 parent 1c618b6 commit 894e305
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
4 changes: 2 additions & 2 deletions client/test/e2e/projects/projects.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var helpers = require('../shared/helpers');

helpers.configure(chai);

describe('The Projects Module', function () {
describe('Projects Module', function () {
'use strict';

var path = '#/projects';
Expand Down Expand Up @@ -125,7 +125,7 @@ describe('The Projects Module', function () {
});

it('cancellation of removal process of a project', function () {

// click the remove a project
element(by.id('project-del-' + deleteError )).click();

Expand Down
31 changes: 15 additions & 16 deletions client/test/e2e/services/services.spec.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
/*global describe, it, element, by, beforeEach, inject, browser */
/*global it, element, by, beforeEach, inject, browser */

var chai = require('chai');
var expect = chai.expect;

var FormUtils = require('../shared/FormUtils');
var helpers = require('../shared/helpers');
helpers.configure(chai);

var FormUtils = require('../shared/FormUtils');
describe('Services Module', function () {

describe('The Projects Module', function () {
// shared methods
var path = '#/services';
var SERVICE = {
Expand All @@ -17,32 +18,32 @@ describe('The Projects Module', function () {
var DEFAULT_SERVICE = 4;
var SERVICE_RANK = helpers.random(DEFAULT_SERVICE);

var DELETE_SUCCESS = 5;
var DELETE_SUCCESS = 4;
var DELETE_ERROR = 3;


// navigate to the Service module before each test
beforeEach(function () {
browser.get(path);
});

it('Successfully creates a new Service', function () {
it('successfully creates a new service', function () {
FormUtils.buttons.create();

FormUtils.input('ServicesCtrl.service.name', SERVICE.name);
// select a random, Enterprise

// select a random, enterprise
FormUtils.select('ServicesCtrl.service.enterprise_id')
.enabled()
.first()
.click();

// select a random, Cost Center
// select a random, cost center
FormUtils.select('ServicesCtrl.service.cost_center_id')
.enabled()
.first()
.click();

// select a random, Profit center
// select a random, profit center
FormUtils.select('ServicesCtrl.service.profit_center_id')
.enabled()
.first()
Expand All @@ -54,8 +55,7 @@ describe('The Projects Module', function () {
FormUtils.exists(by.id('create_success'), true);
});


it('Successfully edits an Service', function () {
it('successfully edits an service', function () {
element(by.id('service-upd-' + SERVICE_RANK )).click();
FormUtils.input('ServicesCtrl.service.name', 'Updated');
element(by.id('change_service')).click();
Expand All @@ -77,24 +77,23 @@ describe('The Projects Module', function () {
// The following fields is not required
FormUtils.validation.ok('ServicesCtrl.service.cost_center_id');
FormUtils.validation.ok('ServicesCtrl.service.profit_center_id');
});
});

it('Successfully delete an Service', function () {
it('successfully delete an service', function () {
element(by.id('service-del-' + DELETE_SUCCESS )).click();
browser.switchTo().alert().accept();
FormUtils.exists(by.id('delete_success'), true);
});

it('No way to delete a Service', function () {
it('no way to delete a service', function () {
element(by.id('service-del-' + DELETE_ERROR )).click();
browser.switchTo().alert().accept();
FormUtils.exists(by.id('delete_error'), true);
});

it('Cancellation of removal process of a Service', function () {
it('cancellation of removal process of a service', function () {
element(by.id('service-del-' + DELETE_ERROR )).click();
browser.switchTo().alert().dismiss();
FormUtils.exists(by.id('default'), true);
});

});

0 comments on commit 894e305

Please sign in to comment.