diff --git a/e2e/full/issues/issue-detail.e2e.js b/e2e/full/issues/issue-detail.e2e.js new file mode 100644 index 00000000..a2debbc5 --- /dev/null +++ b/e2e/full/issues/issue-detail.e2e.js @@ -0,0 +1,24 @@ +var utils = require('../../utils'); + +var chai = require('chai'); +var chaiAsPromised = require('chai-as-promised'); + +chai.use(chaiAsPromised); +var expect = chai.expect; + +describe('Issue detail', function(){ + before(async function(){ + browser.get('http://localhost:9001/project/project-2/issue/95'); + await utils.common.waitLoader(); + }); + + it('screenshot', async function() { + await utils.common.takeScreenshot("issues", "detail"); + }); + + it('assigned to', utils.detailAssignedTo.assignedToTesting); + + it('screenshot', async function() { + await utils.common.takeScreenshot("issues", "detail updated"); + }); +}) diff --git a/e2e/full/taskboard.e2e.js b/e2e/full/taskboard.e2e.js index ded536f3..48ff2077 100644 --- a/e2e/full/taskboard.e2e.js +++ b/e2e/full/taskboard.e2e.js @@ -8,7 +8,7 @@ var chaiAsPromised = require('chai-as-promised'); chai.use(chaiAsPromised); var expect = chai.expect; -describe.only('taskboard', function() { +describe('taskboard', function() { before(async function() { browser.get('http://localhost:9001/project/project-0/backlog'); diff --git a/e2e/full/tasks/task-detail.e2e.js b/e2e/full/tasks/task-detail.e2e.js new file mode 100644 index 00000000..1f8b5331 --- /dev/null +++ b/e2e/full/tasks/task-detail.e2e.js @@ -0,0 +1,24 @@ +var utils = require('../../utils'); + +var chai = require('chai'); +var chaiAsPromised = require('chai-as-promised'); + +chai.use(chaiAsPromised); +var expect = chai.expect; + +describe('Task detail', function(){ + before(async function(){ + browser.get('http://localhost:9001/project/project-2/task/4'); + await utils.common.waitLoader(); + }); + + it('screenshot', async function() { + await utils.common.takeScreenshot("tasks", "detail"); + }); + + it('assigned to', utils.detailAssignedTo.assignedToTesting); + + it('screenshot', async function() { + await utils.common.takeScreenshot("tasks", "detail updated"); + }); +}) diff --git a/e2e/full/user-stories/user-story-detail.e2e.js b/e2e/full/user-stories/user-story-detail.e2e.js new file mode 100644 index 00000000..16bc5221 --- /dev/null +++ b/e2e/full/user-stories/user-story-detail.e2e.js @@ -0,0 +1,24 @@ +var utils = require('../../utils'); + +var chai = require('chai'); +var chaiAsPromised = require('chai-as-promised'); + +chai.use(chaiAsPromised); +var expect = chai.expect; + +describe('USer story detail', function(){ + before(async function(){ + browser.get('http://localhost:9001/project/project-2/us/65'); + await utils.common.waitLoader(); + }); + + it('screenshot', async function() { + await utils.common.takeScreenshot("user-stories", "detail"); + }); + + it('assigned to', utils.detailAssignedTo.assignedToTesting); + + it('screenshot', async function() { + await utils.common.takeScreenshot("user-stories", "detail updated"); + }); +}) diff --git a/e2e/helpers/detail-assigned-to-helper.js b/e2e/helpers/detail-assigned-to-helper.js new file mode 100644 index 00000000..bc44a8f6 --- /dev/null +++ b/e2e/helpers/detail-assigned-to-helper.js @@ -0,0 +1,47 @@ +var utils = require('../utils'); + +var helper = module.exports; + +helper.assignedTo = function() { + let el = $('.assigned-to'); + + let obj = { + el: el, + clear: async function() { + el.$('.icon-delete').click(); + await utils.lightbox.confirm.ok(); + await browser.waitForAngular(); + }, + + assign: function() { + el.$('.user-assigned').click(); + }, + + getUserName: function() { + return el.$('.user-assigned').getText(); + } + + }; + + return obj; +}; + +helper.assignToLightbox = function() { + let el = $('div[tg-lb-assignedto]'); + + let obj = { + el: el, + waitOpen: function() { + return utils.lightbox.open(el); + }, + waitClose: function() { + return utils.lightbox.close(el); + }, + selectFirst: function() { + el.$$('div[data-user-id]').first().click(); + } + + }; + + return obj; +}; diff --git a/e2e/helpers/index.js b/e2e/helpers/index.js index 02f9e949..86b60939 100644 --- a/e2e/helpers/index.js +++ b/e2e/helpers/index.js @@ -2,3 +2,4 @@ module.exports.backlog = require("./backlog-helper"); module.exports.taskboard = require("./taskboard-helper"); module.exports.team = require("./team-helper"); module.exports.wiki = require("./wiki-helper"); +module.exports.detailAssignedTo = require("./detail-assigned-to-helper"); diff --git a/e2e/utils/detail-assigned-to.js b/e2e/utils/detail-assigned-to.js new file mode 100644 index 00000000..e5e4ec59 --- /dev/null +++ b/e2e/utils/detail-assigned-to.js @@ -0,0 +1,23 @@ +var detailAssignedToHelper = require('../helpers').detailAssignedTo; + +var chai = require('chai'); +var chaiAsPromised = require('chai-as-promised'); + +chai.use(chaiAsPromised); +var expect = chai.expect; + +var helper = module.exports; + +helper.assignedToTesting = async function() { + let assignedTo = detailAssignedToHelper.assignedTo(); + let assignToLightbox = detailAssignedToHelper.assignToLightbox(); + + let userName = detailAssignedToHelper.assignedTo().getUserName(); + await assignedTo.clear(); + assignedTo.assign(); + assignToLightbox.waitOpen(); + assignToLightbox.selectFirst(); + assignToLightbox.waitClose(); + let newUserName = assignedTo.getUserName(); + expect(newUserName).to.be.not.equal(userName); +} diff --git a/e2e/utils/index.js b/e2e/utils/index.js index 7a8ba243..75f490a0 100644 --- a/e2e/utils/index.js +++ b/e2e/utils/index.js @@ -2,3 +2,4 @@ module.exports.common = require("./common"); module.exports.notifications = require("./notifications"); module.exports.lightbox = require("./lightbox"); module.exports.popover = require("./popover"); +module.exports.detailAssignedTo = require("./detail-assigned-to");