fix admin e2e

stable
Juanfran 2016-01-25 09:04:27 +01:00
parent 4a32076edd
commit 905c5a61cb
8 changed files with 26 additions and 17 deletions

View File

@ -100,3 +100,9 @@ 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.waitLoad = function() {
return browser.wait(function() {
return $('.admin-attributes').isPresent();
}, 5000);
};

View File

@ -55,11 +55,12 @@ helper.getCustomFiledsByType = function(indexType) {
helper.delete = async function(indexType, indexCustomField) { helper.delete = async function(indexType, indexCustomField) {
let customField = helper.getCustomFiledsByType(indexType).get(indexCustomField); let customField = helper.getCustomFiledsByType(indexType).get(indexCustomField);
let count = await helper.getCustomFiledsByType(indexType).count(); browser.actions()
.mouseMove(customField.$('.js-delete-custom-field-button'))
.click()
.perform();
customField.$('.js-delete-custom-field-button').click(); return utils.lightbox.confirm.ok();
utils.lightbox.confirm.ok();
}; };
helper.getName = function(indexType, indexCustomField) { helper.getName = function(indexType, indexCustomField) {

View File

@ -64,9 +64,9 @@ describe('custom-fields', function() {
it('delete', async function() { it('delete', async function() {
let oldCountCustomFields = await customFieldsHelper.getCustomFiledsByType(typeIndex).count(); let oldCountCustomFields = await customFieldsHelper.getCustomFiledsByType(typeIndex).count();
customFieldsHelper.delete(typeIndex, 0); await customFieldsHelper.delete(typeIndex, 0);
browser.wait(async function() { await browser.wait(async function() {
let countCustomFields = await customFieldsHelper.getCustomFiledsByType(typeIndex).count(); let countCustomFields = await customFieldsHelper.getCustomFiledsByType(typeIndex).count();
return countCustomFields === oldCountCustomFields - 1; return countCustomFields === oldCountCustomFields - 1;
@ -84,13 +84,13 @@ describe('custom-fields', function() {
// debounce :( // debounce :(
await utils.notifications.success.open(); await utils.notifications.success.open();
await browser.sleep(2000); await browser.sleep(2500);
customFieldsHelper.create(typeIndex, 'test1-multi', 'desc1', 3); customFieldsHelper.create(typeIndex, 'test1-multi', 'desc1', 3);
// debounce :( // debounce :(
await utils.notifications.success.open(); await utils.notifications.success.open();
await browser.sleep(2000); await browser.sleep(2500);
// customFieldsHelper.create(typeIndex, 'test1-date', 'desc1', 4); // customFieldsHelper.create(typeIndex, 'test1-date', 'desc1', 4);
@ -122,9 +122,9 @@ describe('custom-fields', function() {
it('delete', async function() { it('delete', async function() {
let oldCountCustomFields = await customFieldsHelper.getCustomFiledsByType(typeIndex).count(); let oldCountCustomFields = await customFieldsHelper.getCustomFiledsByType(typeIndex).count();
customFieldsHelper.delete(typeIndex, 0); await customFieldsHelper.delete(typeIndex, 0);
browser.wait(async function() { await browser.wait(async function() {
let countCustomFields = await customFieldsHelper.getCustomFiledsByType(typeIndex).count(); let countCustomFields = await customFieldsHelper.getCustomFiledsByType(typeIndex).count();
return countCustomFields === oldCountCustomFields - 1; return countCustomFields === oldCountCustomFields - 1;
@ -180,9 +180,9 @@ describe('custom-fields', function() {
it('delete', async function() { it('delete', async function() {
let oldCountCustomFields = await customFieldsHelper.getCustomFiledsByType(typeIndex).count(); let oldCountCustomFields = await customFieldsHelper.getCustomFiledsByType(typeIndex).count();
customFieldsHelper.delete(typeIndex, 0); await customFieldsHelper.delete(typeIndex, 0);
browser.wait(async function() { await browser.wait(async function() {
let countCustomFields = await customFieldsHelper.getCustomFiledsByType(typeIndex).count(); let countCustomFields = await customFieldsHelper.getCustomFiledsByType(typeIndex).count();
return countCustomFields === oldCountCustomFields - 1; return countCustomFields === oldCountCustomFields - 1;

View File

@ -12,7 +12,7 @@ describe('attributes - priorities', function() {
before(async function(){ before(async function(){
browser.get(browser.params.glob.host + 'project/project-0/admin/project-values/priorities'); browser.get(browser.params.glob.host + 'project/project-0/admin/project-values/priorities');
await utils.common.waitLoader(); await adminAttributesHelper.waitLoad();
utils.common.takeScreenshot('attributes', 'priorities'); utils.common.takeScreenshot('attributes', 'priorities');
}); });

View File

@ -12,7 +12,7 @@ describe('attributes - severities', function() {
before(async function(){ before(async function(){
browser.get(browser.params.glob.host + 'project/project-0/admin/project-values/severities'); browser.get(browser.params.glob.host + 'project/project-0/admin/project-values/severities');
await utils.common.waitLoader(); await adminAttributesHelper.waitLoad();
utils.common.takeScreenshot('attributes', 'severities'); utils.common.takeScreenshot('attributes', 'severities');
}); });

View File

@ -12,7 +12,7 @@ describe('attributes - status', function() {
before(async function(){ before(async function(){
browser.get(browser.params.glob.host + 'project/project-0/admin/project-values/status'); browser.get(browser.params.glob.host + 'project/project-0/admin/project-values/status');
await utils.common.waitLoader(); await adminAttributesHelper.waitLoad();
utils.common.takeScreenshot('attributes', 'status'); utils.common.takeScreenshot('attributes', 'status');
}); });

View File

@ -12,7 +12,7 @@ describe('attributes - types', function() {
before(async function(){ before(async function(){
browser.get(browser.params.glob.host + 'project/project-0/admin/project-values/types'); browser.get(browser.params.glob.host + 'project/project-0/admin/project-values/types');
await utils.common.waitLoader(); await adminAttributesHelper.waitLoad();
utils.common.takeScreenshot('attributes', 'types'); utils.common.takeScreenshot('attributes', 'types');
}); });

View File

@ -55,7 +55,9 @@ describe('create-delete project', function() {
let linkAdmin = $('#nav-admin a'); let linkAdmin = $('#nav-admin a');
utils.common.link(linkAdmin); utils.common.link(linkAdmin);
await utils.common.waitLoader(); browser.wait(function() {
return $('.project-details').isPresent();
});
await createProject.delete(); await createProject.delete();
await browser.waitForAngular(); await browser.waitForAngular();