From a97f39339d5da0383b192b2d3b2b30adfb865af9 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 18 Sep 2024 18:06:37 +0800 Subject: [PATCH] updated tests (#1553) (#1554) Signed-off-by: Amardeepsingh Siglani (cherry picked from commit 510f5c6e536e55e2c45e5b99130d1e74bf15ff77) Co-authored-by: Amardeepsingh Siglani --- .../1_detectors.spec.js | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/cypress/integration/plugins/security-analytics-dashboards-plugin/1_detectors.spec.js b/cypress/integration/plugins/security-analytics-dashboards-plugin/1_detectors.spec.js index f9f59e561..294a80011 100644 --- a/cypress/integration/plugins/security-analytics-dashboards-plugin/1_detectors.spec.js +++ b/cypress/integration/plugins/security-analytics-dashboards-plugin/1_detectors.spec.js @@ -34,7 +34,7 @@ const getCreateDetectorButton = () => cy.sa_getButtonByText('Create detector'); const validateAlertPanel = (alertName) => cy - .sa_getElementByText('.euiTitle', 'Alert triggers') + .sa_getElementByText('.euiText', 'Alert triggers') .parentsUntil('.euiPanel') .siblings() .eq(2) @@ -98,9 +98,9 @@ const validateFieldMappingsTable = (message = '') => { const editDetectorDetails = (detectorName, panelTitle) => { cy.sa_urlShouldContain('detector-details').then(() => { - cy.sa_getElementByText('.euiTitle', detectorName); - cy.sa_getElementByText('.euiPanel .euiTitle', panelTitle); - cy.sa_getElementByText('.euiPanel .euiTitle', panelTitle) + cy.sa_getElementByText('.euiText', detectorName); + cy.sa_getElementByText('.euiPanel .euiText', panelTitle); + cy.sa_getElementByText('.euiPanel .euiText', panelTitle) .parent() .siblings() .within(() => cy.get('button').contains('Edit').click()); @@ -128,7 +128,7 @@ const validateAutomaticFieldMappingsPanel = (mappings) => const validatePendingFieldMappingsPanel = (mappings) => { cy.get('.editFieldMappings').within(() => { // Pending field mappings - cy.sa_getElementByText('.euiTitle', 'Pending field mappings') + cy.sa_getElementByText('.euiText', 'Pending field mappings') .parents('.euiPanel') .within(() => { cy.sa_getElementByTestSubject('pending-mapped-fields-table') @@ -143,7 +143,7 @@ const fillDetailsForm = ( dataSource, isCustomDataSource = false ) => { - getNameField().type(detectorName); + getNameField().type(detectorName, { force: true }); if (isCustomDataSource) { getDataSourceField() @@ -210,7 +210,7 @@ const createDetector = (detectorName, dataSource, expectFailure) => { .should('contain', detectorId) .then(() => { // Confirm detector state - cy.sa_getElementByText('.euiTitle', detectorName); + cy.sa_getElementByText('.euiText', detectorName); cy.sa_getElementByText('.euiHealth', 'Active').then(() => { cy.sa_validateDetailsItem('Detector name', detectorName); cy.sa_validateDetailsItem('Description', '-'); @@ -478,7 +478,7 @@ describe('Detectors', () => { openDetectorDetails(detectorName); editDetectorDetails(detectorName, 'Active rules'); - cy.sa_getElementByText('.euiTitle', 'Detection rules (14)'); + cy.sa_getElementByText('.euiText', 'Detection rules (14)'); cy.sa_getInputByPlaceholder('Search...') .type(`${cypressDNSRule}`) @@ -490,11 +490,11 @@ describe('Detectors', () => { .find('.euiTableCellContent button') .click(); - cy.sa_getElementByText('.euiTitle', 'Detection rules (13)'); + cy.sa_getElementByText('.euiText', 'Detection rules (13)'); cy.sa_getElementByText('button', 'Save changes').click({ force: true }); cy.sa_urlShouldContain('detector-details').then(() => { - cy.sa_getElementByText('.euiTitle', detectorName); - cy.sa_getElementByText('.euiPanel .euiTitle', 'Active rules (13)'); + cy.sa_getElementByText('.euiText', detectorName); + cy.sa_getElementByText('.euiPanel .euiText', 'Active rules (13)'); }); });