improve lightbox close e2e

stable
Juanfran 2016-09-28 09:56:32 +02:00
parent 473362d772
commit d95e4778c8
3 changed files with 16 additions and 18 deletions

View File

@ -357,9 +357,10 @@ shared.attachmentTesting = async function() {
let previewSrc2 = await attachmentHelper.getPreviewSrc();
expect(previewSrc).not.to.be.equal(previewSrc2);
await lightbox.exit();
expect(previewSrc).not.to.be.equal(previewSrc2);
// Deleting
attachmentsLength = await attachmentHelper.countAttachments();
await attachmentHelper.deleteLastAttachment();

View File

@ -10,6 +10,7 @@ var sharedFilters = require('../shared/filters');
chai.use(chaiAsPromised);
var expect = chai.expect;
describe('backlog', function() {
before(async function() {
browser.get(browser.params.glob.host + 'project/project-3/backlog');
@ -160,6 +161,7 @@ describe('backlog', function() {
});
});
it('edit status inline', async function() {
await backlogHelper.setUsStatus(0, 1);
@ -209,7 +211,7 @@ describe('backlog', function() {
expect(firstElementTextRef).to.be.equal(draggedElementRef);
});
it.skip('reorder multiple us', async function() {
it('reorder multiple us', async function() {
let dragableElements = backlogHelper.userStories();
let count = await dragableElements.count();
@ -237,7 +239,7 @@ describe('backlog', function() {
expect(elementRef1).to.be.equal(draggedRefs[1]);
});
it.skip('drag multiple us to milestone', async function() {
it('drag multiple us to milestone', async function() {
let sprint = backlogHelper.sprints().get(0);
let initUssSprintCount = await backlogHelper.getSprintUsertories(sprint).count();

View File

@ -13,6 +13,8 @@ lightbox.exit = function(el) {
}
el.$('.close').click();
return lightbox.close(el);
};
lightbox.open = async function(el) {
@ -38,7 +40,6 @@ lightbox.open = async function(el) {
};
lightbox.close = async function(el) {
var deferred = protractor.promise.defer();
var present = true;
if (typeof el == 'string' || el instanceof String) {
@ -47,22 +48,16 @@ lightbox.close = async function(el) {
present = await el.isPresent();
if (!present) {
deferred.fulfill(true);
} else {
return browser.wait(function() {
return common.hasClass(el, 'open').then(function(open) {
if (present) {
try {
await browser.wait(async function() {
let open = await common.hasClass(el, 'open');
return !open;
});
}, 4000)
.then(function() {
return deferred.fulfill(true);
}, function() {
deferred.reject(new Error('Lightbox doesn\'t close'));
});
}, 4000);
} catch (e) {
new Error('Lightbox doesn\'t close')
}
}
return deferred.promise;
};
lightbox.confirm = {};