Skip to content

Commit

Permalink
updated tests (#1553) (#1554)
Browse files Browse the repository at this point in the history
Signed-off-by: Amardeepsingh Siglani <[email protected]>
(cherry picked from commit 510f5c6)

Co-authored-by: Amardeepsingh Siglani <[email protected]>
  • Loading branch information
opensearch-trigger-bot[bot] and amsiglan authored Sep 18, 2024
1 parent c0afee7 commit a97f393
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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')
Expand All @@ -143,7 +143,7 @@ const fillDetailsForm = (
dataSource,
isCustomDataSource = false
) => {
getNameField().type(detectorName);
getNameField().type(detectorName, { force: true });

if (isCustomDataSource) {
getDataSourceField()
Expand Down Expand Up @@ -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', '-');
Expand Down Expand Up @@ -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}`)
Expand All @@ -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)');
});
});

Expand Down

0 comments on commit a97f393

Please sign in to comment.