From 69ecb48f2385cdcb6160b20d3ac9f6c9db06154b Mon Sep 17 00:00:00 2001 From: sviatlana-stsiapanava Date: Wed, 22 Jan 2025 19:28:15 +0500 Subject: [PATCH] Add scrolling functionality to handle long result lists in data export profiles --- cypress/support/fragments/bulk-edit/query-modal.js | 3 ++- .../data-export/exportJobProfile/exportJobProfiles.js | 5 +++++ .../exportMappingProfile/exportFieldMappingProfiles.js | 3 +++ .../exportMappingProfile/singleFieldMappingProfilePane.js | 2 ++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/cypress/support/fragments/bulk-edit/query-modal.js b/cypress/support/fragments/bulk-edit/query-modal.js index 9e7f316c76..4d02858e39 100644 --- a/cypress/support/fragments/bulk-edit/query-modal.js +++ b/cypress/support/fragments/bulk-edit/query-modal.js @@ -325,7 +325,8 @@ export default { cy.wrap($element) .invoke('text') .then((text) => { - const [totalRecords, previewRecords] = text.match(/\d+/g).map(Number); + const totalRecords = text.match(/\d{1,3}(,\d{3})*|\d+/g)[0]; + const previewRecords = Number(text.match(/\d{1,3}(,\d{3})*|\d+/g)[1]); const previewLabel = `Preview of first ${Math.min(previewRecords, 100)} records.`; expect(text.startsWith(`Query would return ${totalRecords} records.`)).to.equal(true); expect(previewLabel).to.equal( diff --git a/cypress/support/fragments/data-export/exportJobProfile/exportJobProfiles.js b/cypress/support/fragments/data-export/exportJobProfile/exportJobProfiles.js index 6dbf69c58f..85e9f14b3f 100644 --- a/cypress/support/fragments/data-export/exportJobProfile/exportJobProfiles.js +++ b/cypress/support/fragments/data-export/exportJobProfile/exportJobProfiles.js @@ -41,6 +41,9 @@ export default { }, verifyJobProfileInTheTable(jobProfileName) { + cy.wait(2000); + // Scroll in case the list of results is long + cy.get('#search-results-list [class^=mclScrollable]').scrollTo('bottom'); cy.expect(jobProfilesPane.find(MultiColumnListCell({ content: `${jobProfileName}` }))); }, @@ -61,6 +64,8 @@ export default { }, clickProfileNameFromTheList(name) { + // Scroll in case the list of results is long + cy.get('#search-results-list [class^=mclScrollable]').scrollTo('bottom'); cy.do(MultiColumnListCell(including(name)).click()); }, diff --git a/cypress/support/fragments/data-export/exportMappingProfile/exportFieldMappingProfiles.js b/cypress/support/fragments/data-export/exportMappingProfile/exportFieldMappingProfiles.js index f9ff009845..c8706d8ef5 100644 --- a/cypress/support/fragments/data-export/exportMappingProfile/exportFieldMappingProfiles.js +++ b/cypress/support/fragments/data-export/exportMappingProfile/exportFieldMappingProfiles.js @@ -151,6 +151,9 @@ export default { }, verifyProfileNameOnTheList(name) { + cy.wait(2000); + // Scroll in case the list of results is long + cy.get('#search-results-list [class^=mclScrollable]').scrollTo('bottom'); cy.expect(MultiColumnListRow(including(name)).exists()); }, diff --git a/cypress/support/fragments/data-export/exportMappingProfile/singleFieldMappingProfilePane.js b/cypress/support/fragments/data-export/exportMappingProfile/singleFieldMappingProfilePane.js index 0d6b8db570..c67bbf26eb 100644 --- a/cypress/support/fragments/data-export/exportMappingProfile/singleFieldMappingProfilePane.js +++ b/cypress/support/fragments/data-export/exportMappingProfile/singleFieldMappingProfilePane.js @@ -22,6 +22,8 @@ const cancelButton = Button('Cancel'); export default { clickProfileNameFromTheList(name) { + // Scroll in case the list of results is long + cy.get('#search-results-list [class^=mclScrollable]').scrollTo('bottom'); cy.do(MultiColumnListCell(including(name)).click()); },