detail custom fields e2e
parent
313ab3cf63
commit
b1f492e5c0
|
@ -1,6 +1,5 @@
|
||||||
var utils = require('../../../utils');
|
var utils = require('../../../utils');
|
||||||
|
var customFieldsHelper = require('../../../helpers/custom-fields-helper');
|
||||||
var adminAttributesHelper = require('../../../helpers').adminAttributes;
|
|
||||||
|
|
||||||
var chai = require('chai');
|
var chai = require('chai');
|
||||||
var chaiAsPromised = require('chai-as-promised');
|
var chaiAsPromised = require('chai-as-promised');
|
||||||
|
@ -8,116 +7,181 @@ var chaiAsPromised = require('chai-as-promised');
|
||||||
chai.use(chaiAsPromised);
|
chai.use(chaiAsPromised);
|
||||||
var expect = chai.expect;
|
var expect = chai.expect;
|
||||||
|
|
||||||
describe('attributes - custom fields', function() {
|
describe('custom-fields', function() {
|
||||||
before(async function(){
|
before(async function() {
|
||||||
browser.get('http://localhost:9001/project/project-0/admin/project-values/custom-fields');
|
browser.get('http://localhost:9001/project/project-3/admin/project-values/custom-fields');
|
||||||
|
|
||||||
await utils.common.waitLoader();
|
await utils.common.waitLoader();
|
||||||
|
|
||||||
utils.common.takeScreenshot('attributes', 'custom-fields');
|
utils.common.takeScreenshot('attributes', 'custom-fields');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('new', async function() {
|
describe('create custom fields', function() {
|
||||||
let section = adminAttributesHelper.getSection(0);
|
describe('userstories', function() {
|
||||||
let rows = section.rows();
|
let typeIndex = 0;
|
||||||
let count = await rows.count();
|
|
||||||
|
|
||||||
let formWrapper = section.openNew();
|
it('create', async function() {
|
||||||
|
let oldCountCustomFields = await customFieldsHelper.getCustomFiledsByType(typeIndex).count();
|
||||||
|
|
||||||
let form = adminAttributesHelper.getCustomFieldsForm(formWrapper);
|
customFieldsHelper.create(typeIndex, 'test1-text', 'desc1', 1);
|
||||||
|
|
||||||
await form.name().sendKeys('test test');
|
// debounce :(
|
||||||
|
await utils.notifications.success.open();
|
||||||
|
await browser.sleep(2000);
|
||||||
|
|
||||||
await form.save();
|
customFieldsHelper.create(typeIndex, 'test1-multi', 'desc1', 3);
|
||||||
|
|
||||||
await browser.waitForAngular();
|
// debounce :(
|
||||||
|
await utils.notifications.success.open();
|
||||||
|
await browser.sleep(2000);
|
||||||
|
|
||||||
let newCount = await rows.count();
|
// customFieldsHelper.create(typeIndex, 'test1-date', 'desc1', 4);
|
||||||
|
|
||||||
expect(newCount).to.be.equal(count + 1);
|
// // debounce :(
|
||||||
});
|
// await utils.notifications.success.open();
|
||||||
|
// await browser.sleep(2000);
|
||||||
|
|
||||||
it('duplicate', async function() {
|
let countCustomFields = customFieldsHelper.getCustomFiledsByType(typeIndex).count();
|
||||||
let section = adminAttributesHelper.getSection(0);
|
|
||||||
let rows = section.rows();
|
|
||||||
let count = await rows.count();
|
|
||||||
|
|
||||||
let formWrapper = section.openNew();
|
expect(countCustomFields).to.be.eventually.equal(oldCountCustomFields + 2);
|
||||||
|
});
|
||||||
|
|
||||||
let form = adminAttributesHelper.getCustomFieldsForm(formWrapper);
|
it('edit', async function() {
|
||||||
|
customFieldsHelper.edit(typeIndex, 0, 'edit', 'desc2', 2);
|
||||||
|
|
||||||
await form.name().sendKeys('test test');
|
expect(utils.notifications.success.open()).to.be.eventually.true;
|
||||||
|
});
|
||||||
|
|
||||||
await form.save();
|
it('drag', async function() {
|
||||||
|
let nameOld = await customFieldsHelper.getName(typeIndex, 0);
|
||||||
|
|
||||||
await browser.waitForAngular();
|
await customFieldsHelper.drag(typeIndex, 0, 1);
|
||||||
|
|
||||||
let newCount = await rows.count();
|
let nameNew = customFieldsHelper.getName(typeIndex, 1);
|
||||||
|
|
||||||
let errors = await form.errors().count();
|
expect(nameNew).to.be.eventually.equal(nameOld);
|
||||||
|
});
|
||||||
|
|
||||||
utils.common.takeScreenshot('attributes', 'status-error');
|
it('delete', async function() {
|
||||||
|
let oldCountCustomFields = await customFieldsHelper.getCustomFiledsByType(typeIndex).count();
|
||||||
|
|
||||||
expect(errors).to.be.equal(1);
|
customFieldsHelper.delete(typeIndex, 0);
|
||||||
expect(newCount).to.be.equal(count);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('delete', async function() {
|
let countCustomFields = customFieldsHelper.getCustomFiledsByType(typeIndex).count();
|
||||||
let section = adminAttributesHelper.getSection(0);
|
|
||||||
let rows = section.rows();
|
|
||||||
|
|
||||||
let count = await rows.count();
|
expect(countCustomFields).to.be.eventually.equal(oldCountCustomFields - 1);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
let row = rows.get(count - 1);
|
describe('tasks', function() {
|
||||||
|
let typeIndex = 1;
|
||||||
|
|
||||||
section.delete(row);
|
it('create', async function() {
|
||||||
|
let oldCountCustomFields = await customFieldsHelper.getCustomFiledsByType(typeIndex).count();
|
||||||
|
|
||||||
let el = $('.lightbox-generic-ask');
|
customFieldsHelper.create(typeIndex, 'test1-text', 'desc1', 1);
|
||||||
|
|
||||||
await utils.lightbox.open(el);
|
// debounce :(
|
||||||
|
await utils.notifications.success.open();
|
||||||
|
await browser.sleep(2000);
|
||||||
|
|
||||||
utils.common.takeScreenshot('attributes', 'delete-custom-field');
|
customFieldsHelper.create(typeIndex, 'test1-multi', 'desc1', 3);
|
||||||
|
|
||||||
el.$('.button-green').click();
|
// debounce :(
|
||||||
|
await utils.notifications.success.open();
|
||||||
|
await browser.sleep(2000);
|
||||||
|
|
||||||
await utils.lightbox.close(el);
|
// customFieldsHelper.create(typeIndex, 'test1-date', 'desc1', 4);
|
||||||
|
|
||||||
let newCount = await rows.count();
|
// // debounce :(
|
||||||
|
// await utils.notifications.success.open();
|
||||||
|
// await browser.sleep(2000);
|
||||||
|
|
||||||
expect(newCount).to.be.equal(count - 1);
|
let countCustomFields = customFieldsHelper.getCustomFiledsByType(typeIndex).count();
|
||||||
});
|
|
||||||
|
|
||||||
it('edit', async function() {
|
expect(countCustomFields).to.be.eventually.equal(oldCountCustomFields + 2);
|
||||||
let section = adminAttributesHelper.getSection(0);
|
});
|
||||||
let rows = section.rows();
|
|
||||||
let row = rows.get(0);
|
|
||||||
|
|
||||||
await section.edit(row);
|
it('edit', async function() {
|
||||||
|
customFieldsHelper.edit(typeIndex, 0, 'edit', 'desc2', 2);
|
||||||
|
|
||||||
let form = adminAttributesHelper.getCustomFieldsForm(row.$('form'));
|
expect(utils.notifications.success.open()).to.be.eventually.true;
|
||||||
|
});
|
||||||
|
|
||||||
let newCfName = 'test test' + Date.now();
|
it('drag', async function() {
|
||||||
await form.name().clear();
|
let nameOld = await customFieldsHelper.getName(typeIndex, 0);
|
||||||
await form.name().sendKeys(newCfName);
|
|
||||||
|
|
||||||
await form.save();
|
await customFieldsHelper.drag(typeIndex, 0, 1);
|
||||||
|
|
||||||
await browser.waitForAngular();
|
let nameNew = customFieldsHelper.getName(typeIndex, 1);
|
||||||
|
|
||||||
let newCfs = await adminAttributesHelper.getCustomFieldsNames(section.el);
|
expect(nameNew).to.be.eventually.equal(nameOld);
|
||||||
|
});
|
||||||
|
|
||||||
expect(newCfs.indexOf(newCfName)).to.be.not.equal(-1);
|
it('delete', async function() {
|
||||||
});
|
let oldCountCustomFields = await customFieldsHelper.getCustomFiledsByType(typeIndex).count();
|
||||||
|
|
||||||
it('drag', async function() {
|
customFieldsHelper.delete(typeIndex, 0);
|
||||||
let section = adminAttributesHelper.getSection(0);
|
|
||||||
let rows = section.rows();
|
|
||||||
let cfs = await adminAttributesHelper.getCustomFieldsNames(section.el);
|
|
||||||
|
|
||||||
await utils.common.drag(rows.get(0), rows.get(2));
|
let countCustomFields = customFieldsHelper.getCustomFiledsByType(typeIndex).count();
|
||||||
|
|
||||||
let newCfs = await adminAttributesHelper.getCustomFieldsNames(section.el);
|
expect(countCustomFields).to.be.eventually.equal(oldCountCustomFields - 1);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
expect(cfs[0]).to.be.equal(newCfs[1]);
|
describe('issues', function() {
|
||||||
|
let typeIndex = 2;
|
||||||
|
|
||||||
|
it('create', async function() {
|
||||||
|
let oldCountCustomFields = await customFieldsHelper.getCustomFiledsByType(typeIndex).count();
|
||||||
|
|
||||||
|
customFieldsHelper.create(typeIndex, 'test1-text', 'desc1', 1);
|
||||||
|
|
||||||
|
// debounce :(
|
||||||
|
await utils.notifications.success.open();
|
||||||
|
await browser.sleep(2000);
|
||||||
|
|
||||||
|
customFieldsHelper.create(typeIndex, 'test1-multi', 'desc1', 3);
|
||||||
|
|
||||||
|
// debounce :(
|
||||||
|
await utils.notifications.success.open();
|
||||||
|
await browser.sleep(2000);
|
||||||
|
|
||||||
|
// customFieldsHelper.create(typeIndex, 'test1-date', 'desc1', 4);
|
||||||
|
|
||||||
|
// // debounce :(
|
||||||
|
// await utils.notifications.success.open();
|
||||||
|
// await browser.sleep(2000);
|
||||||
|
|
||||||
|
let countCustomFields = customFieldsHelper.getCustomFiledsByType(typeIndex).count();
|
||||||
|
|
||||||
|
expect(countCustomFields).to.be.eventually.equal(oldCountCustomFields + 2);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('edit', async function() {
|
||||||
|
customFieldsHelper.edit(typeIndex, 0, 'edit', 'desc2', 2);
|
||||||
|
|
||||||
|
expect(utils.notifications.success.open()).to.be.eventually.true;
|
||||||
|
});
|
||||||
|
|
||||||
|
it('drag', async function() {
|
||||||
|
let nameOld = await customFieldsHelper.getName(typeIndex, 0);
|
||||||
|
|
||||||
|
await customFieldsHelper.drag(typeIndex, 0, 1);
|
||||||
|
|
||||||
|
let nameNew = customFieldsHelper.getName(typeIndex, 1);
|
||||||
|
|
||||||
|
expect(nameNew).to.be.eventually.equal(nameOld);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('delete', async function() {
|
||||||
|
let oldCountCustomFields = await customFieldsHelper.getCustomFiledsByType(typeIndex).count();
|
||||||
|
|
||||||
|
customFieldsHelper.delete(typeIndex, 0);
|
||||||
|
|
||||||
|
let countCustomFields = customFieldsHelper.getCustomFiledsByType(typeIndex).count();
|
||||||
|
|
||||||
|
expect(countCustomFields).to.be.eventually.equal(oldCountCustomFields - 1);
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,185 +0,0 @@
|
||||||
var utils = require('../utils');
|
|
||||||
var customFieldsHelper = require('../helpers/custom-fields-helper');
|
|
||||||
|
|
||||||
var chai = require('chai');
|
|
||||||
var chaiAsPromised = require('chai-as-promised');
|
|
||||||
|
|
||||||
chai.use(chaiAsPromised);
|
|
||||||
var expect = chai.expect;
|
|
||||||
|
|
||||||
describe('custom-fields', function() {
|
|
||||||
before(async function() {
|
|
||||||
browser.get('http://localhost:9001/project/project-3/admin/project-values/custom-fields');
|
|
||||||
await utils.common.waitLoader();
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('create custom fields', function() {
|
|
||||||
describe('userstories', function() {
|
|
||||||
let typeIndex = 0;
|
|
||||||
|
|
||||||
it('create', async function() {
|
|
||||||
let oldCountCustomFields = await customFieldsHelper.getCustomFiledsByType(typeIndex).count();
|
|
||||||
|
|
||||||
customFieldsHelper.create(typeIndex, 'test1-text', 'desc1', 1);
|
|
||||||
|
|
||||||
// debounce :(
|
|
||||||
await utils.notifications.success.open();
|
|
||||||
await browser.sleep(2000);
|
|
||||||
|
|
||||||
customFieldsHelper.create(typeIndex, 'test1-multi', 'desc1', 3);
|
|
||||||
|
|
||||||
// debounce :(
|
|
||||||
await utils.notifications.success.open();
|
|
||||||
await browser.sleep(2000);
|
|
||||||
|
|
||||||
// customFieldsHelper.create(typeIndex, 'test1-date', 'desc1', 4);
|
|
||||||
|
|
||||||
// // debounce :(
|
|
||||||
// await utils.notifications.success.open();
|
|
||||||
// await browser.sleep(2000);
|
|
||||||
|
|
||||||
let countCustomFields = customFieldsHelper.getCustomFiledsByType(typeIndex).count();
|
|
||||||
|
|
||||||
expect(countCustomFields).to.be.eventually.equal(oldCountCustomFields + 2);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('edit', async function() {
|
|
||||||
customFieldsHelper.edit(typeIndex, 0, 'edit', 'desc2', 2);
|
|
||||||
|
|
||||||
expect(utils.notifications.success.open()).to.be.eventually.true;
|
|
||||||
});
|
|
||||||
|
|
||||||
it('drag', async function() {
|
|
||||||
let nameOld = await customFieldsHelper.getName(typeIndex, 0);
|
|
||||||
|
|
||||||
await customFieldsHelper.drag(typeIndex, 0, 1);
|
|
||||||
|
|
||||||
let nameNew = customFieldsHelper.getName(typeIndex, 1);
|
|
||||||
|
|
||||||
expect(nameNew).to.be.eventually.equal(nameOld);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('delete', async function() {
|
|
||||||
let oldCountCustomFields = await customFieldsHelper.getCustomFiledsByType(typeIndex).count();
|
|
||||||
|
|
||||||
customFieldsHelper.delete(typeIndex, 0);
|
|
||||||
|
|
||||||
let countCustomFields = customFieldsHelper.getCustomFiledsByType(typeIndex).count();
|
|
||||||
|
|
||||||
expect(countCustomFields).to.be.eventually.equal(oldCountCustomFields - 1);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('tasks', function() {
|
|
||||||
let typeIndex = 1;
|
|
||||||
|
|
||||||
it('create', async function() {
|
|
||||||
let oldCountCustomFields = await customFieldsHelper.getCustomFiledsByType(typeIndex).count();
|
|
||||||
|
|
||||||
customFieldsHelper.create(typeIndex, 'test1-text', 'desc1', 1);
|
|
||||||
|
|
||||||
// debounce :(
|
|
||||||
await utils.notifications.success.open();
|
|
||||||
await browser.sleep(2000);
|
|
||||||
|
|
||||||
customFieldsHelper.create(typeIndex, 'test1-multi', 'desc1', 3);
|
|
||||||
|
|
||||||
// debounce :(
|
|
||||||
await utils.notifications.success.open();
|
|
||||||
await browser.sleep(2000);
|
|
||||||
|
|
||||||
// customFieldsHelper.create(typeIndex, 'test1-date', 'desc1', 4);
|
|
||||||
|
|
||||||
// // debounce :(
|
|
||||||
// await utils.notifications.success.open();
|
|
||||||
// await browser.sleep(2000);
|
|
||||||
|
|
||||||
let countCustomFields = customFieldsHelper.getCustomFiledsByType(typeIndex).count();
|
|
||||||
|
|
||||||
expect(countCustomFields).to.be.eventually.equal(oldCountCustomFields + 2);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('edit', async function() {
|
|
||||||
customFieldsHelper.edit(typeIndex, 0, 'edit', 'desc2', 2);
|
|
||||||
|
|
||||||
expect(utils.notifications.success.open()).to.be.eventually.true;
|
|
||||||
});
|
|
||||||
|
|
||||||
it('drag', async function() {
|
|
||||||
let nameOld = await customFieldsHelper.getName(typeIndex, 0);
|
|
||||||
|
|
||||||
await customFieldsHelper.drag(typeIndex, 0, 1);
|
|
||||||
|
|
||||||
let nameNew = customFieldsHelper.getName(typeIndex, 1);
|
|
||||||
|
|
||||||
expect(nameNew).to.be.eventually.equal(nameOld);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('delete', async function() {
|
|
||||||
let oldCountCustomFields = await customFieldsHelper.getCustomFiledsByType(typeIndex).count();
|
|
||||||
|
|
||||||
customFieldsHelper.delete(typeIndex, 0);
|
|
||||||
|
|
||||||
let countCustomFields = customFieldsHelper.getCustomFiledsByType(typeIndex).count();
|
|
||||||
|
|
||||||
expect(countCustomFields).to.be.eventually.equal(oldCountCustomFields - 1);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('issues', function() {
|
|
||||||
let typeIndex = 2;
|
|
||||||
|
|
||||||
it('create', async function() {
|
|
||||||
let oldCountCustomFields = await customFieldsHelper.getCustomFiledsByType(typeIndex).count();
|
|
||||||
|
|
||||||
customFieldsHelper.create(typeIndex, 'test1-text', 'desc1', 1);
|
|
||||||
|
|
||||||
// debounce :(
|
|
||||||
await utils.notifications.success.open();
|
|
||||||
await browser.sleep(2000);
|
|
||||||
|
|
||||||
customFieldsHelper.create(typeIndex, 'test1-multi', 'desc1', 3);
|
|
||||||
|
|
||||||
// debounce :(
|
|
||||||
await utils.notifications.success.open();
|
|
||||||
await browser.sleep(2000);
|
|
||||||
|
|
||||||
// customFieldsHelper.create(typeIndex, 'test1-date', 'desc1', 4);
|
|
||||||
|
|
||||||
// // debounce :(
|
|
||||||
// await utils.notifications.success.open();
|
|
||||||
// await browser.sleep(2000);
|
|
||||||
|
|
||||||
let countCustomFields = customFieldsHelper.getCustomFiledsByType(typeIndex).count();
|
|
||||||
|
|
||||||
expect(countCustomFields).to.be.eventually.equal(oldCountCustomFields + 2);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('edit', async function() {
|
|
||||||
customFieldsHelper.edit(typeIndex, 0, 'edit', 'desc2', 2);
|
|
||||||
|
|
||||||
expect(utils.notifications.success.open()).to.be.eventually.true;
|
|
||||||
});
|
|
||||||
|
|
||||||
it('drag', async function() {
|
|
||||||
let nameOld = await customFieldsHelper.getName(typeIndex, 0);
|
|
||||||
|
|
||||||
await customFieldsHelper.drag(typeIndex, 0, 1);
|
|
||||||
|
|
||||||
let nameNew = customFieldsHelper.getName(typeIndex, 1);
|
|
||||||
|
|
||||||
expect(nameNew).to.be.eventually.equal(nameOld);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('delete', async function() {
|
|
||||||
let oldCountCustomFields = await customFieldsHelper.getCustomFiledsByType(typeIndex).count();
|
|
||||||
|
|
||||||
customFieldsHelper.delete(typeIndex, 0);
|
|
||||||
|
|
||||||
let countCustomFields = customFieldsHelper.getCustomFiledsByType(typeIndex).count();
|
|
||||||
|
|
||||||
expect(countCustomFields).to.be.eventually.equal(oldCountCustomFields - 1);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
|
@ -36,6 +36,8 @@ describe('Issue detail', async function(){
|
||||||
|
|
||||||
it('attachments', utils.detail.attachmentTesting);
|
it('attachments', utils.detail.attachmentTesting);
|
||||||
|
|
||||||
|
describe('custom-fields', utils.detail.customFields.bind(this, 2));
|
||||||
|
|
||||||
it('screenshot', async function() {
|
it('screenshot', async function() {
|
||||||
await utils.common.takeScreenshot("issues", "detail updated");
|
await utils.common.takeScreenshot("issues", "detail updated");
|
||||||
});
|
});
|
||||||
|
|
|
@ -51,6 +51,8 @@ describe('Task detail', function(){
|
||||||
|
|
||||||
it('attachments', utils.detail.attachmentTesting);
|
it('attachments', utils.detail.attachmentTesting);
|
||||||
|
|
||||||
|
describe('custom-fields', utils.detail.customFields.bind(this, 1));
|
||||||
|
|
||||||
it('screenshot', async function() {
|
it('screenshot', async function() {
|
||||||
await utils.common.takeScreenshot("tasks", "detail updated");
|
await utils.common.takeScreenshot("tasks", "detail updated");
|
||||||
});
|
});
|
||||||
|
|
|
@ -67,6 +67,8 @@ describe('User story detail', function(){
|
||||||
|
|
||||||
it('attachments', utils.detail.attachmentTesting);
|
it('attachments', utils.detail.attachmentTesting);
|
||||||
|
|
||||||
|
describe('custom-fields', utils.detail.customFields.bind(this, 0));
|
||||||
|
|
||||||
describe('related tasks', function() {
|
describe('related tasks', function() {
|
||||||
it('create', async function() {
|
it('create', async function() {
|
||||||
let oldRelatedTaskCount = await usDetailHelper.relatedTasks().count();
|
let oldRelatedTaskCount = await usDetailHelper.relatedTasks().count();
|
||||||
|
|
|
@ -100,17 +100,3 @@ helper.getGenericForm = function(form) {
|
||||||
helper.getGenericNames = function(section) {
|
helper.getGenericNames = function(section) {
|
||||||
return section.$$('.status-name span').getText();
|
return section.$$('.status-name span').getText();
|
||||||
};
|
};
|
||||||
|
|
||||||
helper.getCustomFieldsForm = function(form) {
|
|
||||||
let obj = Object.create(helper.getForm(form));
|
|
||||||
|
|
||||||
obj.name = function() {
|
|
||||||
return form.$('.custom-name input');
|
|
||||||
};
|
|
||||||
|
|
||||||
return obj;
|
|
||||||
};
|
|
||||||
|
|
||||||
helper.getCustomFieldsNames = function(section) {
|
|
||||||
return section.$$('.table-body .custom-name span').getText();
|
|
||||||
};
|
|
||||||
|
|
|
@ -45,10 +45,6 @@ helper.drag = function(indexType, indexCustomField, indexNewPosition) {
|
||||||
let customField = helper.getCustomFiledsByType(indexType).get(indexCustomField);
|
let customField = helper.getCustomFiledsByType(indexType).get(indexCustomField);
|
||||||
let newPosition = helper.getCustomFiledsByType(indexType).get(indexNewPosition).getLocation();
|
let newPosition = helper.getCustomFiledsByType(indexType).get(indexNewPosition).getLocation();
|
||||||
|
|
||||||
// await browser.actions().mouseMove(customField).perform();
|
|
||||||
|
|
||||||
// let destination = el.$$('div[tg-attachment] .attachment-settings .icon-drag-v').first();
|
|
||||||
|
|
||||||
return utils.common.drag(customField, newPosition, {y: 30});
|
return utils.common.drag(customField, newPosition, {y: 30});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -69,3 +65,7 @@ helper.delete = async function(indexType, indexCustomField) {
|
||||||
helper.getName = function(indexType, indexCustomField) {
|
helper.getName = function(indexType, indexCustomField) {
|
||||||
return helper.getCustomFiledsByType(indexType).get(indexCustomField).$('.custom-name span').getText();
|
return helper.getCustomFiledsByType(indexType).get(indexCustomField).$('.custom-name span').getText();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
helper.getDetailFields = function() {
|
||||||
|
return $$('.custom-fields-body div[tg-custom-attribute-value]');
|
||||||
|
};
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
var detailHelper = require('../helpers').detail;
|
var detailHelper = require('../helpers').detail;
|
||||||
var commonHelper = require('../helpers').common;
|
var commonHelper = require('../helpers').common;
|
||||||
|
var customFieldsHelper = require('../helpers/custom-fields-helper');
|
||||||
|
var commonUtil = require('./common');
|
||||||
|
|
||||||
var chai = require('chai');
|
var chai = require('chai');
|
||||||
var chaiAsPromised = require('chai-as-promised');
|
var chaiAsPromised = require('chai-as-promised');
|
||||||
|
@ -208,3 +210,98 @@ helper.watchersTesting = async function() {
|
||||||
newUserNames = await watchersHelper.getWatchersUserNames();
|
newUserNames = await watchersHelper.getWatchersUserNames();
|
||||||
expect(newUserNames.join()).to.be.equal('');
|
expect(newUserNames.join()).to.be.equal('');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
helper.customFields = function(typeIndex) {
|
||||||
|
before(async function() {
|
||||||
|
let url = await browser.getCurrentUrl();
|
||||||
|
|
||||||
|
browser.get('http://localhost:9001/project/project-3/admin/project-values/custom-fields');
|
||||||
|
|
||||||
|
commonUtil.waitLoader();
|
||||||
|
|
||||||
|
customFieldsHelper.create(typeIndex, 'detail-test-custom-fields-text', 'desc1', 1);
|
||||||
|
|
||||||
|
// debounce :(
|
||||||
|
browser.sleep(2000);
|
||||||
|
|
||||||
|
customFieldsHelper.create(typeIndex, 'detail-test-custom-fields-multi', 'desc1', 3);
|
||||||
|
|
||||||
|
// debounce :(
|
||||||
|
browser.sleep(2000);
|
||||||
|
|
||||||
|
browser.get(url);
|
||||||
|
commonUtil.waitLoader();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('text create', async function() {
|
||||||
|
let customFields = customFieldsHelper.getDetailFields();
|
||||||
|
let count = await customFields.count();
|
||||||
|
|
||||||
|
let textField = customFields.get(count - 2);
|
||||||
|
|
||||||
|
textField.$('input').sendKeys('test text');
|
||||||
|
textField.$('.icon-floppy').click();
|
||||||
|
|
||||||
|
// debounce
|
||||||
|
await browser.sleep(2000);
|
||||||
|
|
||||||
|
let fieldText = textField.$('.read-mode span').getText();
|
||||||
|
|
||||||
|
expect(fieldText).to.be.eventually.equal('test text');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('text edit', async function() {
|
||||||
|
let customFields = customFieldsHelper.getDetailFields();
|
||||||
|
let count = await customFields.count();
|
||||||
|
|
||||||
|
let textField = customFields.get(count - 2);
|
||||||
|
|
||||||
|
textField.$('.icon-edit').click();
|
||||||
|
|
||||||
|
textField.$('input').sendKeys('test text edit');
|
||||||
|
textField.$('.icon-floppy').click();
|
||||||
|
|
||||||
|
// debounce
|
||||||
|
await browser.sleep(2000);
|
||||||
|
|
||||||
|
let fieldText = textField.$('.read-mode span').getText();
|
||||||
|
|
||||||
|
expect(fieldText).to.be.eventually.equal('test text edit');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('multi', async function() {
|
||||||
|
let customFields = customFieldsHelper.getDetailFields();
|
||||||
|
let count = await customFields.count();
|
||||||
|
|
||||||
|
let textField = customFields.get(count - 1);
|
||||||
|
|
||||||
|
textField.$('textarea').sendKeys('test text2');
|
||||||
|
textField.$('.icon-floppy').click();
|
||||||
|
|
||||||
|
// debounce
|
||||||
|
await browser.sleep(2000);
|
||||||
|
|
||||||
|
let fieldText = textField.$('.read-mode span').getText();
|
||||||
|
|
||||||
|
expect(fieldText).to.be.eventually.equal('test text2');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('multi edit', async function() {
|
||||||
|
let customFields = customFieldsHelper.getDetailFields();
|
||||||
|
let count = await customFields.count();
|
||||||
|
|
||||||
|
let textField = customFields.get(count - 1);
|
||||||
|
|
||||||
|
textField.$('.icon-edit').click();
|
||||||
|
|
||||||
|
textField.$('textarea').sendKeys('test text2 edit');
|
||||||
|
textField.$('.icon-floppy').click();
|
||||||
|
|
||||||
|
// debounce
|
||||||
|
await browser.sleep(2000);
|
||||||
|
|
||||||
|
let fieldText = textField.$('.read-mode span').getText();
|
||||||
|
|
||||||
|
expect(fieldText).to.be.eventually.equal('test text2 edit');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
Loading…
Reference in New Issue