From 1228b5922a86f71b80837f1361f64227bdfbe6ab Mon Sep 17 00:00:00 2001 From: Jonathan Niles Date: Fri, 28 Jun 2019 11:46:25 +0100 Subject: [PATCH] fix: flaky role management test Wait for checkbox in modal to be clickable before blindly clicking it. Closes #3765 --- test/end-to-end/user/roles.page.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/end-to-end/user/roles.page.js b/test/end-to-end/user/roles.page.js index 8b6c6a2072..a0802275d4 100644 --- a/test/end-to-end/user/roles.page.js +++ b/test/end-to-end/user/roles.page.js @@ -1,4 +1,5 @@ -/* global by, element */ +/* global element, by, browser */ +const EC = require('protractor').ExpectedConditions; const FU = require('../shared/FormUtils'); const GridRow = require('../shared/GridRow'); @@ -38,8 +39,10 @@ class RolesPage { await row.menu.$('[data-method="edit-permissions"]').click(); } - checkAllPerimission() { - return this.checkAll.click(); + async checkAllPerimission() { + const checkbox = this.checkAll; + await browser.wait(EC.elementToBeClickable(checkbox), 1500); + await checkbox.click(); } async assignRole(name) {