fix issues e2e
parent
905c5a61cb
commit
87fa24c521
|
@ -8,7 +8,7 @@ span.detail-status-inner.js-edit-status(
|
||||||
span.icon.icon-arrow-bottom
|
span.icon.icon-arrow-bottom
|
||||||
<% }%>
|
<% }%>
|
||||||
|
|
||||||
ul.pop-status
|
ul.popover.pop-status
|
||||||
<% _.each(statuses, function(st) { %>
|
<% _.each(statuses, function(st) { %>
|
||||||
li
|
li
|
||||||
a.status(
|
a.status(
|
||||||
|
|
|
@ -14,6 +14,10 @@ helper.title = function() {
|
||||||
setTitle: function(title) {
|
setTitle: function(title) {
|
||||||
el.$('.view-subject').click();
|
el.$('.view-subject').click();
|
||||||
el.$('.edit-subject input').clear().sendKeys(title);
|
el.$('.edit-subject input').clear().sendKeys(title);
|
||||||
|
},
|
||||||
|
|
||||||
|
save: function() {
|
||||||
|
el.$('.save').click();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -94,16 +98,15 @@ helper.statusSelector = function() {
|
||||||
el: el,
|
el: el,
|
||||||
|
|
||||||
setStatus: async function(value) {
|
setStatus: async function(value) {
|
||||||
let status = el.$('.status-data');
|
let status = el.$('.detail-status-inner');
|
||||||
|
|
||||||
await utils.popover.open(status, value);
|
await utils.popover.open(status, value);
|
||||||
return this.getSelectedStatus()
|
|
||||||
|
return this.getSelectedStatus();
|
||||||
},
|
},
|
||||||
getSelectedStatus: async function(){
|
getSelectedStatus: async function(){
|
||||||
return el.$('.status-status').getInnerHtml();
|
return el.$$('.detail-status-inner span').first().getInnerHtml();
|
||||||
},
|
}
|
||||||
getGeneralStatus: async function(){
|
|
||||||
return el.$('.detail-status').getInnerHtml();
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return obj;
|
return obj;
|
||||||
|
@ -115,10 +118,12 @@ helper.assignedTo = function() {
|
||||||
let obj = {
|
let obj = {
|
||||||
el: el,
|
el: el,
|
||||||
clear: async function() {
|
clear: async function() {
|
||||||
await browser.actions().mouseMove(el).perform();
|
|
||||||
|
|
||||||
if (await el.$('.icon-delete').isPresent()) {
|
if (await el.$('.icon-delete').isPresent()) {
|
||||||
el.$('.icon-delete').click();
|
await browser.actions()
|
||||||
|
.mouseMove(el.$('.icon-delete'))
|
||||||
|
.click()
|
||||||
|
.perform();
|
||||||
|
|
||||||
await utils.lightbox.confirm.ok();
|
await utils.lightbox.confirm.ok();
|
||||||
await browser.waitForAngular();
|
await browser.waitForAngular();
|
||||||
}
|
}
|
||||||
|
@ -128,6 +133,9 @@ helper.assignedTo = function() {
|
||||||
},
|
},
|
||||||
getUserName: function() {
|
getUserName: function() {
|
||||||
return el.$('.user-assigned').getText();
|
return el.$('.user-assigned').getText();
|
||||||
|
},
|
||||||
|
isUnassigned: function() {
|
||||||
|
return el.$('.assign-to-me').isPresent();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -393,7 +401,7 @@ helper.attachment = function() {
|
||||||
|
|
||||||
|
|
||||||
helper.watchers = function() {
|
helper.watchers = function() {
|
||||||
let el = $('.ticket-track-buttons .ticket-watchers');
|
let el = $('.ticket-watch-buttons');
|
||||||
|
|
||||||
let obj = {
|
let obj = {
|
||||||
el: el,
|
el: el,
|
||||||
|
|
|
@ -17,9 +17,15 @@ shared.titleTesting = async function() {
|
||||||
let titleHelper = detailHelper.title();
|
let titleHelper = detailHelper.title();
|
||||||
let title = await titleHelper.getTitle();
|
let title = await titleHelper.getTitle();
|
||||||
let date = Date.now();
|
let date = Date.now();
|
||||||
|
|
||||||
titleHelper.setTitle("New title " + date);
|
titleHelper.setTitle("New title " + date);
|
||||||
|
titleHelper.save();
|
||||||
|
|
||||||
let newTitle = await titleHelper.getTitle();
|
let newTitle = await titleHelper.getTitle();
|
||||||
|
expect(notifications.success.open()).to.be.eventually.true;
|
||||||
expect(newTitle).to.be.not.equal(title);
|
expect(newTitle).to.be.not.equal(title);
|
||||||
|
|
||||||
|
await notifications.success.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
shared.tagsTesting = async function() {
|
shared.tagsTesting = async function() {
|
||||||
|
@ -28,7 +34,8 @@ shared.tagsTesting = async function() {
|
||||||
await tagsHelper.clearTags();
|
await tagsHelper.clearTags();
|
||||||
let date = Date.now();
|
let date = Date.now();
|
||||||
let tags = [1, 2, 3].map((i) => date + "-" + i);
|
let tags = [1, 2, 3].map((i) => date + "-" + i);
|
||||||
tagsHelper.addTags(tags);
|
|
||||||
|
await tagsHelper.addTags(tags);
|
||||||
|
|
||||||
let newtagsText = await tagsHelper.getTagsText();
|
let newtagsText = await tagsHelper.getTagsText();
|
||||||
|
|
||||||
|
@ -42,38 +49,37 @@ shared.descriptionTesting = async function() {
|
||||||
descriptionHelper.enabledEditionMode();
|
descriptionHelper.enabledEditionMode();
|
||||||
descriptionHelper.setText("New description " + date);
|
descriptionHelper.setText("New description " + date);
|
||||||
descriptionHelper.save();
|
descriptionHelper.save();
|
||||||
|
|
||||||
let newDescription = await descriptionHelper.getInnerHtml();
|
let newDescription = await descriptionHelper.getInnerHtml();
|
||||||
|
|
||||||
|
expect(notifications.success.open()).to.be.eventually.true;
|
||||||
expect(newDescription).to.be.not.equal(description);
|
expect(newDescription).to.be.not.equal(description);
|
||||||
|
|
||||||
|
await notifications.success.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
shared.statusTesting = async function() {
|
shared.statusTesting = async function() {
|
||||||
let statusHelper = detailHelper.statusSelector();
|
let statusHelper = detailHelper.statusSelector();
|
||||||
|
|
||||||
// Current status
|
|
||||||
let selectedStatus = await statusHelper.getSelectedStatus();
|
|
||||||
let genericStatus = await statusHelper.getGeneralStatus();
|
|
||||||
expect(selectedStatus).to.be.equal(genericStatus);
|
|
||||||
|
|
||||||
// Status 1
|
// Status 1
|
||||||
await statusHelper.setStatus(1);
|
await statusHelper.setStatus(1);
|
||||||
|
|
||||||
selectedStatus = await statusHelper.getSelectedStatus();
|
let selectedStatus = await statusHelper.getSelectedStatus();
|
||||||
genericStatus = await statusHelper.getGeneralStatus();
|
expect(selectedStatus).to.be.equal('In progress');
|
||||||
expect(selectedStatus).to.be.equal(genericStatus);
|
|
||||||
|
|
||||||
// Status 2
|
// Status 2
|
||||||
await statusHelper.setStatus(2);
|
await statusHelper.setStatus(2);
|
||||||
|
|
||||||
let newSelectedStatus = await statusHelper.getSelectedStatus();
|
let newSelectedStatus = await statusHelper.getSelectedStatus();
|
||||||
let newGenericStatus = await statusHelper.getGeneralStatus();
|
expect(newSelectedStatus).to.be.equal('Ready for test');
|
||||||
expect(newSelectedStatus).to.be.equal(newGenericStatus);
|
|
||||||
expect(newSelectedStatus).to.be.not.equal(selectedStatus);
|
await notifications.success.close();
|
||||||
expect(newGenericStatus).to.be.not.equal(genericStatus);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
shared.assignedToTesting = function() {
|
shared.assignedToTesting = function() {
|
||||||
before(function () {
|
before(function () {
|
||||||
let assignedTo = detailHelper.assignedTo();
|
let assignedTo = detailHelper.assignedTo();
|
||||||
|
|
||||||
return assignedTo.clear();
|
return assignedTo.clear();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -97,13 +103,10 @@ shared.assignedToTesting = function() {
|
||||||
|
|
||||||
it('unassign', async function() {
|
it('unassign', async function() {
|
||||||
let assignedTo = detailHelper.assignedTo();
|
let assignedTo = detailHelper.assignedTo();
|
||||||
let assignToLightbox = commonHelper.assignToLightbox();
|
|
||||||
|
|
||||||
await assignedTo.clear();
|
await assignedTo.clear();
|
||||||
|
|
||||||
let newUserName = await assignedTo.getUserName();
|
expect(assignedTo.isUnassigned()).to.be.eventually.true;
|
||||||
|
|
||||||
expect(newUserName).to.be.equal('Not assigned');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('filter', async function () {
|
it('filter', async function () {
|
||||||
|
@ -206,6 +209,8 @@ shared.blockTesting = async function() {
|
||||||
blockHelper.unblock();
|
blockHelper.unblock();
|
||||||
|
|
||||||
expect($('.block-description').isDisplayed()).to.be.eventually.false;
|
expect($('.block-description').isDisplayed()).to.be.eventually.false;
|
||||||
|
|
||||||
|
await notifications.success.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
shared.attachmentTesting = async function() {
|
shared.attachmentTesting = async function() {
|
||||||
|
@ -360,29 +365,28 @@ shared.watchersTesting = function() {
|
||||||
shared.customFields = function(typeIndex) {
|
shared.customFields = function(typeIndex) {
|
||||||
before(async function() {
|
before(async function() {
|
||||||
let url = await browser.getCurrentUrl();
|
let url = await browser.getCurrentUrl();
|
||||||
|
|
||||||
let rootUrl = await commonUtil.getProjectUrlRoot();
|
let rootUrl = await commonUtil.getProjectUrlRoot();
|
||||||
|
|
||||||
browser.get(rootUrl + '/admin/project-values/custom-fields');
|
browser.get(rootUrl + '/admin/project-values/custom-fields');
|
||||||
|
|
||||||
commonUtil.waitLoader();
|
await customFieldsHelper.create(typeIndex, 'detail-test-custom-fields-text', 'desc1', 1);
|
||||||
|
|
||||||
customFieldsHelper.create(typeIndex, 'detail-test-custom-fields-text', 'desc1', 1);
|
|
||||||
|
|
||||||
// debounce :(
|
// debounce :(
|
||||||
browser.sleep(2000);
|
await browser.sleep(2000);
|
||||||
|
|
||||||
customFieldsHelper.create(typeIndex, 'detail-test-custom-fields-multi', 'desc1', 3);
|
await customFieldsHelper.create(typeIndex, 'detail-test-custom-fields-multi', 'desc1', 3);
|
||||||
|
|
||||||
// debounce :(
|
// debounce :(
|
||||||
browser.sleep(2000);
|
await browser.sleep(2000);
|
||||||
|
|
||||||
browser.get(url);
|
browser.get(url);
|
||||||
commonUtil.waitLoader();
|
|
||||||
|
await commonUtil.waitLoader();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('text create', async function() {
|
it('text create', async function() {
|
||||||
let customFields = customFieldsHelper.getDetailFields();
|
let customFields = customFieldsHelper.getDetailFields();
|
||||||
|
|
||||||
|
// await browser.sleep(4000);
|
||||||
let count = await customFields.count();
|
let count = await customFields.count();
|
||||||
|
|
||||||
let textField = customFields.get(count - 2);
|
let textField = customFields.get(count - 2);
|
||||||
|
|
|
@ -7,7 +7,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 issueUrl = '';
|
let issueUrl = '';
|
||||||
|
|
||||||
before(async function(){
|
before(async function(){
|
||||||
|
|
|
@ -11,6 +11,7 @@ var expect = chai.expect;
|
||||||
describe('issues list', function() {
|
describe('issues list', function() {
|
||||||
before(async function() {
|
before(async function() {
|
||||||
browser.get(browser.params.glob.host + 'project/project-3/issues');
|
browser.get(browser.params.glob.host + 'project/project-3/issues');
|
||||||
|
|
||||||
await utils.common.waitLoader();
|
await utils.common.waitLoader();
|
||||||
|
|
||||||
utils.common.takeScreenshot('issues', 'issues');
|
utils.common.takeScreenshot('issues', 'issues');
|
||||||
|
@ -55,6 +56,8 @@ describe('issues list', function() {
|
||||||
await createIssueLightbox.waitClose();
|
await createIssueLightbox.waitClose();
|
||||||
|
|
||||||
expect(utils.notifications.success.open()).to.be.eventually.true;
|
expect(utils.notifications.success.open()).to.be.eventually.true;
|
||||||
|
|
||||||
|
await utils.notifications.success.close();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -83,6 +86,8 @@ describe('issues list', function() {
|
||||||
await createIssueLightbox.waitClose();
|
await createIssueLightbox.waitClose();
|
||||||
|
|
||||||
expect(utils.notifications.success.open()).to.be.eventually.true;
|
expect(utils.notifications.success.open()).to.be.eventually.true;
|
||||||
|
|
||||||
|
await utils.notifications.success.close();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ var helper = module.exports;
|
||||||
var common = require('./common');
|
var common = require('./common');
|
||||||
|
|
||||||
var actions = {
|
var actions = {
|
||||||
project: function(index) {
|
project: async function(index) {
|
||||||
browser.actions().mouseMove($('div[tg-dropdown-project-list]')).perform();
|
browser.actions().mouseMove($('div[tg-dropdown-project-list]')).perform();
|
||||||
|
|
||||||
let project = null;
|
let project = null;
|
||||||
|
@ -14,12 +14,12 @@ var actions = {
|
||||||
project = $$('div[tg-dropdown-project-list] li a').get(index);
|
project = $$('div[tg-dropdown-project-list] li a').get(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
common.link(project);
|
await common.link(project);
|
||||||
|
|
||||||
return common.waitLoader();
|
return common.waitLoader();
|
||||||
},
|
},
|
||||||
issues: function(index) {
|
issues: async function(index) {
|
||||||
common.link($('#nav-issues a'));
|
await common.link($('#nav-issues a'));
|
||||||
|
|
||||||
return common.waitLoader();
|
return common.waitLoader();
|
||||||
},
|
},
|
||||||
|
@ -30,8 +30,8 @@ var actions = {
|
||||||
|
|
||||||
return common.waitLoader();
|
return common.waitLoader();
|
||||||
},
|
},
|
||||||
backlog: function() {
|
backlog: async function() {
|
||||||
common.link($('#nav-backlog a'));
|
await common.link($('#nav-backlog a'));
|
||||||
|
|
||||||
return common.waitLoader();
|
return common.waitLoader();
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
var common = require('./common')
|
var common = require('./common');
|
||||||
|
|
||||||
var popover = module.exports;
|
var popover = module.exports;
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ async function selectPopoverItem(popover, item) {
|
||||||
popover.wait = async function() {
|
popover.wait = async function() {
|
||||||
await browser.wait(async function() {
|
await browser.wait(async function() {
|
||||||
return await $$('.popover.active').count() === 1;
|
return await $$('.popover.active').count() === 1;
|
||||||
}, 1000);
|
}, 3000);
|
||||||
|
|
||||||
return $('.popover.active');
|
return $('.popover.active');
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue