fix drag&drop tests
parent
91662a8ad7
commit
211d8972a0
|
@ -2,6 +2,7 @@
|
||||||
var multipleSortableClass = 'ui-multisortable-multiple';
|
var multipleSortableClass = 'ui-multisortable-multiple';
|
||||||
var mainClass = 'main-drag-item';
|
var mainClass = 'main-drag-item';
|
||||||
var inProgress = false;
|
var inProgress = false;
|
||||||
|
var removeEventFn = null;
|
||||||
|
|
||||||
var reset = function(elm) {
|
var reset = function(elm) {
|
||||||
$(elm)
|
$(elm)
|
||||||
|
@ -59,7 +60,7 @@
|
||||||
var current = dragMultiple.items.elm;
|
var current = dragMultiple.items.elm;
|
||||||
var container = dragMultiple.items.container;
|
var container = dragMultiple.items.container;
|
||||||
|
|
||||||
$(window).off('mousemove.dragmultiple');
|
document.documentElement.removeEventListener('mousemove', removeEventFn);
|
||||||
|
|
||||||
// reset
|
// reset
|
||||||
dragMultiple.items = {};
|
dragMultiple.items = {};
|
||||||
|
@ -199,12 +200,14 @@
|
||||||
|
|
||||||
dragMultiple.start = function(item, container) {
|
dragMultiple.start = function(item, container) {
|
||||||
if (isMultiple(item, container)) {
|
if (isMultiple(item, container)) {
|
||||||
$(window).on('mousemove.dragmultiple', function() {
|
document.documentElement.addEventListener('mousemove', function() {
|
||||||
if (!inProgress) {
|
if (!inProgress) {
|
||||||
dragMultiple.prepare(item, container);
|
dragMultiple.prepare(item, container);
|
||||||
}
|
}
|
||||||
|
|
||||||
drag();
|
drag();
|
||||||
|
|
||||||
|
removeEventFn = arguments.callee;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -54,7 +54,7 @@ div.kanban-table(tg-kanban-squish-column, tg-kanban-sortable)
|
||||||
)
|
)
|
||||||
tg-svg.bulk-action(svg-icon="icon-bulk")
|
tg-svg.bulk-action(svg-icon="icon-bulk")
|
||||||
|
|
||||||
a.option(
|
a.option.e2e-archived(
|
||||||
href=""
|
href=""
|
||||||
ng-attr-title="{{title}}"
|
ng-attr-title="{{title}}"
|
||||||
ng-class="class"
|
ng-class="class"
|
||||||
|
|
|
@ -130,10 +130,20 @@ helper.openNewMilestone = function(item) {
|
||||||
$('.add-sprint').click();
|
$('.add-sprint').click();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
helper.getClosedSprintTable = function() {
|
||||||
|
return $$('.sprint-empty').last();
|
||||||
|
};
|
||||||
|
|
||||||
helper.toggleClosedSprints = function() {
|
helper.toggleClosedSprints = function() {
|
||||||
$('.filter-closed-sprints').click();
|
$('.filter-closed-sprints').click();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
helper.toggleSprint = async function(el) {
|
||||||
|
el.$('.compact-sprint').click();
|
||||||
|
|
||||||
|
await utils.common.waitTransitionTime(el.$('.sprint-table'));
|
||||||
|
};
|
||||||
|
|
||||||
helper.closedSprints = function() {
|
helper.closedSprints = function() {
|
||||||
return $$('.sprint-closed');
|
return $$('.sprint-closed');
|
||||||
};
|
};
|
||||||
|
@ -164,6 +174,18 @@ helper.getUsRef = function(elm) {
|
||||||
return elm.$('span[tg-bo-ref]').getText();
|
return elm.$('span[tg-bo-ref]').getText();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
helper.loadFullBacklog = async function() {
|
||||||
|
do {
|
||||||
|
var uss = helper.userStories();
|
||||||
|
var count = await uss.count();
|
||||||
|
var last = uss.last();
|
||||||
|
|
||||||
|
await browser.executeScript("arguments[0].scrollIntoView();", last.getWebElement());
|
||||||
|
|
||||||
|
var newcount = await uss.count();
|
||||||
|
} while(count < newcount);
|
||||||
|
};
|
||||||
|
|
||||||
// get ref with the larger length
|
// get ref with the larger length
|
||||||
helper.getTestingFilterRef = async function() {
|
helper.getTestingFilterRef = async function() {
|
||||||
let userstories = helper.userStories();
|
let userstories = helper.userStories();
|
||||||
|
|
|
@ -47,7 +47,7 @@ describe('custom-fields', function() {
|
||||||
expect(notification).to.be.true;
|
expect(notification).to.be.true;
|
||||||
});
|
});
|
||||||
|
|
||||||
it.skip('drag', async function() {
|
it('drag', async function() {
|
||||||
let nameOld = await customFieldsHelper.getName(typeIndex, 0);
|
let nameOld = await customFieldsHelper.getName(typeIndex, 0);
|
||||||
|
|
||||||
await customFieldsHelper.drag(typeIndex, 0, 1);
|
await customFieldsHelper.drag(typeIndex, 0, 1);
|
||||||
|
@ -99,7 +99,7 @@ describe('custom-fields', function() {
|
||||||
expect(utils.notifications.success.open()).to.be.eventually.true;
|
expect(utils.notifications.success.open()).to.be.eventually.true;
|
||||||
});
|
});
|
||||||
|
|
||||||
it.skip('drag', async function() {
|
it('drag', async function() {
|
||||||
let nameOld = await customFieldsHelper.getName(typeIndex, 0);
|
let nameOld = await customFieldsHelper.getName(typeIndex, 0);
|
||||||
|
|
||||||
await customFieldsHelper.drag(typeIndex, 0, 1);
|
await customFieldsHelper.drag(typeIndex, 0, 1);
|
||||||
|
@ -151,7 +151,7 @@ describe('custom-fields', function() {
|
||||||
expect(utils.notifications.success.open()).to.be.eventually.true;
|
expect(utils.notifications.success.open()).to.be.eventually.true;
|
||||||
});
|
});
|
||||||
|
|
||||||
it.skip('drag', async function() {
|
it('drag', async function() {
|
||||||
let nameOld = await customFieldsHelper.getName(typeIndex, 0);
|
let nameOld = await customFieldsHelper.getName(typeIndex, 0);
|
||||||
|
|
||||||
await customFieldsHelper.drag(typeIndex, 0, 1);
|
await customFieldsHelper.drag(typeIndex, 0, 1);
|
||||||
|
|
|
@ -86,7 +86,7 @@ describe('attributes - points', function() {
|
||||||
expect(newStatuses.indexOf(newStatusName)).to.be.not.equal(-1);
|
expect(newStatuses.indexOf(newStatusName)).to.be.not.equal(-1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it.skip('drag', async function() {
|
it('drag', async function() {
|
||||||
let section = adminAttributesHelper.getSection(0);
|
let section = adminAttributesHelper.getSection(0);
|
||||||
let rows = section.rows();
|
let rows = section.rows();
|
||||||
let points = await adminAttributesHelper.getPointsNames(section.el);
|
let points = await adminAttributesHelper.getPointsNames(section.el);
|
||||||
|
|
|
@ -84,7 +84,7 @@ describe('attributes - priorities', function() {
|
||||||
expect(newPriorities.indexOf(newPriorityName)).to.be.not.equal(-1);
|
expect(newPriorities.indexOf(newPriorityName)).to.be.not.equal(-1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it.skip('drag', async function() {
|
it('drag', async function() {
|
||||||
let section = adminAttributesHelper.getSection(0);
|
let section = adminAttributesHelper.getSection(0);
|
||||||
let rows = section.rows();
|
let rows = section.rows();
|
||||||
let priorities = await adminAttributesHelper.getGenericNames(section.el);
|
let priorities = await adminAttributesHelper.getGenericNames(section.el);
|
||||||
|
|
|
@ -84,7 +84,7 @@ describe('attributes - severities', function() {
|
||||||
expect(newObjs.indexOf(newName)).to.be.not.equal(-1);
|
expect(newObjs.indexOf(newName)).to.be.not.equal(-1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it.skip('drag', async function() {
|
it('drag', async function() {
|
||||||
let section = adminAttributesHelper.getSection(0);
|
let section = adminAttributesHelper.getSection(0);
|
||||||
let rows = section.rows();
|
let rows = section.rows();
|
||||||
let objs = await adminAttributesHelper.getGenericNames(section.el);
|
let objs = await adminAttributesHelper.getGenericNames(section.el);
|
||||||
|
|
|
@ -110,7 +110,7 @@ describe('attributes - status', function() {
|
||||||
expect(newStatuses.indexOf(newStatusName)).to.be.not.equal(-1);
|
expect(newStatuses.indexOf(newStatusName)).to.be.not.equal(-1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it.skip('drag', async function() {
|
it('drag', async function() {
|
||||||
let section = adminAttributesHelper.getSection(0);
|
let section = adminAttributesHelper.getSection(0);
|
||||||
let rows = section.rows();
|
let rows = section.rows();
|
||||||
let statuses = await adminAttributesHelper.getStatusNames(section.el);
|
let statuses = await adminAttributesHelper.getStatusNames(section.el);
|
||||||
|
|
|
@ -8,7 +8,7 @@ var chaiAsPromised = require('chai-as-promised');
|
||||||
chai.use(chaiAsPromised);
|
chai.use(chaiAsPromised);
|
||||||
var expect = chai.expect;
|
var expect = chai.expect;
|
||||||
|
|
||||||
describe.only('attributes - tags', function() {
|
describe('attributes - tags', function() {
|
||||||
before(async function(){
|
before(async function(){
|
||||||
browser.get(browser.params.glob.host + 'project/project-0/admin/project-values/tags');
|
browser.get(browser.params.glob.host + 'project/project-0/admin/project-values/tags');
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,7 @@ describe('attributes - types', function() {
|
||||||
expect(newObjs.indexOf(newName)).to.be.not.equal(-1);
|
expect(newObjs.indexOf(newName)).to.be.not.equal(-1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it.skip('drag', async function() {
|
it('drag', async function() {
|
||||||
let section = adminAttributesHelper.getSection(0);
|
let section = adminAttributesHelper.getSection(0);
|
||||||
let rows = section.rows();
|
let rows = section.rows();
|
||||||
let objs = await adminAttributesHelper.getGenericNames(section.el);
|
let objs = await adminAttributesHelper.getGenericNames(section.el);
|
||||||
|
|
|
@ -199,13 +199,14 @@ describe('backlog', function() {
|
||||||
expect(newUsCount).to.be.equal(usCount - 1);
|
expect(newUsCount).to.be.equal(usCount - 1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it.skip('drag backlog us', async function() {
|
it('drag backlog us', async function() {
|
||||||
let dragableElements = backlogHelper.userStories();
|
let dragableElements = backlogHelper.userStories();
|
||||||
|
|
||||||
let dragElement = dragableElements.get(1);
|
let dragElement = dragableElements.get(4);
|
||||||
let dragElementHandler = dragElement.$('.icon-drag');
|
let dragElementHandler = dragElement.$('.icon-drag');
|
||||||
let draggedElementRef = await backlogHelper.getUsRef(dragElement);
|
let draggedElementRef = await backlogHelper.getUsRef(dragElement);
|
||||||
|
|
||||||
|
|
||||||
await utils.common.drag(dragElementHandler, dragableElements.get(0));
|
await utils.common.drag(dragElementHandler, dragableElements.get(0));
|
||||||
await browser.waitForAngular();
|
await browser.waitForAngular();
|
||||||
|
|
||||||
|
@ -214,7 +215,7 @@ describe('backlog', function() {
|
||||||
expect(firstElementTextRef).to.be.equal(draggedElementRef);
|
expect(firstElementTextRef).to.be.equal(draggedElementRef);
|
||||||
});
|
});
|
||||||
|
|
||||||
it.skip('reorder multiple us', async function() {
|
it('reorder multiple us', async function() {
|
||||||
let dragableElements = backlogHelper.userStories();
|
let dragableElements = backlogHelper.userStories();
|
||||||
|
|
||||||
let count = await dragableElements.count();
|
let count = await dragableElements.count();
|
||||||
|
@ -233,8 +234,7 @@ describe('backlog', function() {
|
||||||
let ref2 = await backlogHelper.getUsRef(dragElement);
|
let ref2 = await backlogHelper.getUsRef(dragElement);
|
||||||
draggedRefs.push(await backlogHelper.getUsRef(dragElement));
|
draggedRefs.push(await backlogHelper.getUsRef(dragElement));
|
||||||
|
|
||||||
await utils.common.drag(dragElement, dragableElements.get(0));
|
await utils.common.drag(dragElement.$('.icon-drag'), dragableElements.get(0));
|
||||||
await browser.sleep(200);
|
|
||||||
|
|
||||||
let elementRef1 = await backlogHelper.getUsRef(dragableElements.get(0));
|
let elementRef1 = await backlogHelper.getUsRef(dragableElements.get(0));
|
||||||
let elementRef2 = await backlogHelper.getUsRef(dragableElements.get(1));
|
let elementRef2 = await backlogHelper.getUsRef(dragableElements.get(1));
|
||||||
|
@ -243,7 +243,7 @@ describe('backlog', function() {
|
||||||
expect(elementRef1).to.be.equal(draggedRefs[1]);
|
expect(elementRef1).to.be.equal(draggedRefs[1]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it.skip('drag multiple us to milestone', async function() {
|
it.only('drag multiple us to milestone', async function() {
|
||||||
let sprint = backlogHelper.sprints().get(0);
|
let sprint = backlogHelper.sprints().get(0);
|
||||||
let initUssSprintCount = await backlogHelper.getSprintUsertories(sprint).count();
|
let initUssSprintCount = await backlogHelper.getSprintUsertories(sprint).count();
|
||||||
|
|
||||||
|
@ -256,7 +256,7 @@ describe('backlog', function() {
|
||||||
let dragElement = dragableElements.get(0);
|
let dragElement = dragableElements.get(0);
|
||||||
let dragElementHandler = dragElement.$('.icon-drag');
|
let dragElementHandler = dragElement.$('.icon-drag');
|
||||||
|
|
||||||
await utils.common.drag(dragElementHandler, sprint);
|
await utils.common.drag(dragElementHandler, sprint.$('.sprint-table'));
|
||||||
await browser.waitForAngular();
|
await browser.waitForAngular();
|
||||||
|
|
||||||
let ussSprintCount = await backlogHelper.getSprintUsertories(sprint).count();
|
let ussSprintCount = await backlogHelper.getSprintUsertories(sprint).count();
|
||||||
|
@ -264,8 +264,8 @@ describe('backlog', function() {
|
||||||
expect(ussSprintCount).to.be.equal(initUssSprintCount + 2);
|
expect(ussSprintCount).to.be.equal(initUssSprintCount + 2);
|
||||||
});
|
});
|
||||||
|
|
||||||
it.skip('drag us to milestone', async function() {
|
it('drag us to milestone', async function() {
|
||||||
let sprint = backlogHelper.sprints().get(0);
|
let sprint = backlogHelper.sprints().get(0).$('.sprint-table');
|
||||||
|
|
||||||
let dragableElements = backlogHelper.userStories();
|
let dragableElements = backlogHelper.userStories();
|
||||||
let dragElement = dragableElements.get(0);
|
let dragElement = dragableElements.get(0);
|
||||||
|
@ -303,7 +303,7 @@ describe('backlog', function() {
|
||||||
expect(sprintRefs.indexOf(draggedRef)).to.be.not.equal(-1);
|
expect(sprintRefs.indexOf(draggedRef)).to.be.not.equal(-1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it.skip('reorder milestone us', async function() {
|
it('reorder milestone us', async function() {
|
||||||
let sprint = backlogHelper.sprints().get(0);
|
let sprint = backlogHelper.sprints().get(0);
|
||||||
let dragableElements = backlogHelper.getSprintUsertories(sprint);
|
let dragableElements = backlogHelper.getSprintUsertories(sprint);
|
||||||
|
|
||||||
|
@ -318,7 +318,7 @@ describe('backlog', function() {
|
||||||
expect(firstElementRef).to.be.equal(firstElementRef);
|
expect(firstElementRef).to.be.equal(firstElementRef);
|
||||||
});
|
});
|
||||||
|
|
||||||
it.skip('drag us from milestone to milestone', async function() {
|
it('drag us from milestone to milestone', async function() {
|
||||||
let sprint1 = backlogHelper.sprints().get(0);
|
let sprint1 = backlogHelper.sprints().get(0);
|
||||||
let sprint2 = backlogHelper.sprints().get(1);
|
let sprint2 = backlogHelper.sprints().get(1);
|
||||||
|
|
||||||
|
@ -326,7 +326,7 @@ describe('backlog', function() {
|
||||||
|
|
||||||
let dragElement = backlogHelper.getSprintUsertories(sprint1).get(0);
|
let dragElement = backlogHelper.getSprintUsertories(sprint1).get(0);
|
||||||
|
|
||||||
await utils.common.drag(dragElement, sprint2);
|
await utils.common.drag(dragElement, sprint2.$('.sprint-table'));
|
||||||
await browser.waitForAngular();
|
await browser.waitForAngular();
|
||||||
|
|
||||||
let firstElement = backlogHelper.getSprintUsertories(sprint2).get(0);
|
let firstElement = backlogHelper.getSprintUsertories(sprint2).get(0);
|
||||||
|
@ -606,12 +606,29 @@ describe('backlog', function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function dragClosedUsToMilestone() {
|
async function dragClosedUsToMilestone() {
|
||||||
await backlogHelper.setUsStatus(2, 5);
|
//create us
|
||||||
|
backlogHelper.openNewUs();
|
||||||
|
|
||||||
let dragElement = backlogHelper.userStories().get(2);
|
let createUSLightbox = backlogHelper.getCreateEditUsLightbox();
|
||||||
|
|
||||||
|
await createUSLightbox.waitOpen();
|
||||||
|
|
||||||
|
createUSLightbox.subject().sendKeys('subject');
|
||||||
|
|
||||||
|
//closed status
|
||||||
|
createUSLightbox.status(5).click();
|
||||||
|
|
||||||
|
createUSLightbox.submit();
|
||||||
|
|
||||||
|
await utils.lightbox.close(createUSLightbox.el);
|
||||||
|
|
||||||
|
await backlogHelper.loadFullBacklog();
|
||||||
|
|
||||||
|
// drag us to milestone
|
||||||
|
let dragElement = backlogHelper.userStories().last();
|
||||||
let dragElementHandler = dragElement.$('.icon-drag');
|
let dragElementHandler = dragElement.$('.icon-drag');
|
||||||
|
|
||||||
let sprint = backlogHelper.sprints().last();
|
let sprint = backlogHelper.getClosedSprintTable();
|
||||||
await utils.common.drag(dragElementHandler, sprint);
|
await utils.common.drag(dragElementHandler, sprint);
|
||||||
|
|
||||||
return browser.waitForAngular();
|
return browser.waitForAngular();
|
||||||
|
@ -638,16 +655,19 @@ describe('backlog', function() {
|
||||||
expect(closedSprints).to.be.equal(0);
|
expect(closedSprints).to.be.equal(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
it.skip('open sprint by drag open US to closed sprint', async function() {
|
it('open sprint by drag open US to closed sprint', async function() {
|
||||||
backlogHelper.toggleClosedSprints();
|
backlogHelper.toggleClosedSprints();
|
||||||
|
|
||||||
await backlogHelper.setUsStatus(1, 0);
|
await backlogHelper.setUsStatus(1, 1);
|
||||||
|
|
||||||
let dragElement = backlogHelper.userStories().get(0);
|
let dragElement = backlogHelper.userStories().get(1);
|
||||||
let dragElementHandler = dragElement.$('.icon-drag');
|
let dragElementHandler = dragElement.$('.icon-drag');
|
||||||
|
|
||||||
let sprint = backlogHelper.sprints().last();
|
let sprint = backlogHelper.sprints().last();
|
||||||
await utils.common.drag(dragElementHandler, sprint);
|
|
||||||
|
await backlogHelper.toggleSprint(sprint);
|
||||||
|
|
||||||
|
await utils.common.drag(dragElementHandler, sprint.$('.sprint-table'));
|
||||||
await browser.waitForAngular();
|
await browser.waitForAngular();
|
||||||
|
|
||||||
let closedSprints = await backlogHelper.closedSprints().count();
|
let closedSprints = await backlogHelper.closedSprints().count();
|
||||||
|
|
|
@ -47,7 +47,7 @@ describe('home', function() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe.skip("project drag and drop", function() {
|
describe("project drag and drop", function() {
|
||||||
var draggedElementText;
|
var draggedElementText;
|
||||||
|
|
||||||
before(async function() {
|
before(async function() {
|
||||||
|
@ -72,7 +72,7 @@ describe('home', function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('projects menu has the new order', async function() {
|
it('projects menu has the new order', async function() {
|
||||||
var firstElementText = await $$('div[tg-dropdown-project-list] ul a').first().getInnerHtml();
|
var firstElementText = await $$('div[tg-dropdown-project-list] ul a span').first().getInnerHtml();
|
||||||
|
|
||||||
expect(firstElementText).to.be.equal(draggedElementText);
|
expect(firstElementText).to.be.equal(draggedElementText);
|
||||||
});
|
});
|
||||||
|
|
|
@ -225,7 +225,7 @@ describe('kanban', function() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it.skip('move us between columns', async function() {
|
it('move us between columns', async function() {
|
||||||
let initOriginUsCount = await kanbanHelper.getBoxUss(0).count();
|
let initOriginUsCount = await kanbanHelper.getBoxUss(0).count();
|
||||||
let initDestinationUsCount = await kanbanHelper.getBoxUss(1).count();
|
let initDestinationUsCount = await kanbanHelper.getBoxUss(1).count();
|
||||||
|
|
||||||
|
@ -243,7 +243,7 @@ describe('kanban', function() {
|
||||||
expect(destinationUsCount).to.be.equal(initDestinationUsCount + 1);
|
expect(destinationUsCount).to.be.equal(initDestinationUsCount + 1);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe.skip('archive', function() {
|
describe('archive', function() {
|
||||||
it('move to archive', async function() {
|
it('move to archive', async function() {
|
||||||
let initOriginUsCount = await kanbanHelper.getBoxUss(3).count();
|
let initOriginUsCount = await kanbanHelper.getBoxUss(3).count();
|
||||||
|
|
||||||
|
@ -264,7 +264,7 @@ describe('kanban', function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('show archive', async function() {
|
it('show archive', async function() {
|
||||||
$('.icon-open-eye').click();
|
$('.e2e-archived').click();
|
||||||
|
|
||||||
await kanbanHelper.scrollRight();
|
await kanbanHelper.scrollRight();
|
||||||
|
|
||||||
|
@ -276,7 +276,7 @@ describe('kanban', function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('close archive', async function() {
|
it('close archive', async function() {
|
||||||
$('.icon-closed-eye').click();
|
$('.e2e-archived').click();
|
||||||
|
|
||||||
let usCount = await kanbanHelper.getBoxUss(5).count();
|
let usCount = await kanbanHelper.getBoxUss(5).count();
|
||||||
|
|
||||||
|
|
|
@ -213,7 +213,7 @@ describe('taskboard', function() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe.skip('move tasks', function() {
|
describe('move tasks', function() {
|
||||||
it('move task between statuses', async function() {
|
it('move task between statuses', async function() {
|
||||||
let initOriginTaskCount = await taskboardHelper.getBoxTasks(0, 0).count();
|
let initOriginTaskCount = await taskboardHelper.getBoxTasks(0, 0).count();
|
||||||
let initDestinationTaskCount = await taskboardHelper.getBoxTasks(0, 1).count();
|
let initDestinationTaskCount = await taskboardHelper.getBoxTasks(0, 1).count();
|
||||||
|
@ -232,8 +232,7 @@ describe('taskboard', function() {
|
||||||
expect(destinationTaskCount).to.be.equal(initDestinationTaskCount + 1);
|
expect(destinationTaskCount).to.be.equal(initDestinationTaskCount + 1);
|
||||||
});
|
});
|
||||||
|
|
||||||
// jquery ui drag bug
|
it('move task between US\s', async function() {
|
||||||
it.skip('move task between US\s', async function() {
|
|
||||||
let initOriginTaskCount = await taskboardHelper.getBoxTasks(0, 0).count();
|
let initOriginTaskCount = await taskboardHelper.getBoxTasks(0, 0).count();
|
||||||
let initDestinationTaskCount = await taskboardHelper.getBoxTasks(1, 1).count();
|
let initDestinationTaskCount = await taskboardHelper.getBoxTasks(1, 1).count();
|
||||||
|
|
||||||
|
|
|
@ -176,41 +176,63 @@ common.prepare = function() {
|
||||||
|
|
||||||
common.dragEnd = function(elm) {
|
common.dragEnd = function(elm) {
|
||||||
return browser.wait(async function() {
|
return browser.wait(async function() {
|
||||||
let count = await $$('.ui-sortable-helper').count();
|
let count = await $$('.gu-mirror').count();
|
||||||
|
|
||||||
return count === 0;
|
return count === 0;
|
||||||
}, 1000);
|
}, 1000);
|
||||||
};
|
};
|
||||||
|
|
||||||
common.drag = async function(elm, elm2, offset) {
|
common.drag = async function(elm, elm2) {
|
||||||
// this code doesn't have sense (jquery ui + scroll drag + selenium = :( )
|
var drag = `
|
||||||
await browser.actions()
|
var drag = arguments[0].origin;
|
||||||
.mouseMove(elm)
|
var dest = arguments[0].dest;
|
||||||
.mouseDown()
|
|
||||||
.perform();
|
|
||||||
|
|
||||||
await browser.actions()
|
function triggerMouseEvent (node, eventType, opts) {
|
||||||
.mouseMove(elm2, offset)
|
var event = new CustomEvent(eventType);
|
||||||
.perform();
|
event.initEvent (eventType, true, true);
|
||||||
|
|
||||||
await browser.sleep(60);
|
if(opts && opts.cords) {
|
||||||
|
event.pageX = opts.cords.x;
|
||||||
|
event.clientX = opts.cords.x;
|
||||||
|
event.pageY = opts.cords.y;
|
||||||
|
event.clientY = opts.cords.y - window.pageYOffset;
|
||||||
|
|
||||||
await browser.actions()
|
dest.scrollIntoView();
|
||||||
.mouseMove({x: 10, y: -10}) // fire jqueryui mousemove event always
|
}
|
||||||
.perform();
|
|
||||||
|
|
||||||
await browser.sleep(60);
|
event.which = 1;
|
||||||
|
node.dispatchEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
await browser.actions()
|
triggerMouseEvent(drag, "mousedown");
|
||||||
.mouseMove({x: -10, y: 10})
|
|
||||||
.perform();
|
|
||||||
|
|
||||||
await browser.sleep(60);
|
triggerMouseEvent(document.documentElement, "mousemove", {
|
||||||
|
cords: {
|
||||||
|
x: $(dest).offset().left,
|
||||||
|
y: $(dest).offset().top
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return browser.actions()
|
triggerMouseEvent(document.documentElement, "mousemove", {
|
||||||
.mouseUp()
|
cords: {
|
||||||
.perform()
|
x: $(dest).offset().left,
|
||||||
.then(common.dragEnd);
|
y: $(dest).offset().top
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
triggerMouseEvent(document.documentElement, "mouseup", {
|
||||||
|
cords: {
|
||||||
|
x: $(dest).offset().left,
|
||||||
|
y: $(dest).offset().top
|
||||||
|
}
|
||||||
|
});
|
||||||
|
`;
|
||||||
|
|
||||||
|
// return browser.executeScript(drag, elm, elm2);
|
||||||
|
return browser.executeScript(drag, {
|
||||||
|
origin: elm.getWebElement(),
|
||||||
|
dest: elm2.getWebElement()
|
||||||
|
}).then(common.dragEnd);
|
||||||
};
|
};
|
||||||
|
|
||||||
common.transitionend = function(selector, property) {
|
common.transitionend = function(selector, property) {
|
||||||
|
|
Loading…
Reference in New Issue