[e2e] Fix some tests
parent
167a67558f
commit
c091744fa1
|
@ -28,7 +28,7 @@ describe('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.only('watchers edition', utils.detail.watchersTesting);
|
||||||
|
|
||||||
it('history', utils.detail.historyTesting);
|
it('history', utils.detail.historyTesting);
|
||||||
|
|
||||||
|
|
|
@ -58,10 +58,12 @@ helper.tags = function() {
|
||||||
clearTags: async function() {
|
clearTags: async function() {
|
||||||
let tags = await el.$$('.icon-delete');
|
let tags = await el.$$('.icon-delete');
|
||||||
let totalTags = tags.length;
|
let totalTags = tags.length;
|
||||||
|
let htmlChanges = null;
|
||||||
while (totalTags > 0) {
|
while (totalTags > 0) {
|
||||||
el.$$('.icon-delete').first().click();
|
htmlChanges = await utils.common.outerHtmlChanges(el.$(".tags-container"));
|
||||||
await browser.waitForAngular();
|
await el.$$('.icon-delete').first().click();
|
||||||
totalTags --;
|
totalTags --;
|
||||||
|
await htmlChanges();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -76,10 +78,14 @@ helper.tags = function() {
|
||||||
},
|
},
|
||||||
|
|
||||||
addTags: async function(tags) {
|
addTags: async function(tags) {
|
||||||
|
let htmlChanges = null
|
||||||
|
|
||||||
el.$('.add-tag').click();
|
el.$('.add-tag').click();
|
||||||
for (let tag of tags){
|
for (let tag of tags){
|
||||||
|
htmlChanges = await utils.common.outerHtmlChanges(el.$(".tags-container"));
|
||||||
el.$('.tag-input').sendKeys(tag);
|
el.$('.tag-input').sendKeys(tag);
|
||||||
browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
await browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||||
|
await htmlChanges();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -381,24 +387,24 @@ helper.watchers = function() {
|
||||||
let obj = {
|
let obj = {
|
||||||
el: el,
|
el: el,
|
||||||
|
|
||||||
addWatcher: function() {
|
addWatcher: async function() {
|
||||||
el.$('.add-watcher').click();
|
await el.$('.add-watcher').click();
|
||||||
},
|
},
|
||||||
|
|
||||||
getWatchersUserNames: function() {
|
getWatchersUserNames: async function() {
|
||||||
return el.$$('.watcher-name span').getText();
|
return el.$$('.watcher-name span').getText();
|
||||||
},
|
},
|
||||||
|
|
||||||
removeAllWathchers: async function() {
|
removeAllWathchers: async function() {
|
||||||
let deleteIcons = await el.$$('.icon-delete');
|
let totalWatchers = await await el.$$('.icon-delete').count();
|
||||||
let totalWatchers = deleteIcons.length;
|
|
||||||
|
|
||||||
|
let htmlChanges = htmlChanges = await utils.common.outerHtmlChanges(el);
|
||||||
while (totalWatchers > 0) {
|
while (totalWatchers > 0) {
|
||||||
el.$$('.icon-delete').first().click();
|
await el.$$('.icon-delete').first().click();
|
||||||
await utils.lightbox.confirm.ok();
|
await utils.lightbox.confirm.ok();
|
||||||
await browser.waitForAngular();
|
totalWatchers --;
|
||||||
totalWatchers --;
|
|
||||||
}
|
}
|
||||||
|
await htmlChanges();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,6 @@ helper.tagsTesting = async function() {
|
||||||
let date = Date.now();
|
let date = Date.now();
|
||||||
let tags = [1, 2, 3, 4, 5].map((i) => date + "-" + i);
|
let tags = [1, 2, 3, 4, 5].map((i) => date + "-" + i);
|
||||||
tagsHelper.addTags(tags);
|
tagsHelper.addTags(tags);
|
||||||
await browser.waitForAngular();
|
|
||||||
let newtagsText = await tagsHelper.getTagsText();
|
let newtagsText = await tagsHelper.getTagsText();
|
||||||
expect(newtagsText).to.be.not.equal(tagsText);
|
expect(newtagsText).to.be.not.equal(tagsText);
|
||||||
}
|
}
|
||||||
|
@ -189,22 +188,21 @@ helper.deleteTesting = async function() {
|
||||||
|
|
||||||
helper.watchersTesting = async function() {
|
helper.watchersTesting = async function() {
|
||||||
let watchersHelper = detailHelper.watchers();
|
let watchersHelper = detailHelper.watchers();
|
||||||
|
|
||||||
await watchersHelper.removeAllWathchers();
|
await watchersHelper.removeAllWathchers();
|
||||||
|
|
||||||
let watchersLightboxHelper = detailHelper.watchersLightbox();
|
let watchersLightboxHelper = detailHelper.watchersLightbox();
|
||||||
let userNames = await watchersHelper.getWatchersUserNames();
|
let userNames = await watchersHelper.getWatchersUserNames();
|
||||||
|
|
||||||
//Add watcher
|
//Add watcher
|
||||||
watchersHelper.addWatcher();
|
await watchersHelper.addWatcher();
|
||||||
await watchersLightboxHelper.waitOpen();
|
await watchersLightboxHelper.waitOpen();
|
||||||
let newWatcherName = await watchersLightboxHelper.getFirstName();
|
let newWatcherName = await watchersLightboxHelper.getFirstName();
|
||||||
watchersLightboxHelper.selectFirst();
|
await watchersLightboxHelper.selectFirst();
|
||||||
await watchersLightboxHelper.waitClose();
|
await watchersLightboxHelper.waitClose();
|
||||||
|
|
||||||
let newUserNames = await watchersHelper.getWatchersUserNames();
|
let newUserNames = await watchersHelper.getWatchersUserNames();
|
||||||
|
|
||||||
userNames.push(newWatcherName);
|
await userNames.push(newWatcherName);
|
||||||
|
|
||||||
expect(newUserNames.join(',')).to.be.equal(userNames.join(','));
|
expect(newUserNames.join(',')).to.be.equal(userNames.join(','));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue