list and issue creation e2e
parent
91be0da2e7
commit
eec61ef202
|
@ -46,6 +46,8 @@ class PageMixin
|
|||
.filter((x) -> _.contains(computableRoles, x.id))
|
||||
.value()
|
||||
loadUsersAndRoles: ->
|
||||
console.log @scope.projectId
|
||||
|
||||
promise = @q.all([
|
||||
@rs.projects.usersList(@scope.projectId),
|
||||
@rs.projects.rolesList(@scope.projectId)
|
||||
|
|
|
@ -0,0 +1,132 @@
|
|||
var utils = require('../utils');
|
||||
var issuesHelper = require('../helpers').issues;
|
||||
var commonHelper = require('../helpers').common;
|
||||
|
||||
var chai = require('chai');
|
||||
var chaiAsPromised = require('chai-as-promised');
|
||||
|
||||
chai.use(chaiAsPromised);
|
||||
var expect = chai.expect;
|
||||
|
||||
describe.only('issues list', function() {
|
||||
before(async function() {
|
||||
browser.get('http://localhost:9001/project/project-3/issues');
|
||||
await utils.common.waitLoader();
|
||||
|
||||
utils.common.takeScreenshot('issues', 'issues');
|
||||
});
|
||||
|
||||
describe('create Issue', function() {
|
||||
let createIssueLightbox = null;
|
||||
|
||||
before(async function() {
|
||||
createIssueLightbox = issuesHelper.getCreateIssueLightbox();
|
||||
|
||||
issuesHelper.openNewIssueLb();
|
||||
|
||||
await createIssueLightbox.waitOpen();
|
||||
});
|
||||
|
||||
it('capture screen', function() {
|
||||
utils.common.takeScreenshot('issues', 'create-issue');
|
||||
});
|
||||
|
||||
it('fill form', async function() {
|
||||
// subject
|
||||
createIssueLightbox.subject().sendKeys('subject');
|
||||
|
||||
// tags
|
||||
await createIssueLightbox.tags().sendKeys('aaa');
|
||||
browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||
|
||||
await createIssueLightbox.tags().sendKeys('bbb');
|
||||
browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||
|
||||
utils.common.takeScreenshot('issues', 'create-issue-filled');
|
||||
});
|
||||
|
||||
it('send form', async function() {
|
||||
createIssueLightbox.submit();
|
||||
|
||||
await createIssueLightbox.waitClose();
|
||||
|
||||
expect(utils.notifications.success.open()).to.be.eventually.true;
|
||||
});
|
||||
});
|
||||
|
||||
describe('bulk create Issue', function() {
|
||||
let createIssueLightbox = null;
|
||||
|
||||
before(async function() {
|
||||
issuesHelper.openBulk();
|
||||
|
||||
createIssueLightbox = issuesHelper.getBulkCreateLightbox();
|
||||
|
||||
createIssueLightbox.waitOpen();
|
||||
});
|
||||
|
||||
it('fill form', function() {
|
||||
createIssueLightbox.textarea().sendKeys('aaa');
|
||||
browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||
|
||||
createIssueLightbox.textarea().sendKeys('bbb');
|
||||
browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||
});
|
||||
|
||||
it('send form', async function() {
|
||||
createIssueLightbox.submit();
|
||||
|
||||
await createIssueLightbox.waitClose();
|
||||
|
||||
expect(utils.notifications.success.open()).to.be.eventually.true;
|
||||
});
|
||||
});
|
||||
|
||||
it('change order', async function() {
|
||||
let table = issuesHelper.getTable();
|
||||
|
||||
// test every column order
|
||||
for(let i = 0; i < 7; i++) {
|
||||
let htmlChanges = await utils.common.outerHtmlChanges(table);
|
||||
issuesHelper.clickColumn(i);
|
||||
await htmlChanges();
|
||||
|
||||
htmlChanges = await utils.common.outerHtmlChanges(table);
|
||||
issuesHelper.clickColumn(i);
|
||||
await htmlChanges();
|
||||
}
|
||||
});
|
||||
|
||||
it('assignto to', async function() {
|
||||
let assignToLightbox = commonHelper.assignToLightbox();
|
||||
|
||||
issuesHelper.openAssignTo(0);
|
||||
|
||||
await assignToLightbox.waitOpen();
|
||||
|
||||
assignToLightbox.select(1);
|
||||
|
||||
let newUserName = await assignToLightbox.getName(1);
|
||||
|
||||
await assignToLightbox.waitClose();
|
||||
|
||||
let issueUserName = await issuesHelper.getAssignTo(0);
|
||||
|
||||
expect(issueUserName).to.be.equal(newUserName);
|
||||
});
|
||||
|
||||
it('pagination', async function() {
|
||||
|
||||
let table = issuesHelper.getTable();
|
||||
|
||||
let htmlChanges = await utils.common.outerHtmlChanges(table);
|
||||
|
||||
issuesHelper.clickPagination(1);
|
||||
|
||||
await htmlChanges();
|
||||
|
||||
let url = await browser.getCurrentUrl();
|
||||
|
||||
expect(url).to.contain('page=2');
|
||||
});
|
||||
});
|
|
@ -36,7 +36,7 @@ describe('search page', function() {
|
|||
});
|
||||
|
||||
describe('tabs', function() {
|
||||
it('issues', async function() {
|
||||
it('issues tab', async function() {
|
||||
let option = $$('.search-filter li').get(1).$('a');
|
||||
option.click();
|
||||
|
||||
|
@ -47,7 +47,7 @@ describe('search page', function() {
|
|||
expect(active).to.be.true;
|
||||
});
|
||||
|
||||
it('tasks', async function() {
|
||||
it('tasks tab', async function() {
|
||||
let option = $$('.search-filter li').get(2).$('a');
|
||||
option.click();
|
||||
|
||||
|
@ -58,7 +58,7 @@ describe('search page', function() {
|
|||
expect(active).to.be.true;
|
||||
});
|
||||
|
||||
it('wiki', async function() {
|
||||
it('wiki tab', async function() {
|
||||
let option = $$('.search-filter li').get(3).$('a');
|
||||
option.click();
|
||||
|
||||
|
@ -69,7 +69,7 @@ describe('search page', function() {
|
|||
expect(active).to.be.true;
|
||||
});
|
||||
|
||||
it('userstories', async function() {
|
||||
it('userstories tab', async function() {
|
||||
let option = $$('.search-filter li').get(0).$('a');
|
||||
option.click();
|
||||
|
||||
|
|
|
@ -15,8 +15,11 @@ helper.assignToLightbox = function() {
|
|||
selectFirst: function() {
|
||||
el.$$('div[data-user-id]').first().click();
|
||||
},
|
||||
select: function(index) {
|
||||
el.$$('div[data-user-id]').get(index).click();
|
||||
},
|
||||
getName: function(item) {
|
||||
return el.$$('div[data-user-id]').get(item).$('.watcher-name').getText();
|
||||
return el.$$('div[data-user-id] .watcher-name').get(item).getText();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -11,3 +11,4 @@ module.exports.common = require("./common-helper");
|
|||
module.exports.adminMemberships = require("./admin-memberships");
|
||||
module.exports.adminPermissions = require("./admin-permissions");
|
||||
module.exports.adminIntegrations = require("./admin-integrations");
|
||||
module.exports.issues = require("./issues-helper");
|
||||
|
|
|
@ -0,0 +1,78 @@
|
|||
var utils = require('../utils');
|
||||
|
||||
var helper = module.exports;
|
||||
|
||||
helper.getCreateIssueLightbox = function() {
|
||||
let el = $('div[tg-lb-create-issue]');
|
||||
|
||||
let obj = {
|
||||
el: el,
|
||||
waitOpen: function() {
|
||||
return utils.lightbox.open(el);
|
||||
},
|
||||
waitClose: function() {
|
||||
return utils.lightbox.close(el);
|
||||
},
|
||||
subject: function() {
|
||||
return el.$$('input').first();
|
||||
},
|
||||
tags: function() {
|
||||
return el.$('.tag-input');
|
||||
},
|
||||
submit: function() {
|
||||
el.$('button[type="submit"]').click();
|
||||
}
|
||||
};
|
||||
|
||||
return obj;
|
||||
};
|
||||
|
||||
helper.getBulkCreateLightbox = function() {
|
||||
let el = $('div[tg-lb-create-bulk-issues]');
|
||||
|
||||
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.openNewIssueLb = function() {
|
||||
$('.new-issue .button-green').click();
|
||||
};
|
||||
|
||||
helper.openBulk = function() {
|
||||
$('.new-issue .button-bulk').click();
|
||||
};
|
||||
|
||||
helper.clickColumn = function(index) {
|
||||
$$('.row.title > div').get(index).click();
|
||||
};
|
||||
|
||||
helper.getTable = function() {
|
||||
return $('.basic-table');
|
||||
};
|
||||
|
||||
helper.openAssignTo = function(index) {
|
||||
$$('.issue-assignedto').get(index).click();
|
||||
};
|
||||
|
||||
helper.getAssignTo = function(index) {
|
||||
return $$('.assigned-field figcaption').get(index).getText();
|
||||
};
|
||||
|
||||
helper.clickPagination = function(index) {
|
||||
$$('.paginator li').get(index).click();
|
||||
};
|
Loading…
Reference in New Issue