Adding watchers testing
parent
073d515f7f
commit
051b8c42bd
|
@ -6,7 +6,7 @@ var chaiAsPromised = require('chai-as-promised');
|
||||||
chai.use(chaiAsPromised);
|
chai.use(chaiAsPromised);
|
||||||
var expect = chai.expect;
|
var expect = chai.expect;
|
||||||
|
|
||||||
describe.only('Issue detail', async function(){
|
describe('Issue detail', async function(){
|
||||||
let issuesUrl = "";
|
let issuesUrl = "";
|
||||||
before(async function(){
|
before(async function(){
|
||||||
utils.common.goHome();
|
utils.common.goHome();
|
||||||
|
@ -28,6 +28,8 @@ describe.only('Issue detail', async function(){
|
||||||
|
|
||||||
it('assigned to edition', utils.detail.assignedToTesting);
|
it('assigned to edition', utils.detail.assignedToTesting);
|
||||||
|
|
||||||
|
it('watchers edition', utils.detail.watchersTesting);
|
||||||
|
|
||||||
it('history', utils.detail.historyTesting);
|
it('history', utils.detail.historyTesting);
|
||||||
|
|
||||||
it('screenshot', async function() {
|
it('screenshot', async function() {
|
||||||
|
|
|
@ -29,6 +29,8 @@ describe('Task detail', function(){
|
||||||
|
|
||||||
it('assigned to edition', utils.detail.assignedToTesting);
|
it('assigned to edition', utils.detail.assignedToTesting);
|
||||||
|
|
||||||
|
it('watchers edition', utils.detail.watchersTesting);
|
||||||
|
|
||||||
it('history', utils.detail.historyTesting);
|
it('history', utils.detail.historyTesting);
|
||||||
|
|
||||||
it('screenshot', async function() {
|
it('screenshot', async function() {
|
||||||
|
|
|
@ -28,6 +28,8 @@ describe('User story detail', function(){
|
||||||
|
|
||||||
it('assigned to edition', utils.detail.assignedToTesting);
|
it('assigned to edition', utils.detail.assignedToTesting);
|
||||||
|
|
||||||
|
it('watchers edition', utils.detail.watchersTesting);
|
||||||
|
|
||||||
it('history', utils.detail.historyTesting);
|
it('history', utils.detail.historyTesting);
|
||||||
|
|
||||||
it('screenshot', async function() {
|
it('screenshot', async function() {
|
||||||
|
|
|
@ -326,3 +326,56 @@ helper.attachment = function() {
|
||||||
|
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
helper.watchers = function() {
|
||||||
|
let el = $('section[tg-watchers]');
|
||||||
|
|
||||||
|
let obj = {
|
||||||
|
el: el,
|
||||||
|
|
||||||
|
addWatcher: function() {
|
||||||
|
el.$('.add-watcher').click();
|
||||||
|
},
|
||||||
|
|
||||||
|
getWatchersUserNames: function() {
|
||||||
|
return el.$$('.watcher-name span').getText();
|
||||||
|
},
|
||||||
|
|
||||||
|
removeAllWathchers: async function() {
|
||||||
|
let deleteIcons = await el.$$('.icon-delete')
|
||||||
|
let totalWatchers = deleteIcons.length;
|
||||||
|
|
||||||
|
while (totalWatchers > 0) {
|
||||||
|
el.$$('.icon-delete').first().click()
|
||||||
|
await utils.lightbox.confirm.ok();
|
||||||
|
await browser.waitForAngular();
|
||||||
|
totalWatchers --;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return obj;
|
||||||
|
};
|
||||||
|
|
||||||
|
helper.watchersLightbox = function() {
|
||||||
|
let el = $('div[tg-lb-watchers]');
|
||||||
|
|
||||||
|
let obj = {
|
||||||
|
el: el,
|
||||||
|
waitOpen: function() {
|
||||||
|
return utils.lightbox.open(el);
|
||||||
|
},
|
||||||
|
waitClose: function() {
|
||||||
|
return utils.lightbox.close(el);
|
||||||
|
},
|
||||||
|
selectFirst: async function() {
|
||||||
|
el.$$('div[data-user-id]').first().click();
|
||||||
|
await browser.waitForAngular();
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
return obj;
|
||||||
|
};
|
||||||
|
|
|
@ -148,3 +148,23 @@ helper.deleteTesting = async function() {
|
||||||
let deleteHelper = detailHelper.delete();
|
let deleteHelper = detailHelper.delete();
|
||||||
await deleteHelper.delete();
|
await deleteHelper.delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
helper.watchersTesting = async function() {
|
||||||
|
let watchersHelper = detailHelper.watchers();
|
||||||
|
let watchersLightboxHelper = detailHelper.watchersLightbox();
|
||||||
|
let userNames = await watchersHelper.getWatchersUserNames();
|
||||||
|
|
||||||
|
//Add watcher
|
||||||
|
watchersHelper.addWatcher();
|
||||||
|
watchersLightboxHelper.waitOpen();
|
||||||
|
watchersLightboxHelper.selectFirst();
|
||||||
|
watchersLightboxHelper.waitClose();
|
||||||
|
|
||||||
|
let newUserNames = await watchersHelper.getWatchersUserNames();
|
||||||
|
expect(newUserNames.join()).to.be.equal(userNames + ',Administrator');
|
||||||
|
|
||||||
|
//Clear watchers
|
||||||
|
await watchersHelper.removeAllWathchers();
|
||||||
|
newUserNames = await watchersHelper.getWatchersUserNames();
|
||||||
|
expect(newUserNames.join()).to.be.equal('');
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue