move utils.details to shared

stable
Juanfran 2015-11-30 09:53:24 +01:00
parent cbe286b6de
commit d3b7d736d1
6 changed files with 53 additions and 50 deletions

View File

@ -2,8 +2,8 @@ var path = require('path');
var detailHelper = require('../helpers').detail;
var commonHelper = require('../helpers').common;
var customFieldsHelper = require('../helpers/custom-fields-helper');
var commonUtil = require('./common');
var notifications = require('./notifications');
var commonUtil = require('../utils/common');
var notifications = require('../utils/notifications');
var chai = require('chai');
var chaiAsPromised = require('chai-as-promised');
@ -11,9 +11,9 @@ var chaiAsPromised = require('chai-as-promised');
chai.use(chaiAsPromised);
var expect = chai.expect;
var helper = module.exports;
var shared = module.exports;
helper.titleTesting = async function() {
shared.titleTesting = async function() {
let titleHelper = detailHelper.title();
let title = await titleHelper.getTitle();
let date = Date.now();
@ -22,7 +22,7 @@ helper.titleTesting = async function() {
expect(newTitle).to.be.not.equal(title);
}
helper.tagsTesting = async function() {
shared.tagsTesting = async function() {
let tagsHelper = detailHelper.tags();
let tagsText = await tagsHelper.getTagsText();
await tagsHelper.clearTags();
@ -35,7 +35,7 @@ helper.tagsTesting = async function() {
expect(newtagsText).to.be.not.eql(tagsText);
}
helper.descriptionTesting = async function() {
shared.descriptionTesting = async function() {
let descriptionHelper = detailHelper.description();
let description = await descriptionHelper.getInnerHtml();
let date = Date.now();
@ -46,7 +46,7 @@ helper.descriptionTesting = async function() {
expect(newDescription).to.be.not.equal(description);
}
helper.statusTesting = async function() {
shared.statusTesting = async function() {
let statusHelper = detailHelper.statusSelector();
// Current status
@ -71,7 +71,7 @@ helper.statusTesting = async function() {
expect(newGenericStatus).to.be.not.equal(genericStatus);
}
helper.assignedToTesting = function() {
shared.assignedToTesting = function() {
before(function () {
let assignedTo = detailHelper.assignedTo();
return assignedTo.clear();
@ -156,7 +156,7 @@ helper.assignedToTesting = function() {
});
}
helper.historyTesting = async function() {
shared.historyTesting = async function() {
let historyHelper = detailHelper.history();
//Adding a comment
@ -188,7 +188,7 @@ helper.historyTesting = async function() {
expect(activitiesCounter).to.be.least(newCommentsCounter);
}
helper.blockTesting = async function() {
shared.blockTesting = async function() {
let blockHelper = detailHelper.block();
let blockLightboxHelper = detailHelper.blockLightbox();
@ -208,7 +208,7 @@ helper.blockTesting = async function() {
expect($('.block-description').isDisplayed()).to.be.eventually.false;
}
helper.attachmentTesting = async function() {
shared.attachmentTesting = async function() {
let attachmentHelper = detailHelper.attachment();
let date = Date.now();
@ -256,12 +256,12 @@ helper.attachmentTesting = async function() {
expect(newAttachmentsLength).to.be.equal(attachmentsLength - 1);
}
helper.deleteTesting = async function() {
shared.deleteTesting = async function() {
let deleteHelper = detailHelper.delete();
await deleteHelper.delete();
}
helper.watchersTesting = function() {
shared.watchersTesting = function() {
before(function () {
let watchersHelper = detailHelper.watchers();
return watchersHelper.removeAllWatchers();
@ -345,7 +345,7 @@ helper.watchersTesting = function() {
});
}
helper.customFields = function(typeIndex) {
shared.customFields = function(typeIndex) {
before(async function() {
let url = await browser.getCurrentUrl();

View File

@ -1,4 +1,5 @@
var utils = require('../../utils');
var sharedDetail = require('../../shared/detail');
var chai = require('chai');
var chaiAsPromised = require('chai-as-promised');
@ -6,7 +7,7 @@ var chaiAsPromised = require('chai-as-promised');
chai.use(chaiAsPromised);
var expect = chai.expect;
describe('Issue detail', async function(){
describe.only('Issue detail', async function(){
let issueUrl = '';
before(async function(){
@ -24,32 +25,32 @@ describe('Issue detail', async function(){
await utils.common.takeScreenshot("issues", "detail");
});
it('title edition', utils.detail.titleTesting);
it('title edition', sharedDetail.titleTesting);
it('tags edition', utils.detail.tagsTesting);
it('tags edition', sharedDetail.tagsTesting);
it('description edition', utils.detail.descriptionTesting);
it('description edition', sharedDetail.descriptionTesting);
it('status edition', utils.detail.statusTesting);
it('status edition', sharedDetail.statusTesting);
describe('assigned to edition', utils.detail.assignedToTesting);
describe('assigned to edition', sharedDetail.assignedToTesting);
describe('watchers edition', utils.detail.watchersTesting);
describe('watchers edition', sharedDetail.watchersTesting);
it('history', utils.detail.historyTesting);
it('history', sharedDetail.historyTesting);
it('block', utils.detail.blockTesting);
it('block', sharedDetail.blockTesting);
it('attachments', utils.detail.attachmentTesting);
it('attachments', sharedDetail.attachmentTesting);
describe('custom-fields', utils.detail.customFields.bind(this, 2));
describe('custom-fields', sharedDetail.customFields.bind(this, 2));
it('screenshot', async function() {
await utils.common.takeScreenshot("issues", "detail updated");
});
describe('delete & redirect', function() {
it('delete', utils.detail.deleteTesting);
it('delete', sharedDetail.deleteTesting);
it('redirected', async function (){
let url = await browser.getCurrentUrl();

View File

@ -1,4 +1,5 @@
var utils = require('../../utils');
var sharedDetail = require('../../shared/detail');
var taskDetailHelper = require('../../helpers').taskDetail;
var chai = require('chai');
@ -26,17 +27,17 @@ describe('Task detail', function(){
await utils.common.takeScreenshot("tasks", "detail");
});
it('title edition', utils.detail.titleTesting);
it('title edition', sharedDetail.titleTesting);
it('tags edition', utils.detail.tagsTesting);
it('tags edition', sharedDetail.tagsTesting);
it('description edition', utils.detail.descriptionTesting);
it('description edition', sharedDetail.descriptionTesting);
it('status edition', utils.detail.statusTesting);
it('status edition', sharedDetail.statusTesting);
describe('assigned to edition', utils.detail.assignedToTesting);
describe('assigned to edition', sharedDetail.assignedToTesting);
describe('watchers edition', utils.detail.watchersTesting);
describe('watchers edition', sharedDetail.watchersTesting);
it('iocaine edition', async function() {
// Toggle iocaine status
@ -52,20 +53,20 @@ describe('Task detail', function(){
expect(newIsIocaine).to.be.equal(isIocaine);
});
it('history', utils.detail.historyTesting);
it('history', sharedDetail.historyTesting);
it('block', utils.detail.blockTesting);
it('block', sharedDetail.blockTesting);
it('attachments', utils.detail.attachmentTesting);
it('attachments', sharedDetail.attachmentTesting);
describe('custom-fields', utils.detail.customFields.bind(this, 1));
describe('custom-fields', sharedDetail.customFields.bind(this, 1));
it('screenshot', async function() {
await utils.common.takeScreenshot("tasks", "detail updated");
});
describe('delete & redirect', function() {
it('delete', utils.detail.deleteTesting);
it('delete', sharedDetail.deleteTesting);
it('redirected', async function (){
let url = await browser.getCurrentUrl();

View File

@ -1,4 +1,5 @@
var utils = require('../../utils');
var sharedDetail = require('../../shared/detail');
var usDetailHelper = require('../../helpers').usDetail;
var chai = require('chai');
@ -25,15 +26,15 @@ describe('User story detail', function(){
await utils.common.takeScreenshot("user-stories", "detail");
});
it('title edition', utils.detail.titleTesting);
it('title edition', sharedDetail.titleTesting);
it('tags edition', utils.detail.tagsTesting);
it('tags edition', sharedDetail.tagsTesting);
it('description edition', utils.detail.descriptionTesting);
it('description edition', sharedDetail.descriptionTesting);
it('status edition', utils.detail.statusTesting);
it('status edition', sharedDetail.statusTesting);
describe('assigned to edition', utils.detail.assignedToTesting);
describe('assigned to edition', sharedDetail.assignedToTesting);
it('team requirement edition', async function() {
let requirementHelper = usDetailHelper.teamRequirement();
@ -65,15 +66,15 @@ describe('User story detail', function(){
expect(isRequired).to.be.equal(newIsRequired);
});
describe('watchers edition', utils.detail.watchersTesting);
describe('watchers edition', sharedDetail.watchersTesting);
it('history', utils.detail.historyTesting);
it('history', sharedDetail.historyTesting);
it('block', utils.detail.blockTesting);
it('block', sharedDetail.blockTesting);
it('attachments', utils.detail.attachmentTesting);
it('attachments', sharedDetail.attachmentTesting);
describe('custom-fields', utils.detail.customFields.bind(this, 0));
describe('custom-fields', sharedDetail.customFields.bind(this, 0));
describe('related tasks', function() {
it('create', async function() {
@ -118,7 +119,7 @@ describe('User story detail', function(){
});
describe('delete & redirect', function() {
it('delete', utils.detail.deleteTesting);
it('delete', sharedDetail.deleteTesting);
it('redirected', async function (){
let url = await browser.getCurrentUrl();

View File

@ -1,4 +1,5 @@
var utils = require('../utils');
var sharedDetail = require('../shared/detail');
var wikiHelper = require('../helpers').wiki;
var chai = require('chai');
@ -71,7 +72,7 @@ describe('wiki', function() {
await utils.common.takeScreenshot("wiki", "home-edition");
});
it('attachments', utils.detail.attachmentTesting);
it('attachments', sharedDetail.attachmentTesting);
it('delete', async function() {
await wikiHelper.editor().delete();

View File

@ -2,5 +2,4 @@ module.exports.common = require("./common");
module.exports.notifications = require("./notifications");
module.exports.lightbox = require("./lightbox");
module.exports.popover = require("./popover");
module.exports.detail = require("./detail");
module.exports.nav = require("./nav");