From 5881c7dac58929f4be68ab82e5ed107407e80190 Mon Sep 17 00:00:00 2001 From: Saturnino Abril Date: Thu, 15 Jun 2023 14:19:38 +0800 Subject: [PATCH] fix e2e about compliance test (#23742) --- .../compliance/compliance_export_multiple_post_spec.js | 4 ++++ .../system_console/compliance/compliance_export_ui_spec.js | 4 ++++ .../system_console/compliance/s3_bucket_storage_spec.js | 4 ++++ e2e-tests/cypress/tests/support/ui/compliance_export.js | 7 ++++++- 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/e2e-tests/cypress/tests/integration/channels/enterprise/system_console/compliance/compliance_export_multiple_post_spec.js b/e2e-tests/cypress/tests/integration/channels/enterprise/system_console/compliance/compliance_export_multiple_post_spec.js index 375e9d1b33..d2ebe8eaf4 100644 --- a/e2e-tests/cypress/tests/integration/channels/enterprise/system_console/compliance/compliance_export_multiple_post_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/enterprise/system_console/compliance/compliance_export_multiple_post_spec.js @@ -31,6 +31,10 @@ describe('Compliance Export', () => { teamName = team.name; }); + // # Visit a channel and post a message so it has something to be exported initially + cy.visit('/'); + cy.postMessage('hello'); + // # Go to compliance page, enable export and do initial export cy.uiGoToCompliancePage(); cy.uiEnableComplianceExport(); diff --git a/e2e-tests/cypress/tests/integration/channels/enterprise/system_console/compliance/compliance_export_ui_spec.js b/e2e-tests/cypress/tests/integration/channels/enterprise/system_console/compliance/compliance_export_ui_spec.js index d8e69a77fb..04585b0fcc 100644 --- a/e2e-tests/cypress/tests/integration/channels/enterprise/system_console/compliance/compliance_export_ui_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/enterprise/system_console/compliance/compliance_export_ui_spec.js @@ -33,6 +33,10 @@ describe('Compliance Export', () => { teamName = team.name; }); + // # Visit a channel and post a message so it has something to be exported initially + cy.visit('/'); + cy.postMessage('hello'); + // # Go to compliance page, enable export and do initial export cy.uiGoToCompliancePage(); cy.uiEnableComplianceExport(); diff --git a/e2e-tests/cypress/tests/integration/channels/enterprise/system_console/compliance/s3_bucket_storage_spec.js b/e2e-tests/cypress/tests/integration/channels/enterprise/system_console/compliance/s3_bucket_storage_spec.js index 1a8ae24e8c..00cf58fb75 100644 --- a/e2e-tests/cypress/tests/integration/channels/enterprise/system_console/compliance/s3_bucket_storage_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/enterprise/system_console/compliance/s3_bucket_storage_spec.js @@ -37,6 +37,10 @@ describe('Compliance Export', () => { teamName = team.name; }); + // # Visit a channel and post a message so it has something to be exported initially + cy.visit('/'); + cy.postMessage('hello'); + // # Go to compliance page, enable export and do export cy.uiGoToCompliancePage(); cy.uiEnableComplianceExport(); diff --git a/e2e-tests/cypress/tests/support/ui/compliance_export.js b/e2e-tests/cypress/tests/support/ui/compliance_export.js index f1d58a32a7..f566dc4257 100644 --- a/e2e-tests/cypress/tests/support/ui/compliance_export.js +++ b/e2e-tests/cypress/tests/support/ui/compliance_export.js @@ -4,12 +4,17 @@ import * as TIMEOUTS from '../../fixtures/timeouts'; Cypress.Commands.add('uiEnableComplianceExport', (exportFormat = 'csv') => { + // * Verify that the page is loaded + cy.findByText('Enable Compliance Export:').should('be.visible'); + cy.findByText('Compliance Export time:').should('be.visible'); + cy.findByText('Export Format:').should('be.visible'); + // # Enable compliance export cy.findByRole('radio', {name: /false/i}).click(); cy.findByRole('radio', {name: /true/i}).click(); // # Change export format - cy.findByRole('combobox', {name: /export format:/i}).select(exportFormat); + cy.findByTestId('exportFormatdropdown').should('be.visible').select(exportFormat); // # Save settings cy.uiSaveConfig({confirm: true});