testing backlog
parent
05290fbb04
commit
6a9c4922ed
|
@ -8,7 +8,7 @@ exports.config = {
|
||||||
seleniumAddress: 'http://localhost:4444/wd/hub',
|
seleniumAddress: 'http://localhost:4444/wd/hub',
|
||||||
framework: 'mocha',
|
framework: 'mocha',
|
||||||
mochaOpts: {
|
mochaOpts: {
|
||||||
timeout: 5000
|
timeout: 11000
|
||||||
},
|
},
|
||||||
suites: {
|
suites: {
|
||||||
auth: 'e2e/auth/*.e2e.js',
|
auth: 'e2e/auth/*.e2e.js',
|
||||||
|
@ -28,7 +28,7 @@ exports.config = {
|
||||||
return browser.driver.wait(function() {
|
return browser.driver.wait(function() {
|
||||||
return utils.common.closeCookies()
|
return utils.common.closeCookies()
|
||||||
.then(function() {
|
.then(function() {
|
||||||
return browser.driver.getCurrentUrl()
|
return browser.driver.getCurrentUrl();
|
||||||
})
|
})
|
||||||
.then(function(url) {
|
.then(function(url) {
|
||||||
return url === 'http://localhost:9001/';
|
return url === 'http://localhost:9001/';
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
var utils = require('../utils');
|
var utils = require('../utils');
|
||||||
|
var backlogHelper = require('../helpers').backlog;
|
||||||
|
|
||||||
var chai = require('chai');
|
var chai = require('chai');
|
||||||
var chaiAsPromised = require('chai-as-promised');
|
var chaiAsPromised = require('chai-as-promised');
|
||||||
|
@ -6,20 +7,557 @@ var chaiAsPromised = require('chai-as-promised');
|
||||||
chai.use(chaiAsPromised);
|
chai.use(chaiAsPromised);
|
||||||
var expect = chai.expect;
|
var expect = chai.expect;
|
||||||
|
|
||||||
describe.skip('backlog', function() {
|
describe('backlog', function() {
|
||||||
before(function(){
|
before(async function() {
|
||||||
browser.get('http://localhost:9001/project/user7-project-example-0/');
|
browser.get('http://localhost:9001/project/user7-project-example-0/backlog');
|
||||||
|
await utils.common.waitLoader();
|
||||||
|
|
||||||
return utils.common.waitLoader().then(function() {
|
utils.common.takeScreenshot('backlog', 'backlog');
|
||||||
return utils.common.takeScreenshot('backlog', 'backlog');
|
});
|
||||||
|
|
||||||
|
describe('create US', function() {
|
||||||
|
let createUSLightbox = null;
|
||||||
|
|
||||||
|
before(async function() {
|
||||||
|
backlogHelper.openNewUs();
|
||||||
|
|
||||||
|
createUSLightbox = backlogHelper.getCreateEditUsLightbox();
|
||||||
|
await createUSLightbox.waitOpen();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('capture screen', function() {
|
||||||
|
utils.common.takeScreenshot('backlog', 'create-us');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('fill form', async function() {
|
||||||
|
// subject
|
||||||
|
createUSLightbox.subject().sendKeys('subject');
|
||||||
|
|
||||||
|
// roles
|
||||||
|
createUSLightbox.setRole(1, 3);
|
||||||
|
createUSLightbox.setRole(3, 4);
|
||||||
|
|
||||||
|
let totalPoints = await createUSLightbox.getRolePoints();
|
||||||
|
|
||||||
|
expect(totalPoints).to.be.equal('3');
|
||||||
|
|
||||||
|
// status
|
||||||
|
createUSLightbox.status(2).click();
|
||||||
|
|
||||||
|
// tags
|
||||||
|
createUSLightbox.tags().sendKeys('aaa');
|
||||||
|
browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||||
|
|
||||||
|
createUSLightbox.tags().sendKeys('bbb');
|
||||||
|
browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||||
|
|
||||||
|
// description
|
||||||
|
createUSLightbox.description().sendKeys('test test');
|
||||||
|
|
||||||
|
//settings
|
||||||
|
createUSLightbox.settings(0).click();
|
||||||
|
|
||||||
|
|
||||||
|
await utils.common.waitTransitionTime(createUSLightbox.settings(0));
|
||||||
|
|
||||||
|
utils.common.takeScreenshot('backlog', 'create-us-filled');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('send form', async function() {
|
||||||
|
let usCount = await backlogHelper.userStories().count();
|
||||||
|
|
||||||
|
createUSLightbox.submit();
|
||||||
|
|
||||||
|
await utils.lightbox.close(createUSLightbox.el);
|
||||||
|
|
||||||
|
let newUsCount = await backlogHelper.userStories().count();
|
||||||
|
|
||||||
|
expect(newUsCount).to.be.equal(usCount + 1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create US', function() {
|
describe('bulk create US', function() {
|
||||||
$('.new-us a').click();
|
let createUSLightbox = null;
|
||||||
|
|
||||||
lightbox.open('div[tg-lb-create-edit-userstory]').then(function() {
|
before(async function() {
|
||||||
|
backlogHelper.openBulk();
|
||||||
|
|
||||||
|
createUSLightbox = backlogHelper.getBulkCreateLightbox();
|
||||||
|
|
||||||
|
await createUSLightbox.waitOpen();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('fill form', function() {
|
||||||
|
createUSLightbox.textarea().sendKeys('aaa');
|
||||||
|
browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||||
|
|
||||||
|
createUSLightbox.textarea().sendKeys('bbb');
|
||||||
|
browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('send form', async function() {
|
||||||
|
let usCount = await backlogHelper.userStories().count();
|
||||||
|
|
||||||
|
createUSLightbox.submit();
|
||||||
|
|
||||||
|
await createUSLightbox.waitClose();
|
||||||
|
|
||||||
|
let newUsCount = await backlogHelper.userStories().count();
|
||||||
|
|
||||||
|
expect(newUsCount).to.be.equal(usCount + 2);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('edit US', function() {
|
||||||
|
let editUSLightbox = null;
|
||||||
|
|
||||||
|
before(async function() {
|
||||||
|
backlogHelper.openUsBacklogEdit(0);
|
||||||
|
|
||||||
|
editUSLightbox = backlogHelper.getCreateEditUsLightbox();
|
||||||
|
|
||||||
|
await editUSLightbox.waitOpen();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('fill form', async function() {
|
||||||
|
// subject
|
||||||
|
editUSLightbox.subject().sendKeys('subjectedit');
|
||||||
|
|
||||||
|
// roles
|
||||||
|
editUSLightbox.setRole(1, 3);
|
||||||
|
editUSLightbox.setRole(2, 3);
|
||||||
|
editUSLightbox.setRole(3, 3);
|
||||||
|
editUSLightbox.setRole(4, 3);
|
||||||
|
|
||||||
|
let totalPoints = await editUSLightbox.getRolePoints();
|
||||||
|
|
||||||
|
expect(totalPoints).to.be.equal('4');
|
||||||
|
|
||||||
|
// status
|
||||||
|
editUSLightbox.status(3).click();
|
||||||
|
|
||||||
|
// tags
|
||||||
|
editUSLightbox.tags().sendKeys('www');
|
||||||
|
browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||||
|
|
||||||
|
editUSLightbox.tags().sendKeys('xxx');
|
||||||
|
browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||||
|
|
||||||
|
// description
|
||||||
|
editUSLightbox.description().sendKeys('test test test test');
|
||||||
|
|
||||||
|
//settings
|
||||||
|
editUSLightbox.settings(1).click();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('send form', async function() {
|
||||||
|
editUSLightbox.submit();
|
||||||
|
|
||||||
|
await editUSLightbox.waitClose();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('edit status inline', async function() {
|
||||||
|
await backlogHelper.setUsStatus(0, 1);
|
||||||
|
|
||||||
|
// debounce
|
||||||
|
await browser.sleep(2000);
|
||||||
|
|
||||||
|
let statusText = await backlogHelper.setUsStatus(0, 2);
|
||||||
|
|
||||||
|
expect(statusText).to.be.equal('In progress');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('edit points inline', async function() {
|
||||||
|
await backlogHelper.setUsPoints(0, 1, 1);
|
||||||
|
|
||||||
|
expect(utils.notifications.success.open()).to.be.eventually.true;
|
||||||
|
});
|
||||||
|
|
||||||
|
it('delete US', async function() {
|
||||||
|
let usCount = await backlogHelper.userStories().count();
|
||||||
|
|
||||||
|
backlogHelper.deleteUs(0);
|
||||||
|
|
||||||
|
await utils.lightbox.confirm.ok();
|
||||||
|
|
||||||
|
let newUsCount = await backlogHelper.userStories().count();
|
||||||
|
|
||||||
|
expect(newUsCount).to.be.equal(usCount - 1);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('drag backlog us', async function() {
|
||||||
|
let dragableElements = backlogHelper.userStories();
|
||||||
|
let dragElement = dragableElements.get(5);
|
||||||
|
|
||||||
|
let draggedElementRef = await backlogHelper.getUsRef(dragElement);
|
||||||
|
|
||||||
|
await utils.common.drag(dragElement, dragableElements.get(0));
|
||||||
|
await browser.waitForAngular();
|
||||||
|
|
||||||
|
let firstElementTextRef = await backlogHelper.getUsRef(dragableElements.get(0));
|
||||||
|
|
||||||
|
expect(firstElementTextRef).to.be.equal(draggedElementRef);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('reorder multiple us', async function() {
|
||||||
|
let dragableElements = backlogHelper.userStories();
|
||||||
|
|
||||||
|
let count = await dragableElements.count();
|
||||||
|
|
||||||
|
let draggedRefs = [];
|
||||||
|
|
||||||
|
//element 1
|
||||||
|
let dragElement = dragableElements.get(count - 1);
|
||||||
|
let dragElementHandler = dragElement.$('.icon-drag-v');
|
||||||
|
dragElement.$('input[type="checkbox"]').click();
|
||||||
|
draggedRefs.push(await backlogHelper.getUsRef(dragElement));
|
||||||
|
|
||||||
|
//element 2
|
||||||
|
dragElement = dragableElements.get(count - 2);
|
||||||
|
dragElement.$('input[type="checkbox"]').click();
|
||||||
|
draggedRefs.push(await backlogHelper.getUsRef(dragElement));
|
||||||
|
|
||||||
|
await utils.common.drag(dragElementHandler, dragableElements.get(0));
|
||||||
|
await browser.waitForAngular();
|
||||||
|
|
||||||
|
let elementRef1 = await backlogHelper.getUsRef(dragableElements.get(0));
|
||||||
|
let elementRef2 = await backlogHelper.getUsRef(dragableElements.get(1));
|
||||||
|
|
||||||
|
expect(elementRef2).to.be.equal(draggedRefs[0]);
|
||||||
|
expect(elementRef1).to.be.equal(draggedRefs[1]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('drag us to milestone', async function() {
|
||||||
|
let sprint = backlogHelper.sprints().get(1);
|
||||||
|
|
||||||
|
let dragableElements = backlogHelper.userStories();
|
||||||
|
let dragElement = dragableElements.get(0);
|
||||||
|
|
||||||
|
let draggedElementRef = await backlogHelper.getUsRef(dragElement);
|
||||||
|
|
||||||
|
await utils.common.drag(dragElement, sprint);
|
||||||
|
await browser.waitForAngular();
|
||||||
|
|
||||||
|
let firstElementSprint = await backlogHelper.getSprintUsertories(sprint).first();
|
||||||
|
let firstElementSprintRef = await backlogHelper.getUsRef(firstElementSprint);
|
||||||
|
|
||||||
|
expect(draggedElementRef).to.be.equal(firstElementSprintRef);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('drag multiple us to milestone', async function() {
|
||||||
|
let sprint = backlogHelper.sprints().get(1);
|
||||||
|
|
||||||
|
let dragableElements = backlogHelper.userStories();
|
||||||
|
|
||||||
|
let draggedRefs = [];
|
||||||
|
|
||||||
|
//elefirment 1
|
||||||
|
let dragElement = dragableElements.get(0);
|
||||||
|
dragElement.$('input[type="checkbox"]').click();
|
||||||
|
draggedRefs.push(await backlogHelper.getUsRef(dragElement));
|
||||||
|
|
||||||
|
//element 2
|
||||||
|
dragElement = dragableElements.get(1);
|
||||||
|
dragElement.$('input[type="checkbox"]').click();
|
||||||
|
draggedRefs.push(await backlogHelper.getUsRef(dragElement));
|
||||||
|
|
||||||
|
await utils.common.drag(dragElement, sprint);
|
||||||
|
await browser.waitForAngular();
|
||||||
|
|
||||||
|
let elementSprint1 = await backlogHelper.getSprintUsertories(sprint).get(0);
|
||||||
|
let elementSprintRef1 = await backlogHelper.getUsRef(elementSprint1);
|
||||||
|
|
||||||
|
let elementSprint2 = await backlogHelper.getSprintUsertories(sprint).get(1);
|
||||||
|
let elementSprintRef2 = await backlogHelper.getUsRef(elementSprint2);
|
||||||
|
|
||||||
|
expect(elementSprintRef1).to.be.equal(draggedRefs[0]);
|
||||||
|
expect(elementSprintRef2).to.be.equal(draggedRefs[1]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('move to current sprint button', async function() {
|
||||||
|
let dragableElements = backlogHelper.userStories();
|
||||||
|
let count = await dragableElements.count();
|
||||||
|
let dragElement = dragableElements.get(count - 1);
|
||||||
|
|
||||||
|
dragElement.$('input[type="checkbox"]').click();
|
||||||
|
|
||||||
|
let draggedRef = await backlogHelper.getUsRef(dragElement);
|
||||||
|
|
||||||
|
$('#move-to-current-sprint').click();
|
||||||
|
|
||||||
|
let sprint = backlogHelper.sprintsOpen().last();
|
||||||
|
|
||||||
|
let sprintRefs = await backlogHelper.getSprintsRefs(sprint);
|
||||||
|
|
||||||
|
expect(sprintRefs.indexOf(draggedRef)).to.be.not.equal(-1);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('reorder milestone us', async function() {
|
||||||
|
let sprint = backlogHelper.sprints().get(0);
|
||||||
|
let dragableElements = backlogHelper.getSprintUsertories(sprint);
|
||||||
|
|
||||||
|
let dragElement = await dragableElements.get(3);
|
||||||
|
let draggedElementRef = await backlogHelper.getUsRef(dragElement);
|
||||||
|
|
||||||
|
await utils.common.drag(dragElement, dragableElements.get(0));
|
||||||
|
await browser.waitForAngular();
|
||||||
|
|
||||||
|
let firstElementRef = await backlogHelper.getUsRef(dragableElements.get(0));
|
||||||
|
|
||||||
|
expect(firstElementRef).to.be.equal(firstElementRef);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('drag us from milestone to milestone', async function() {
|
||||||
|
let sprint1 = backlogHelper.sprints().get(0);
|
||||||
|
let sprint2 = backlogHelper.sprints().get(1);
|
||||||
|
|
||||||
|
let dragElement = backlogHelper.getSprintUsertories(sprint1).get(0);
|
||||||
|
let dragElementRef = await backlogHelper.getUsRef(dragElement);
|
||||||
|
|
||||||
|
await utils.common.drag(dragElement, sprint2);
|
||||||
|
await browser.waitForAngular();
|
||||||
|
|
||||||
|
let firstElement = backlogHelper.getSprintUsertories(sprint2).get(0);
|
||||||
|
let firstElementRef = await backlogHelper.getUsRef(firstElement);
|
||||||
|
|
||||||
|
expect(dragElementRef).to.be.equal(firstElementRef);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('select us with SHIFT', async function() {
|
||||||
|
let dragableElements = backlogHelper.userStories();
|
||||||
|
|
||||||
|
let firstInput = dragableElements.get(0).$('input[type="checkbox"]');
|
||||||
|
let lastInput = dragableElements.get(3).$('input[type="checkbox"]');
|
||||||
|
|
||||||
|
browser.actions()
|
||||||
|
.mouseMove(firstInput)
|
||||||
|
.keyDown(protractor.Key.SHIFT)
|
||||||
|
.click()
|
||||||
|
.mouseMove(lastInput)
|
||||||
|
.click()
|
||||||
|
.perform();
|
||||||
|
|
||||||
|
let count = await backlogHelper.selectedUserStories().count();
|
||||||
|
|
||||||
|
expect(count).to.be.equal(4);
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('milestones', function() {
|
||||||
|
it('create', async function() {
|
||||||
|
$('.add-sprint').click();
|
||||||
|
|
||||||
|
let createMilestoneLightbox = backlogHelper.getCreateEditMilestone();
|
||||||
|
|
||||||
|
await createMilestoneLightbox.waitOpen();
|
||||||
|
|
||||||
|
utils.common.takeScreenshot('backlog', 'create-milestone');
|
||||||
|
|
||||||
|
let sprintName = 'sprintName' + new Date().getTime();
|
||||||
|
|
||||||
|
createMilestoneLightbox.name().sendKeys(sprintName);
|
||||||
|
|
||||||
|
createMilestoneLightbox.submit();
|
||||||
|
await browser.waitForAngular();
|
||||||
|
|
||||||
|
// debounce
|
||||||
|
await browser.sleep(2000);
|
||||||
|
|
||||||
|
let sprintTitles = await backlogHelper.getSprintsTitles();
|
||||||
|
|
||||||
|
expect(sprintTitles.indexOf(sprintName)).to.be.not.equal(-1);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('edit', async function() {
|
||||||
|
backlogHelper.openMilestoneEdit(0);
|
||||||
|
|
||||||
|
let createMilestoneLightbox = backlogHelper.getCreateEditMilestone();
|
||||||
|
|
||||||
|
await createMilestoneLightbox.waitOpen();
|
||||||
|
|
||||||
|
let sprintName = 'sprintName' + new Date().getTime();
|
||||||
|
|
||||||
|
createMilestoneLightbox.name().sendKeys(sprintName);
|
||||||
|
|
||||||
|
createMilestoneLightbox.submit();
|
||||||
|
await browser.waitForAngular();
|
||||||
|
|
||||||
|
let sprintTitles = await backlogHelper.getSprintsTitles();
|
||||||
|
|
||||||
|
expect(sprintTitles.indexOf(sprintName)).to.be.not.equal(-1);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('delete', async function() {
|
||||||
|
backlogHelper.openMilestoneEdit(0);
|
||||||
|
|
||||||
|
let createMilestoneLightbox = backlogHelper.getCreateEditMilestone();
|
||||||
|
|
||||||
|
await createMilestoneLightbox.waitOpen();
|
||||||
|
|
||||||
|
createMilestoneLightbox.delete();
|
||||||
|
|
||||||
|
await utils.lightbox.confirm.ok();
|
||||||
|
await browser.waitForAngular();
|
||||||
|
|
||||||
|
let sprintName = createMilestoneLightbox.name().getAttribute('value');
|
||||||
|
let sprintTitles = await backlogHelper.getSprintsTitles();
|
||||||
|
|
||||||
|
expect(sprintTitles.indexOf(sprintName)).to.be.equal(-1);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('tags', function() {
|
||||||
|
it('show', function() {
|
||||||
|
$('#show-tags').click();
|
||||||
|
|
||||||
|
utils.common.takeScreenshot('backlog', 'backlog-tags');
|
||||||
|
|
||||||
|
let tag = $$('.backlog-table .tag').get(0);
|
||||||
|
|
||||||
|
expect(tag.isDisplayed()).to.be.eventually.true;
|
||||||
|
});
|
||||||
|
|
||||||
|
it('hide', function() {
|
||||||
|
$('#show-tags').click();
|
||||||
|
|
||||||
|
let tag = $$('.backlog-table .tag').get(0);
|
||||||
|
|
||||||
|
expect(tag.isDisplayed()).to.be.eventually.false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('filters', function() {
|
||||||
|
it('show filters', async function() {
|
||||||
|
let transition = utils.common.transitionend('.menu-secondary.filters-bar', 'opacity');
|
||||||
|
|
||||||
|
$('#show-filters-button').click();
|
||||||
|
|
||||||
|
await transition();
|
||||||
|
|
||||||
|
utils.common.takeScreenshot('backlog', 'backlog-filters');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('filter by subject', async function() {
|
||||||
|
let usCount = await backlogHelper.userStories().count();
|
||||||
|
let filterQ = element(by.model('filtersQ'));
|
||||||
|
|
||||||
|
let htmlChanges = await utils.common.outerHtmlChanges('.backlog-table-body');
|
||||||
|
|
||||||
|
await filterQ.sendKeys('add');
|
||||||
|
|
||||||
|
await htmlChanges();
|
||||||
|
|
||||||
|
let newUsCount = await backlogHelper.userStories().count();
|
||||||
|
|
||||||
|
expect(newUsCount).to.be.below(usCount);
|
||||||
|
|
||||||
|
// clear status
|
||||||
|
await filterQ.clear();
|
||||||
|
|
||||||
|
htmlChanges = await utils.common.outerHtmlChanges('.backlog-table-body');
|
||||||
|
|
||||||
|
await htmlChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('filter by ref', async function() {
|
||||||
|
let userstories = backlogHelper.userStories();
|
||||||
|
let filterQ = element(by.model('filtersQ'));
|
||||||
|
let htmlChanges = await utils.common.outerHtmlChanges('.backlog-table-body');
|
||||||
|
|
||||||
|
let firstUs = userstories.first();
|
||||||
|
let ref = await backlogHelper.getUsRef(firstUs);
|
||||||
|
|
||||||
|
ref = ref.replace('#', '');
|
||||||
|
|
||||||
|
await filterQ.sendKeys(ref);
|
||||||
|
await htmlChanges();
|
||||||
|
|
||||||
|
let newUsCount = await userstories.count();
|
||||||
|
|
||||||
|
expect(newUsCount).to.be.equal(1);
|
||||||
|
|
||||||
|
// clear status
|
||||||
|
await filterQ.clear();
|
||||||
|
|
||||||
|
htmlChanges = await utils.common.outerHtmlChanges('.backlog-table-body');
|
||||||
|
|
||||||
|
await htmlChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('filter by status', async function() {
|
||||||
|
let usCount = await backlogHelper.userStories().count();
|
||||||
|
|
||||||
|
let htmlChanges = await utils.common.outerHtmlChanges('.backlog-table-body');
|
||||||
|
|
||||||
|
$$('.filters-cats a').first().click();
|
||||||
|
$$('.filter-list a').first().click();
|
||||||
|
|
||||||
|
await htmlChanges();
|
||||||
|
|
||||||
|
let newUsCount = await backlogHelper.userStories().count();
|
||||||
|
|
||||||
|
expect(newUsCount).to.be.below(usCount);
|
||||||
|
|
||||||
|
//remove status
|
||||||
|
htmlChanges = await utils.common.outerHtmlChanges('.backlog-table-body');
|
||||||
|
|
||||||
|
$$('.filters-applied a').first().click();
|
||||||
|
|
||||||
|
await htmlChanges();
|
||||||
|
|
||||||
|
newUsCount = await backlogHelper.userStories().count();
|
||||||
|
|
||||||
|
expect(newUsCount).to.be.equal(usCount);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('filter by tags', async function() {
|
||||||
|
let usCount = await backlogHelper.userStories().count();
|
||||||
|
|
||||||
|
let htmlChanges = await utils.common.outerHtmlChanges('.backlog-table-body');
|
||||||
|
|
||||||
|
$$('.filters-cats a').get(1).click();
|
||||||
|
$$('.filter-list a').first().click();
|
||||||
|
|
||||||
|
await htmlChanges();
|
||||||
|
|
||||||
|
let newUsCount = await backlogHelper.userStories().count();
|
||||||
|
|
||||||
|
expect(newUsCount).to.be.below(usCount);
|
||||||
|
|
||||||
|
//remove tags
|
||||||
|
htmlChanges = await utils.common.outerHtmlChanges('.backlog-table-body');
|
||||||
|
|
||||||
|
$$('.filters-applied a').first().click();
|
||||||
|
|
||||||
|
await htmlChanges();
|
||||||
|
|
||||||
|
newUsCount = await backlogHelper.userStories().count();
|
||||||
|
|
||||||
|
expect(newUsCount).to.be.equal(usCount);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('trying drag with filters open', async function() {
|
||||||
|
let dragableElements = backlogHelper.userStories();
|
||||||
|
let dragElement = dragableElements.get(5);
|
||||||
|
|
||||||
|
await utils.common.drag(dragElement, dragableElements.get(0));
|
||||||
|
|
||||||
|
expect(utils.notifications.error.open()).to.be.eventually.true;
|
||||||
|
});
|
||||||
|
|
||||||
|
it('hide filters', async function() {
|
||||||
|
let menu = $('.menu-secondary.filters-bar');
|
||||||
|
let transition = utils.common.transitionend('.menu-secondary.filters-bar', 'width');
|
||||||
|
|
||||||
|
$('#show-filters-button').click();
|
||||||
|
|
||||||
|
await transition();
|
||||||
|
|
||||||
|
expect(menu.getCssValue('width')).to.be.eventually.equal('0px');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe.skip('closed sprints', function() {
|
||||||
|
// TODO
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -7,10 +7,12 @@ chai.use(chaiAsPromised);
|
||||||
var expect = chai.expect;
|
var expect = chai.expect;
|
||||||
|
|
||||||
describe('project home', function() {
|
describe('project home', function() {
|
||||||
before(async function(){
|
beforeEach(async function() {
|
||||||
browser.get('http://localhost:9001/');
|
browser.get('http://localhost:9001/project/user7-project-example-1/');
|
||||||
|
|
||||||
await utils.common.waitLoader();
|
await utils.common.waitLoader();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('screenshot', async function() {
|
||||||
await utils.common.takeScreenshot("project", "home");
|
await utils.common.takeScreenshot("project", "home");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,160 @@
|
||||||
|
var utils = require('../utils');
|
||||||
|
|
||||||
|
var helper = module.exports;
|
||||||
|
|
||||||
|
helper.getCreateEditUsLightbox = function() {
|
||||||
|
let el = $('div[tg-lb-create-edit-userstory]');
|
||||||
|
|
||||||
|
let obj = {
|
||||||
|
el: el,
|
||||||
|
waitOpen: function() {
|
||||||
|
return utils.lightbox.open(el);
|
||||||
|
},
|
||||||
|
waitClose: function() {
|
||||||
|
return utils.lightbox.close(el);
|
||||||
|
},
|
||||||
|
roles: function() {
|
||||||
|
return el.$$('.points-per-role li');
|
||||||
|
},
|
||||||
|
subject: function() {
|
||||||
|
return el.$('input[name="subject"]');
|
||||||
|
},
|
||||||
|
tags: function() {
|
||||||
|
return el.$('.tag-input');
|
||||||
|
},
|
||||||
|
description: function() {
|
||||||
|
return el.$('textarea[name="description"]');
|
||||||
|
},
|
||||||
|
status: function(item) {
|
||||||
|
return el.$(`select option:nth-child(${item})`);
|
||||||
|
},
|
||||||
|
settings: function(item) {
|
||||||
|
return el.$$('.settings label').get(item).click();
|
||||||
|
},
|
||||||
|
submit: function() {
|
||||||
|
el.$('button[type="submit"]').click();
|
||||||
|
},
|
||||||
|
setRole: function(roleItem, value) {
|
||||||
|
let role = obj.roles().get(roleItem);
|
||||||
|
|
||||||
|
return utils.popover.open(role, value);
|
||||||
|
},
|
||||||
|
getRolePoints: function() {
|
||||||
|
let role = obj.roles().get(0);
|
||||||
|
|
||||||
|
return role.$('.points').getText();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return obj;
|
||||||
|
};
|
||||||
|
|
||||||
|
helper.getBulkCreateLightbox = function() {
|
||||||
|
let el = $('div[tg-lb-create-bulk-userstories]');
|
||||||
|
|
||||||
|
let obj = {
|
||||||
|
el: el,
|
||||||
|
waitOpen: function() {
|
||||||
|
return utils.lightbox.open(el);
|
||||||
|
},
|
||||||
|
textarea: function() {
|
||||||
|
return el.$('textarea');
|
||||||
|
},
|
||||||
|
submit: function() {
|
||||||
|
el.$('button[type="submit"]').click();
|
||||||
|
},
|
||||||
|
waitClose: function() {
|
||||||
|
return utils.lightbox.close(el);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return obj;
|
||||||
|
};
|
||||||
|
|
||||||
|
helper.getCreateEditMilestone = function() {
|
||||||
|
let el = $('div[tg-lb-create-edit-sprint]');
|
||||||
|
|
||||||
|
let obj = {
|
||||||
|
el: el,
|
||||||
|
waitOpen: function() {
|
||||||
|
return utils.lightbox.open(el);
|
||||||
|
},
|
||||||
|
name: function() {
|
||||||
|
return el.element(by.model('sprint.name'));
|
||||||
|
},
|
||||||
|
submit: function() {
|
||||||
|
el.$('button[type="submit"]').click();
|
||||||
|
},
|
||||||
|
delete: function() {
|
||||||
|
el.$('.delete-sprint .icon-delete').click();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return obj;
|
||||||
|
};
|
||||||
|
|
||||||
|
helper.userStories = function() {
|
||||||
|
return $$('.backlog-table-body > div');
|
||||||
|
};
|
||||||
|
|
||||||
|
helper.selectedUserStories = function() {
|
||||||
|
return $$('.backlog-table-body input[type="checkbox"]:checked');
|
||||||
|
};
|
||||||
|
|
||||||
|
helper.sprints = function() {
|
||||||
|
return $$('div[tg-backlog-sprint="sprint"]');
|
||||||
|
};
|
||||||
|
|
||||||
|
helper.sprintsOpen = function() {
|
||||||
|
return $$('div[tg-backlog-sprint="sprint"].sprint-open');
|
||||||
|
};
|
||||||
|
|
||||||
|
helper.openBulk = function() {
|
||||||
|
$$('.new-us a').get(1).click();
|
||||||
|
};
|
||||||
|
|
||||||
|
helper.openNewUs = function() {
|
||||||
|
$$('.new-us a').get(0).click();
|
||||||
|
};
|
||||||
|
|
||||||
|
helper.openUsBacklogEdit = function(item) {
|
||||||
|
$$('.backlog-table-body .icon-edit').get(item).click();
|
||||||
|
};
|
||||||
|
|
||||||
|
helper.openMilestoneEdit = function(item) {
|
||||||
|
$$('div[tg-backlog-sprint="sprint"] .icon-edit').get(item).click();
|
||||||
|
};
|
||||||
|
|
||||||
|
helper.setUsStatus = async function(item, value) {
|
||||||
|
let status = $$('.backlog-table-body > div .us-status').get(item);
|
||||||
|
|
||||||
|
await utils.popover.open(status, value);
|
||||||
|
|
||||||
|
return status.$$('span').first().getText();
|
||||||
|
};
|
||||||
|
|
||||||
|
helper.setUsPoints = function(item, value1, value2) {
|
||||||
|
let points = $$('.backlog-table-body > div .us-points').get(item);
|
||||||
|
|
||||||
|
return utils.popover.open(points, value1, value2);
|
||||||
|
};
|
||||||
|
|
||||||
|
helper.deleteUs = function(item) {
|
||||||
|
$$('.backlog-table-body > div .icon-delete').get(item).click();
|
||||||
|
};
|
||||||
|
|
||||||
|
helper.getUsRef = function(elm) {
|
||||||
|
return elm.$('span[tg-bo-ref]').getText();
|
||||||
|
};
|
||||||
|
|
||||||
|
helper.getSprintUsertories = function(sprint) {
|
||||||
|
return sprint.$$('.milestone-us-item-row');
|
||||||
|
};
|
||||||
|
|
||||||
|
helper.getSprintsRefs = function(sprint) {
|
||||||
|
return sprint.$$('span[tg-bo-ref]').getText();
|
||||||
|
};
|
||||||
|
|
||||||
|
helper.getSprintsTitles = function() {
|
||||||
|
return $$('div[tg-backlog-sprint="sprint"] .sprint-name span').getText();
|
||||||
|
};
|
|
@ -0,0 +1 @@
|
||||||
|
module.exports.backlog = require("./backlog-helper");
|
|
@ -1,6 +1,7 @@
|
||||||
var common = module.exports;
|
var common = module.exports;
|
||||||
|
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
|
var uuid = require('node-uuid');
|
||||||
|
|
||||||
common.hasClass = async function (element, cls) {
|
common.hasClass = async function (element, cls) {
|
||||||
let classes = await element.getAttribute('class');
|
let classes = await element.getAttribute('class');
|
||||||
|
@ -68,7 +69,7 @@ common.prepare = function() {
|
||||||
|
|
||||||
common.dragEnd = function(elm) {
|
common.dragEnd = function(elm) {
|
||||||
return browser.wait(async function() {
|
return browser.wait(async function() {
|
||||||
let count = await element.all(by.css('.ui-sortable-helper')).count()
|
let count = await $$('.ui-sortable-helper').count();
|
||||||
|
|
||||||
return count === 0;
|
return count === 0;
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
@ -83,3 +84,116 @@ common.drag = function(elm, location) {
|
||||||
return common.dragEnd();
|
return common.dragEnd();
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
|
common.transitionend = function(selector, property) {
|
||||||
|
let script = `
|
||||||
|
window.e2e = {};
|
||||||
|
|
||||||
|
var callback = arguments[1];
|
||||||
|
var property = arguments[0];
|
||||||
|
var sel = document.querySelector('${selector}');
|
||||||
|
|
||||||
|
var listener = function(event) {
|
||||||
|
var finish = function() {
|
||||||
|
window.e2e.transition = false;
|
||||||
|
sel.removeEventListener('transitionend', listener);
|
||||||
|
callback();
|
||||||
|
};
|
||||||
|
|
||||||
|
if (property) {
|
||||||
|
if(event.propertyName === property) {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
window.e2e.transition = true;
|
||||||
|
|
||||||
|
sel.addEventListener('transitionend', listener);
|
||||||
|
`;
|
||||||
|
|
||||||
|
browser.executeScript(script, property);
|
||||||
|
|
||||||
|
return function() {
|
||||||
|
return browser.wait(async function() {
|
||||||
|
let ts = await browser.executeScript(function() {
|
||||||
|
return window.e2e.transition === false;
|
||||||
|
});
|
||||||
|
|
||||||
|
return ts;
|
||||||
|
}, 5000);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
common.waitTransitionTime = async function(el) {
|
||||||
|
if (typeof el == 'string' || el instanceof String) {
|
||||||
|
el = $(el);
|
||||||
|
}
|
||||||
|
|
||||||
|
let transition = await el.getCssValue('transition');
|
||||||
|
let time = parseFloat(transition.split(' ')[1].replace('s', '')) * 1000;
|
||||||
|
|
||||||
|
return browser.sleep(time);
|
||||||
|
};
|
||||||
|
|
||||||
|
common.waitRequestAnimationFrame = function() {
|
||||||
|
let script = `
|
||||||
|
var requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame ||
|
||||||
|
window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;
|
||||||
|
|
||||||
|
var callback = arguments[0];
|
||||||
|
|
||||||
|
requestAnimationFrame(callback);
|
||||||
|
`;
|
||||||
|
|
||||||
|
return browser.executeAsyncScript(script);
|
||||||
|
};
|
||||||
|
|
||||||
|
common.outerHtmlChanges = async function(el='body') {
|
||||||
|
if (typeof el == 'string' || el instanceof String) {
|
||||||
|
el = $(el);
|
||||||
|
}
|
||||||
|
|
||||||
|
let html = await el.getOuterHtml();
|
||||||
|
|
||||||
|
return function() {
|
||||||
|
return browser.wait(async function() {
|
||||||
|
let newhtml = await el.getOuterHtml();
|
||||||
|
|
||||||
|
return html !== newhtml;
|
||||||
|
}, 5000).then(function() {
|
||||||
|
return common.waitRequestAnimationFrame();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
common.innerHtmlChanges = async function(el='body') {
|
||||||
|
if (typeof el == 'string' || el instanceof String) {
|
||||||
|
el = $(el);
|
||||||
|
}
|
||||||
|
|
||||||
|
let html = await el.getInnerHtml();
|
||||||
|
|
||||||
|
return function() {
|
||||||
|
return browser.wait(async function() {
|
||||||
|
let newhtml = await el.getOuterHtml();
|
||||||
|
|
||||||
|
return html !== newhtml;
|
||||||
|
}, 5000).then(function() {
|
||||||
|
return common.waitRequestAnimationFrame();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
common.clear = function(elem, length) {
|
||||||
|
length = length || 100;
|
||||||
|
let backspaceSeries = '';
|
||||||
|
|
||||||
|
for (var i = 0; i < length; i++) {
|
||||||
|
backspaceSeries += protractor.Key.BACK_SPACE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return elem.sendKeys(backspaceSeries);
|
||||||
|
};
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
module.exports.common = require("./common");
|
module.exports.common = require("./common");
|
||||||
module.exports.notifications = require("./notifications");
|
module.exports.notifications = require("./notifications");
|
||||||
module.exports.lightbox = require("./lightbox");
|
module.exports.lightbox = require("./lightbox");
|
||||||
|
module.exports.popover = require("./popover");
|
||||||
|
|
|
@ -6,9 +6,13 @@ var transition = 300;
|
||||||
lightbox.open = async function(el) {
|
lightbox.open = async function(el) {
|
||||||
var deferred = protractor.promise.defer();
|
var deferred = protractor.promise.defer();
|
||||||
|
|
||||||
|
if (typeof el == 'string' || el instanceof String) {
|
||||||
|
el = $(el);
|
||||||
|
}
|
||||||
|
|
||||||
let open = await browser.wait(function() {
|
let open = await browser.wait(function() {
|
||||||
return common.hasClass($(el), 'open')
|
return common.hasClass(el, 'open')
|
||||||
}, 2000);
|
}, 4000);
|
||||||
|
|
||||||
await browser.sleep(transition);
|
await browser.sleep(transition);
|
||||||
|
|
||||||
|
@ -21,25 +25,41 @@ lightbox.open = async function(el) {
|
||||||
return deferred.promise;
|
return deferred.promise;
|
||||||
};
|
};
|
||||||
|
|
||||||
lightbox.close = function(el) {
|
lightbox.close = async function(el) {
|
||||||
var deferred = protractor.promise.defer();
|
var deferred = protractor.promise.defer();
|
||||||
|
var present = true;
|
||||||
|
|
||||||
|
if (typeof el == 'string' || el instanceof String) {
|
||||||
|
el = $(el);
|
||||||
|
}
|
||||||
|
|
||||||
|
present = await el.isPresent();
|
||||||
|
|
||||||
$(el).isPresent().then(function(present) {
|
|
||||||
if (!present) {
|
if (!present) {
|
||||||
deferred.fulfill(true);
|
deferred.fulfill(true);
|
||||||
} else {
|
} else {
|
||||||
return browser.wait(function() {
|
return browser.wait(function() {
|
||||||
return common.hasClass($(el), 'open').then(function(open) {
|
return common.hasClass(el, 'open').then(function(open) {
|
||||||
return !open;
|
return !open;
|
||||||
});
|
});
|
||||||
}, 2000)
|
}, 4000)
|
||||||
.then(function() {
|
.then(function() {
|
||||||
return deferred.fulfill(true);
|
return deferred.fulfill(true);
|
||||||
}, function() {
|
}, function() {
|
||||||
deferred.reject(new Error('Lightbox doesn\'t close'));
|
deferred.reject(new Error('Lightbox doesn\'t close'));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
|
||||||
|
|
||||||
return deferred.promise;
|
return deferred.promise;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
lightbox.confirm = {};
|
||||||
|
|
||||||
|
lightbox.confirm.ok = async function() {
|
||||||
|
let lb = $('.lightbox-generic-ask');
|
||||||
|
await lightbox.open(lb);
|
||||||
|
|
||||||
|
lb.$('.button-green').click();
|
||||||
|
|
||||||
|
await lightbox.close(lb);
|
||||||
|
};
|
||||||
|
|
|
@ -10,7 +10,7 @@ notifications.success.open = function() {
|
||||||
|
|
||||||
return browser
|
return browser
|
||||||
.wait(function() {
|
.wait(function() {
|
||||||
return common.hasClass(el, 'active')
|
return common.hasClass(el, 'active');
|
||||||
}, 2000)
|
}, 2000)
|
||||||
.then(function(active) {
|
.then(function(active) {
|
||||||
return browser.sleep(transition).then(function() {
|
return browser.sleep(transition).then(function() {
|
||||||
|
@ -25,7 +25,7 @@ notifications.error.open = function() {
|
||||||
|
|
||||||
return browser
|
return browser
|
||||||
.wait(function() {
|
.wait(function() {
|
||||||
return common.hasClass(el, 'active')
|
return common.hasClass(el, 'active');
|
||||||
}, 2000)
|
}, 2000)
|
||||||
.then(function(active) {
|
.then(function(active) {
|
||||||
return browser.sleep(transition).then(function() {
|
return browser.sleep(transition).then(function() {
|
||||||
|
@ -40,7 +40,7 @@ notifications.errorLight.open = function() {
|
||||||
|
|
||||||
return browser
|
return browser
|
||||||
.wait(function() {
|
.wait(function() {
|
||||||
return common.hasClass(el, 'active')
|
return common.hasClass(el, 'active');
|
||||||
}, 2000)
|
}, 2000)
|
||||||
.then(function(active) {
|
.then(function(active) {
|
||||||
return browser.sleep(transition).then(function() {
|
return browser.sleep(transition).then(function() {
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
var common = require('./common')
|
||||||
|
|
||||||
|
var popover = module.exports;
|
||||||
|
|
||||||
|
var transition = 400;
|
||||||
|
|
||||||
|
async function selectPopoverItem(popover, item) {
|
||||||
|
popover.$$('a').get(item).click();
|
||||||
|
|
||||||
|
await browser.sleep(transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
popover.wait = async function() {
|
||||||
|
await browser.wait(async function() {
|
||||||
|
return await $$('.popover.active').count() === 1;
|
||||||
|
}, 1000);
|
||||||
|
|
||||||
|
return $('.popover.active');
|
||||||
|
};
|
||||||
|
|
||||||
|
popover.open = async function(el, item, item2) {
|
||||||
|
el.click();
|
||||||
|
|
||||||
|
var pop = await popover.wait();
|
||||||
|
|
||||||
|
if (item) {
|
||||||
|
await selectPopoverItem(pop, item);
|
||||||
|
|
||||||
|
if (item2) {
|
||||||
|
pop = await popover.wait();
|
||||||
|
await selectPopoverItem(pop, item2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return pop;
|
||||||
|
};
|
|
@ -66,6 +66,7 @@
|
||||||
"karma-sourcemap-loader": "^0.3.4",
|
"karma-sourcemap-loader": "^0.3.4",
|
||||||
"minimist": "^1.1.1",
|
"minimist": "^1.1.1",
|
||||||
"mocha": "^2.2.4",
|
"mocha": "^2.2.4",
|
||||||
|
"node-uuid": "^1.4.3",
|
||||||
"pre-commit": "^1.0.5",
|
"pre-commit": "^1.0.5",
|
||||||
"readable-stream": "~1.0.33",
|
"readable-stream": "~1.0.33",
|
||||||
"run-sequence": "^1.0.2",
|
"run-sequence": "^1.0.2",
|
||||||
|
|
Loading…
Reference in New Issue