diff --git a/app/partials/includes/modules/admin/admin-custom-attributes.jade b/app/partials/includes/modules/admin/admin-custom-attributes.jade index 123d39ce..847a4133 100644 --- a/app/partials/includes/modules/admin/admin-custom-attributes.jade +++ b/app/partials/includes/modules/admin/admin-custom-attributes.jade @@ -16,7 +16,7 @@ section.custom-fields-table.basic-table .table-body .js-sortable - div( + .e2e-item( ng-repeat="attr in customAttributes track by attr.id" tg-bind-scope ) diff --git a/app/partials/includes/modules/admin/project-tags.jade b/app/partials/includes/modules/admin/project-tags.jade index 83b6fc78..dd339453 100644 --- a/app/partials/includes/modules/admin/project-tags.jade +++ b/app/partials/includes/modules/admin/project-tags.jade @@ -72,7 +72,7 @@ section ) p(translate="ADMIN.PROJECT_VALUES_TAGS.EMPTY_SEARCH") - div( + div.e2e-tag-row( ng-repeat="tag in projectTags" tg-bind-scope ) diff --git a/e2e/helpers/admin-attributes-helper.js b/e2e/helpers/admin-attributes-helper.js index fc485b94..b3bedf2d 100644 --- a/e2e/helpers/admin-attributes-helper.js +++ b/e2e/helpers/admin-attributes-helper.js @@ -40,7 +40,15 @@ helper.getTagsSection = function(item) { return { el: section, rows: function() { - return section.$$('.table-main'); + return section.$$('.e2e-tag-row'); + }, + edit: async function(row) { + let editButton = row.$('.edit-value'); + + return browser.actions() + .mouseMove(editButton) + .click() + .perform(); } }; }; @@ -48,7 +56,7 @@ helper.getTagsSection = function(item) { helper.getTagsFilter = function() { return $('.table-header .e2e-tags-filter'); -} +}; helper.getStatusNames = function(section) { return section.$$('.status-name span').getText(); @@ -111,12 +119,12 @@ helper.getGenericForm = function(form) { }; obj.colorBox = function() { - return form.$('.edition .current-color'); - } + return form.$('.edition .e2e-open-color-selector'); + }; obj.colorText = function() { - return form.$('.select-color input'); - } + return form.$('.color-selector-dropdown input'); + }; return obj; }; diff --git a/e2e/helpers/custom-fields-helper.js b/e2e/helpers/custom-fields-helper.js index 19bef257..837ac956 100644 --- a/e2e/helpers/custom-fields-helper.js +++ b/e2e/helpers/custom-fields-helper.js @@ -47,11 +47,11 @@ helper.drag = function(indexType, indexCustomField, indexNewPosition) { let customField = helper.getCustomFiledsByType(indexType).get(indexCustomField).$('.e2e-drag'); let newPosition = helper.getCustomFiledsByType(indexType).get(indexNewPosition); - return utils.common.drag(customField, newPosition, 0, 40); + return utils.common.drag(customField, newPosition, 5, 25); }; helper.getCustomFiledsByType = function(indexType) { - return $$('div[tg-project-custom-attributes]').get(indexType).$$('.js-sortable > div'); + return $$('div[tg-project-custom-attributes]').get(indexType).$$('.e2e-item'); }; helper.delete = async function(indexType, indexCustomField) { diff --git a/e2e/helpers/project-detail-helper.js b/e2e/helpers/project-detail-helper.js index efc676f5..88f2c81a 100644 --- a/e2e/helpers/project-detail-helper.js +++ b/e2e/helpers/project-detail-helper.js @@ -58,11 +58,14 @@ helper.getChangeOwnerLb = function() { return utils.lightbox.close(el); }, search: function(q) { - el.$$('input').get(0).sendKeys(q); + return el.$$('input').get(0).sendKeys(q); }, select: function(index) { el.$$('.user-list-single').get(index).click(); }, + getUserName: function(index) { + return el.$$('.user-list-single').get(index).$('.user-list-name').getText(); + }, addComment: function(text) { el.$('.add-comment a').click(); el.$('textarea').sendKeys(text); @@ -74,3 +77,7 @@ helper.getChangeOwnerLb = function() { return obj; }; + +helper.enableAddTags = function() { + $('.add-tag-button').click(); +}; diff --git a/e2e/suites/admin/attributes/tags.e2e.js b/e2e/suites/admin/attributes/tags.e2e.js index a4b6010e..403591fd 100644 --- a/e2e/suites/admin/attributes/tags.e2e.js +++ b/e2e/suites/admin/attributes/tags.e2e.js @@ -22,7 +22,9 @@ describe('attributes - tags', function() { let rows = section.rows(); let row = rows.get(0); - let form = adminAttributesHelper.getGenericForm(row.$('form')); + section.edit(row); + + let form = adminAttributesHelper.getGenericForm(row.$$('form').first()); var colorBox = form.colorBox(); await colorBox.click(); @@ -35,7 +37,7 @@ describe('attributes - tags', function() { section = adminAttributesHelper.getTagsSection(0); rows = section.rows(); row = rows.get(0); - let backgroundColor = await row.$$('.edition .current-color').get(0).getCssValue('background-color'); + let backgroundColor = await row.$$('.e2e-open-color-selector').get(0).getCssValue('background-color'); expect(backgroundColor).to.be.equal('rgba(0, 0, 0, 1)'); utils.common.takeScreenshot('attributes', 'tag edited is black'); }); @@ -44,12 +46,11 @@ describe('attributes - tags', function() { let tagsFilter = adminAttributesHelper.getTagsFilter(); await tagsFilter.clear(); await tagsFilter.sendKeys('ad'); + await browser.sleep(5000); let section = adminAttributesHelper.getTagsSection(0); let rows = section.rows(); let count = await rows.count(); expect(count).to.be.equal(2); }); - - }); diff --git a/e2e/suites/admin/project/modules.e2e.js b/e2e/suites/admin/project/modules.e2e.js index 7ad0e361..5c85e3a8 100644 --- a/e2e/suites/admin/project/modules.e2e.js +++ b/e2e/suites/admin/project/modules.e2e.js @@ -78,7 +78,7 @@ describe('modules', function() { }); it('enable videoconference', async function() { - let functionality = $$('.module').get(4); + let functionality = $$('.module').get(5); let input = functionality.$('.check input'); diff --git a/e2e/suites/admin/project/project-detail.e2e.js b/e2e/suites/admin/project/project-detail.e2e.js index e3c15366..033015a4 100644 --- a/e2e/suites/admin/project/project-detail.e2e.js +++ b/e2e/suites/admin/project/project-detail.e2e.js @@ -18,7 +18,9 @@ describe('project detail', function() { }); it('edit tag, description and project settings', async function() { - let tag = $('.tag-input'); + adminHelper.enableAddTags(); + + let tag = $('.e2e-add-tag-input'); tag.sendKeys('aaa'); browser.actions().sendKeys(protractor.Key.ENTER).perform(); @@ -105,7 +107,10 @@ describe('project detail', function() { await lb.waitOpen(); - lb.search('Alicia Flores'); + let username = lb.getUserName(0); + + await lb.search(username); + lb.select(0); lb.addComment('text');