fix backlog e2e tests

stable
Juanfran 2016-01-27 09:51:36 +01:00
parent 13e9dc8872
commit adf65e7d57
5 changed files with 31 additions and 19 deletions

View File

@ -373,8 +373,7 @@ CreateEditUserstoryDirective = ($repo, $model, $rs, $rootScope, lightboxService,
broadcastEvent = "usform:edit:success"
promise.then (data) ->
createAttachments(data)
deleteAttachments(data)
deleteAttachments(data).then () => createAttachments(data)
return data

View File

@ -40,9 +40,7 @@ helper.getCreateEditUsLightbox = function() {
return utils.popover.open(role, value);
},
getRolePoints: function() {
let role = obj.roles().get(0);
return role.$('.points').getText();
return el.$$('.ticket-role-points').last().$('.points').getText();
}
};
@ -154,6 +152,10 @@ helper.setUsPoints = async function(item, value1, value2) {
return utils.popover.open(points, value1, value2);
};
helper.getUsPoints = async function(item) {
return $$('.backlog-table-body > div .us-points').get(item).$$('span').get(0).getText();
};
helper.deleteUs = function(item) {
$$('.backlog-table-body > div .icon-delete').get(item).click();
};

View File

@ -54,10 +54,10 @@ helper.lightboxAttachment = async function() {
var fileToUpload1 = utils.common.uploadImagePath();
var fileToUpload2 = utils.common.uploadFilePath();
await utils.common.uploadFile(addAttachment, fileToUpload1)
await utils.common.uploadFile(addAttachment, fileToUpload2)
await utils.common.uploadFile(addAttachment, fileToUpload1);
await utils.common.uploadFile(addAttachment, fileToUpload2);
el.$$('.attachment-delete').get(0).click()
el.$$('.attachment-delete').get(0).click();
let newCountAttachments = await el.$$('.single-attachment').count();

View File

@ -220,6 +220,7 @@ shared.attachmentTesting = async function() {
var fileToUpload = commonUtil.uploadFilePath();
await attachmentHelper.upload(fileToUpload, 'This is the testing name ' + date);
await browser.sleep(5000);
// Check set name
let name = await attachmentHelper.getLastAttachmentName();

View File

@ -23,6 +23,7 @@ describe('backlog', function() {
backlogHelper.openNewUs();
createUSLightbox = backlogHelper.getCreateEditUsLightbox();
await createUSLightbox.waitOpen();
});
@ -35,8 +36,8 @@ describe('backlog', function() {
createUSLightbox.subject().sendKeys('subject');
// roles
createUSLightbox.setRole(1, 3);
createUSLightbox.setRole(3, 4);
await createUSLightbox.setRole(1, 3);
await createUSLightbox.setRole(3, 4);
let totalPoints = await createUSLightbox.getRolePoints();
@ -74,6 +75,8 @@ describe('backlog', function() {
await utils.lightbox.close(createUSLightbox.el);
await browser.waitForAngular();
let newUsCount = await backlogHelper.userStories().count();
expect(newUsCount).to.be.equal(usCount + 1);
@ -128,10 +131,10 @@ describe('backlog', function() {
editUSLightbox.subject().sendKeys('subjectedit');
// roles
editUSLightbox.setRole(1, 3);
editUSLightbox.setRole(2, 3);
editUSLightbox.setRole(3, 3);
editUSLightbox.setRole(4, 3);
await editUSLightbox.setRole(0, 3);
await editUSLightbox.setRole(1, 3);
await editUSLightbox.setRole(2, 3);
await editUSLightbox.setRole(3, 3);
let totalPoints = await editUSLightbox.getRolePoints();
@ -175,9 +178,13 @@ describe('backlog', function() {
});
it('edit points inline', async function() {
let usPointsOriginal = await backlogHelper.getUsPoints(0, 1, 1);
await backlogHelper.setUsPoints(0, 1, 1);
expect(utils.notifications.success.open()).to.be.eventually.true;
let usPointsNew = await backlogHelper.getUsPoints(0);
expect(usPointsOriginal).not.to.be.equal(usPointsNew);
});
it('delete US', async function() {
@ -197,7 +204,6 @@ describe('backlog', function() {
let dragElement = dragableElements.get(1);
let dragElementHandler = dragElement.$('.icon-drag-v');
let draggedElementRef = await backlogHelper.getUsRef(dragElement);
await utils.common.drag(dragElementHandler, dragableElements.get(0));
@ -334,7 +340,7 @@ describe('backlog', function() {
let firstInput = dragableElements.get(0).$('input[type="checkbox"]');
let lastInput = dragableElements.get(3).$('input[type="checkbox"]');
browser.actions()
await browser.actions()
.mouseMove(firstInput)
.keyDown(protractor.Key.SHIFT)
.click()
@ -549,7 +555,9 @@ describe('backlog', function() {
await utils.common.drag(dragElement, dragableElements.get(0));
expect(utils.notifications.error.open()).to.be.eventually.true;
let waitErrorOpen = await utils.notifications.error.open();
expect(waitErrorOpen).to.be.true;
await utils.notifications.error.close();
});
@ -562,7 +570,9 @@ describe('backlog', function() {
await transition();
expect(menu.getCssValue('width')).to.be.eventually.equal('0px');
let waitWidth = await menu.getCssValue('width');
expect(waitWidth).to.be.equal('0px');
});
});