From 67b7a85078c8958f5411d546d8f924ef3a61c927 Mon Sep 17 00:00:00 2001 From: Dipak Acharya Date: Fri, 16 Apr 2021 14:08:28 +0545 Subject: [PATCH 1/2] debug failing tests --- .drone.star | 3 +-- tests/acceptance/pageObjects/FilesPageElement/filesList.js | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.drone.star b/.drone.star index b6c2ea46706..acd01076f85 100644 --- a/.drone.star +++ b/.drone.star @@ -242,7 +242,7 @@ config = { 'webUITags', 'webUIWebdavLockProtection', 'webUIWebdavLocks', - ], + ], 'iPhone2': [ 'webUIMoveFilesFolders', 'webUIResharing1', @@ -272,7 +272,6 @@ config = { 'webUISharingInternalUsersToRootSharingIndicator', 'webUISharingInternalUsersExpireToRoot', 'webUISharingInternalUsersToRoot', - 'webUISharingInternalUsersToRootBlacklisted', 'webUISharingPermissionsUsers', 'webUISharingPermissionToRoot', 'webUISharingPublicBasic', diff --git a/tests/acceptance/pageObjects/FilesPageElement/filesList.js b/tests/acceptance/pageObjects/FilesPageElement/filesList.js index 37c8299db1e..e7d812e431a 100644 --- a/tests/acceptance/pageObjects/FilesPageElement/filesList.js +++ b/tests/acceptance/pageObjects/FilesPageElement/filesList.js @@ -453,8 +453,10 @@ module.exports = { this.elements.shareIndicatorsInFileRow.locateStrategy, shareIndicatorsXpath, result => { + console.log(result) result.value.forEach(element => { this.api.elementIdAttribute(element.ELEMENT, 'class', attr => { + console.log(attr) if (attr.value.indexOf('uk-invisible') >= 0) { return } From 4005761ee12fa04d6d2935ae2d2da02b6ccb03b7 Mon Sep 17 00:00:00 2001 From: Dipak Acharya Date: Fri, 16 Apr 2021 16:02:35 +0545 Subject: [PATCH 2/2] Add retry for share indicators --- .drone.star | 3 +- .../pageObjects/FilesPageElement/filesList.js | 29 +++++++++++++++++-- .../stepDefinitions/filesContext.js | 2 +- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/.drone.star b/.drone.star index acd01076f85..b6c2ea46706 100644 --- a/.drone.star +++ b/.drone.star @@ -242,7 +242,7 @@ config = { 'webUITags', 'webUIWebdavLockProtection', 'webUIWebdavLocks', - ], + ], 'iPhone2': [ 'webUIMoveFilesFolders', 'webUIResharing1', @@ -272,6 +272,7 @@ config = { 'webUISharingInternalUsersToRootSharingIndicator', 'webUISharingInternalUsersExpireToRoot', 'webUISharingInternalUsersToRoot', + 'webUISharingInternalUsersToRootBlacklisted', 'webUISharingPermissionsUsers', 'webUISharingPermissionToRoot', 'webUISharingPublicBasic', diff --git a/tests/acceptance/pageObjects/FilesPageElement/filesList.js b/tests/acceptance/pageObjects/FilesPageElement/filesList.js index e7d812e431a..d941440cd2e 100644 --- a/tests/acceptance/pageObjects/FilesPageElement/filesList.js +++ b/tests/acceptance/pageObjects/FilesPageElement/filesList.js @@ -453,10 +453,11 @@ module.exports = { this.elements.shareIndicatorsInFileRow.locateStrategy, shareIndicatorsXpath, result => { - console.log(result) result.value.forEach(element => { this.api.elementIdAttribute(element.ELEMENT, 'class', attr => { - console.log(attr) + if (parseInt(attr.status) < 0) { + return + } if (attr.value.indexOf('uk-invisible') >= 0) { return } @@ -485,6 +486,30 @@ module.exports = { return indicators }, + /** + * + * @param {string} fileName + * @param {boolean} sharingIndicatorExpectedToBeVisible + * @returns {Array} array of sharing indicator + */ + getShareIndicatorsForResourceWithRetry: async function( + fileName, + sharingIndicatorExpectedToBeVisible + ) { + let indicators = await this.getShareIndicatorsForResource( + fileName, + sharingIndicatorExpectedToBeVisible + ) + if (!indicators.length) { + console.log('Share indicators not found on first try, Retrying again') + indicators = await this.getShareIndicatorsForResource( + fileName, + sharingIndicatorExpectedToBeVisible + ) + } + return indicators + }, + setSort: async function(column, isDesc = false) { const columnSelector = util.format( this.elements.filesTableHeaderColumn.selector, diff --git a/tests/acceptance/stepDefinitions/filesContext.js b/tests/acceptance/stepDefinitions/filesContext.js index ad8afa1f8d5..a73a4eacb17 100644 --- a/tests/acceptance/stepDefinitions/filesContext.js +++ b/tests/acceptance/stepDefinitions/filesContext.js @@ -1110,7 +1110,7 @@ Then('the following resources should have share indicators on the webUI', async dataTable ) { for (const { fileName, expectedIndicators } of dataTable.hashes()) { - const indicatorsArray = await client.page.FilesPageElement.filesList().getShareIndicatorsForResource( + const indicatorsArray = await client.page.FilesPageElement.filesList().getShareIndicatorsForResourceWithRetry( fileName, true )