add severity & types admin e2e
parent
b5c94a1f90
commit
1e1c884543
|
@ -24,7 +24,7 @@ describe('attributes - priorities', function() {
|
|||
|
||||
let formWrapper = section.openNew();
|
||||
|
||||
let form = adminAttributesHelper.getPrioritiesForm(formWrapper);
|
||||
let form = adminAttributesHelper.getGenericForm(formWrapper);
|
||||
|
||||
await form.name().sendKeys('test test');
|
||||
|
||||
|
@ -69,7 +69,7 @@ describe('attributes - priorities', function() {
|
|||
|
||||
await section.edit(row);
|
||||
|
||||
let form = adminAttributesHelper.getPrioritiesForm(row.$('form'));
|
||||
let form = adminAttributesHelper.getGenericForm(row.$('form'));
|
||||
|
||||
let newPriorityName = 'test test' + Date.now();
|
||||
await form.name().clear();
|
||||
|
@ -79,7 +79,7 @@ describe('attributes - priorities', function() {
|
|||
|
||||
await browser.waitForAngular();
|
||||
|
||||
let newPriorities = await adminAttributesHelper.getPrioritiesNames(section.el);
|
||||
let newPriorities = await adminAttributesHelper.getGenericNames(section.el);
|
||||
|
||||
expect(newPriorities.indexOf(newPriorityName)).to.be.not.equal(-1);
|
||||
});
|
||||
|
@ -87,11 +87,11 @@ describe('attributes - priorities', function() {
|
|||
it('drag', async function() {
|
||||
let section = adminAttributesHelper.getSection(0);
|
||||
let rows = section.rows();
|
||||
let priorities = await adminAttributesHelper.getPrioritiesNames(section.el);
|
||||
let priorities = await adminAttributesHelper.getGenericNames(section.el);
|
||||
|
||||
await utils.common.drag(rows.get(0), rows.get(2));
|
||||
|
||||
let newPriorities = await adminAttributesHelper.getPrioritiesNames(section.el);
|
||||
let newPriorities = await adminAttributesHelper.getGenericNames(section.el);
|
||||
|
||||
expect(priorities[0]).to.be.equal(newPriorities[1]);
|
||||
});
|
||||
|
|
|
@ -0,0 +1,98 @@
|
|||
var utils = require('../../../utils');
|
||||
|
||||
var adminAttributesHelper = require('../../../helpers').adminAttributes;
|
||||
|
||||
var chai = require('chai');
|
||||
var chaiAsPromised = require('chai-as-promised');
|
||||
|
||||
chai.use(chaiAsPromised);
|
||||
var expect = chai.expect;
|
||||
|
||||
describe('attributes - severities', function() {
|
||||
before(async function(){
|
||||
browser.get('http://localhost:9001/project/project-0/admin/project-values/severities');
|
||||
|
||||
await utils.common.waitLoader();
|
||||
|
||||
utils.common.takeScreenshot('attributes', 'severities');
|
||||
});
|
||||
|
||||
it('new severity', async function() {
|
||||
let section = adminAttributesHelper.getSection(0);
|
||||
let rows = section.rows();
|
||||
let count = await rows.count();
|
||||
|
||||
let formWrapper = section.openNew();
|
||||
|
||||
let form = adminAttributesHelper.getGenericForm(formWrapper);
|
||||
|
||||
await form.name().sendKeys('test test');
|
||||
|
||||
await form.save();
|
||||
|
||||
await browser.waitForAngular();
|
||||
|
||||
let newCount = await rows.count();
|
||||
|
||||
expect(newCount).to.be.equal(count + 1);
|
||||
});
|
||||
|
||||
it('delete', async function() {
|
||||
let section = adminAttributesHelper.getSection(0);
|
||||
let rows = section.rows();
|
||||
|
||||
let count = await rows.count();
|
||||
|
||||
let row = rows.get(count - 1);
|
||||
|
||||
section.delete(row);
|
||||
|
||||
let el = $('.lightbox-ask-choice');
|
||||
|
||||
await utils.lightbox.open(el);
|
||||
|
||||
utils.common.takeScreenshot('attributes', 'delete-severity');
|
||||
|
||||
el.$('.button-green').click();
|
||||
|
||||
await utils.lightbox.close(el);
|
||||
|
||||
let newCount = await rows.count();
|
||||
|
||||
expect(newCount).to.be.equal(count - 1);
|
||||
});
|
||||
|
||||
it('edit', async function() {
|
||||
let section = adminAttributesHelper.getSection(0);
|
||||
let rows = section.rows();
|
||||
let row = rows.get(0);
|
||||
|
||||
await section.edit(row);
|
||||
|
||||
let form = adminAttributesHelper.getGenericForm(row.$('form'));
|
||||
|
||||
let newName = 'test test' + Date.now();
|
||||
await form.name().clear();
|
||||
await form.name().sendKeys(newName);
|
||||
|
||||
await form.save();
|
||||
|
||||
await browser.waitForAngular();
|
||||
|
||||
let newObjs = await adminAttributesHelper.getGenericNames(section.el);
|
||||
|
||||
expect(newObjs.indexOf(newName)).to.be.not.equal(-1);
|
||||
});
|
||||
|
||||
it('drag', async function() {
|
||||
let section = adminAttributesHelper.getSection(0);
|
||||
let rows = section.rows();
|
||||
let objs = await adminAttributesHelper.getGenericNames(section.el);
|
||||
|
||||
await utils.common.drag(rows.get(0), rows.get(2));
|
||||
|
||||
let newObjs = await adminAttributesHelper.getGenericNames(section.el);
|
||||
|
||||
expect(objs[0]).to.be.equal(newObjs[1]);
|
||||
});
|
||||
});
|
|
@ -0,0 +1,98 @@
|
|||
var utils = require('../../../utils');
|
||||
|
||||
var adminAttributesHelper = require('../../../helpers').adminAttributes;
|
||||
|
||||
var chai = require('chai');
|
||||
var chaiAsPromised = require('chai-as-promised');
|
||||
|
||||
chai.use(chaiAsPromised);
|
||||
var expect = chai.expect;
|
||||
|
||||
describe.only('attributes - types', function() {
|
||||
before(async function(){
|
||||
browser.get('http://localhost:9001/project/project-0/admin/project-values/types');
|
||||
|
||||
await utils.common.waitLoader();
|
||||
|
||||
utils.common.takeScreenshot('attributes', 'types');
|
||||
});
|
||||
|
||||
it('new type', async function() {
|
||||
let section = adminAttributesHelper.getSection(0);
|
||||
let rows = section.rows();
|
||||
let count = await rows.count();
|
||||
|
||||
let formWrapper = section.openNew();
|
||||
|
||||
let form = adminAttributesHelper.getGenericForm(formWrapper);
|
||||
|
||||
await form.name().sendKeys('test test');
|
||||
|
||||
await form.save();
|
||||
|
||||
await browser.waitForAngular();
|
||||
|
||||
let newCount = await rows.count();
|
||||
|
||||
expect(newCount).to.be.equal(count + 1);
|
||||
});
|
||||
|
||||
it('delete', async function() {
|
||||
let section = adminAttributesHelper.getSection(0);
|
||||
let rows = section.rows();
|
||||
|
||||
let count = await rows.count();
|
||||
|
||||
let row = rows.get(count - 1);
|
||||
|
||||
section.delete(row);
|
||||
|
||||
let el = $('.lightbox-ask-choice');
|
||||
|
||||
await utils.lightbox.open(el);
|
||||
|
||||
utils.common.takeScreenshot('attributes', 'delete-type');
|
||||
|
||||
el.$('.button-green').click();
|
||||
|
||||
await utils.lightbox.close(el);
|
||||
|
||||
let newCount = await rows.count();
|
||||
|
||||
expect(newCount).to.be.equal(count - 1);
|
||||
});
|
||||
|
||||
it('edit', async function() {
|
||||
let section = adminAttributesHelper.getSection(0);
|
||||
let rows = section.rows();
|
||||
let row = rows.get(0);
|
||||
|
||||
await section.edit(row);
|
||||
|
||||
let form = adminAttributesHelper.getGenericForm(row.$('form'));
|
||||
|
||||
let newName = 'test test' + Date.now();
|
||||
await form.name().clear();
|
||||
await form.name().sendKeys(newName);
|
||||
|
||||
await form.save();
|
||||
|
||||
await browser.waitForAngular();
|
||||
|
||||
let newObjs = await adminAttributesHelper.getGenericNames(section.el);
|
||||
|
||||
expect(newObjs.indexOf(newName)).to.be.not.equal(-1);
|
||||
});
|
||||
|
||||
it('drag', async function() {
|
||||
let section = adminAttributesHelper.getSection(0);
|
||||
let rows = section.rows();
|
||||
let objs = await adminAttributesHelper.getGenericNames(section.el);
|
||||
|
||||
await utils.common.drag(rows.get(0), rows.get(2));
|
||||
|
||||
let newObjs = await adminAttributesHelper.getGenericNames(section.el);
|
||||
|
||||
expect(objs[0]).to.be.equal(newObjs[1]);
|
||||
});
|
||||
});
|
|
@ -87,7 +87,7 @@ helper.getPointsForm = function(form) {
|
|||
return obj;
|
||||
};
|
||||
|
||||
helper.getPrioritiesForm = function(form) {
|
||||
helper.getGenericForm = function(form) {
|
||||
let obj = Object.create(helper.getForm(form));
|
||||
|
||||
obj.name = function() {
|
||||
|
@ -97,7 +97,7 @@ helper.getPrioritiesForm = function(form) {
|
|||
return obj;
|
||||
};
|
||||
|
||||
helper.getPrioritiesNames = function(section) {
|
||||
helper.getGenericNames = function(section) {
|
||||
return section.$$('.status-name span').getText();
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue