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