Skip to content

Commit

Permalink
Merge branch '2.16' into backport/backport-1507-to-2.16
Browse files Browse the repository at this point in the history
  • Loading branch information
riysaxen-amzn authored Aug 5, 2024
2 parents a030203 + 3df0788 commit 9c5dd8c
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 111 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ describe('Bucket-Level Monitors', () => {
cy.get('input[name="name"]').type(SAMPLE_EXTRACTION_QUERY_MONITOR);

// Wait for input to load and then type in the index name
cy.contains('Select clusters');
cy.get('#index').type('*{enter}', { force: true });

// Input extraction query
Expand Down Expand Up @@ -225,6 +226,7 @@ describe('Bucket-Level Monitors', () => {

// Wait for input to load and then type in the index name
// Pressing enter at the end to create combo box entry and trigger change events for time field below
cy.contains('Select clusters');
cy.get('#index').type(`${ALERTING_INDEX.SAMPLE_DATA_ECOMMERCE}{enter}`, {
force: true,
});
Expand Down Expand Up @@ -344,9 +346,7 @@ describe('Bucket-Level Monitors', () => {
cy.contains('Edit').click({ force: true });

// Wait for page to load
// The default admin user for a docker-created domain doesn't have the permissions needed to select clusters. Disabling this check when security is enabled
if (!Cypress.env('SECURITY_ENABLED'))
cy.contains('Select clusters').click({ force: true });
cy.contains('Select clusters');

// Click on the Index field and type in multiple index names to replicate the bug
cy.get('#index')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ describe('Query-Level Monitors', () => {
cy.get('input[name="name"]').type(SAMPLE_MONITOR, { force: true });

// Wait for input to load and then type in the index name
cy.contains('Select clusters');
cy.get('#index').type('*', { force: true });

// Add a trigger
Expand Down Expand Up @@ -212,9 +213,7 @@ describe('Query-Level Monitors', () => {
});

// Wait for page to load
// The default admin user for a docker-created domain doesn't have the permissions needed to select clusters. Disabling this check when security is enabled
if (!Cypress.env('SECURITY_ENABLED'))
cy.contains('Select clusters').click({ force: true });
cy.contains('Select clusters');

// Click on the Index field and type in multiple index names to replicate the bug
cy.get('#index')
Expand Down Expand Up @@ -342,9 +341,7 @@ describe('Query-Level Monitors', () => {
cy.get('[data-test-subj="visualEditorRadioCard"]').click({ force: true });

// Wait for page to load
// The default admin user for a docker-created domain doesn't have the permissions needed to select clusters. Disabling this check when security is enabled
if (!Cypress.env('SECURITY_ENABLED'))
cy.contains('Select clusters').click({ force: true });
cy.contains('Select clusters');

// Wait for input to load and then type in the index name
cy.get('#index').type(
Expand Down Expand Up @@ -482,13 +479,13 @@ describe('Query-Level Monitors', () => {
});
});

after(() => {
// Delete all existing monitors and destinations
cy.deleteAllMonitors();

// Delete sample data
cy.deleteIndexByName(`${ALERTING_INDEX.SAMPLE_DATA_ECOMMERCE}`);
cy.deleteIndexByName(TESTING_INDEX_A);
cy.deleteIndexByName(TESTING_INDEX_B);
});
// after(() => {
// // Delete all existing monitors and destinations
// cy.deleteAllMonitors();
//
// // Delete sample data
// cy.deleteIndexByName(`${ALERTING_INDEX.SAMPLE_DATA_ECOMMERCE}`);
// cy.deleteIndexByName(TESTING_INDEX_A);
// cy.deleteIndexByName(TESTING_INDEX_B);
// });
});
128 changes: 60 additions & 68 deletions cypress/integration/plugins/gantt-chart-dashboards/gantt_ui.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe('Dump test data', () => {
});
});

describe('Save a gantt chart', { defaultCommandTimeout: 20000 }, () => {
describe('Save a gantt chart', () => {
beforeEach(() => {
CURRENT_TENANT.newTenant = 'global';
cy.visit(`${BASE_PATH}/app/visualize#`);
Expand All @@ -84,58 +84,54 @@ describe('Save a gantt chart', { defaultCommandTimeout: 20000 }, () => {
});
});

describe(
'Render and configure a gantt chart',
{ defaultCommandTimeout: 20000 },
() => {
beforeEach(() => {
CURRENT_TENANT.newTenant = 'global';
cy.visit(`${BASE_PATH}/app/visualize#`);
cy.intercept('**').as('searchRequest');
cy.get('.euiFieldSearch').focus();
cy.get('.euiFieldSearch').type(GANTT_VIS_NAME);
cy.wait('@searchRequest');
cy.wait(5000);
cy.get('[data-test-subj="itemsInMemTable"]')
.contains(GANTT_VIS_NAME)
.click({
force: true,
});
});

it('Renders no data message', () => {
cy.contains('No data').should('exist');
});

it('Renders the chart', () => {
cy.get('button.euiSuperSelectControl').eq(0).click({ force: true });
cy.get('.euiContextMenuItem__text')
.contains(/^spanID$/)
.click({ force: true });
// Click away so the dropdown closes
cy.get('.euiTitle').eq(1).click();
cy.get('button.euiSuperSelectControl').eq(1).click({ force: true });
cy.get('.euiContextMenuItem__text')
.contains(/^startTime$/)
.click({ force: true });
// Click away so the dropdown closes
cy.get('.euiTitle').eq(1).click();
cy.get('button.euiSuperSelectControl').eq(2).click({ force: true });
cy.get('.euiContextMenuItem__text')
.contains(/^duration$/)
.click({ force: true });
cy.get('.euiButton__text').contains('Update').click({ force: true });

cy.get('.traces').should('have.length', DEFAULT_SIZE);
cy.get('.euiButton__text').contains('Save').click({ force: true });
cy.get('button[data-test-subj="confirmSaveSavedObjectButton"]').click({
describe('Render and configure a gantt chart', () => {
beforeEach(() => {
CURRENT_TENANT.newTenant = 'global';
cy.visit(`${BASE_PATH}/app/visualize#`);
cy.intercept('**').as('searchRequest');
cy.get('.euiFieldSearch').focus();
cy.get('.euiFieldSearch').type(GANTT_VIS_NAME);
cy.wait('@searchRequest');
cy.wait(5000);
cy.get('[data-test-subj="itemsInMemTable"]')
.contains(GANTT_VIS_NAME)
.click({
force: true,
});
});

it('Renders no data message', () => {
cy.contains('No data').should('exist');
});

it('Renders the chart', () => {
cy.get('button.euiSuperSelectControl').eq(0).click({ force: true });
cy.get('.euiContextMenuItem__text')
.contains(/^spanID$/)
.click({ force: true });
// Click away so the dropdown closes
cy.get('.euiTitle').eq(1).click();
cy.get('button.euiSuperSelectControl').eq(1).click({ force: true });
cy.get('.euiContextMenuItem__text')
.contains(/^startTime$/)
.click({ force: true });
// Click away so the dropdown closes
cy.get('.euiTitle').eq(1).click();
cy.get('button.euiSuperSelectControl').eq(2).click({ force: true });
cy.get('.euiContextMenuItem__text')
.contains(/^duration$/)
.click({ force: true });
cy.get('.euiButton__text').contains('Update').click({ force: true });

cy.get('.traces').should('have.length', DEFAULT_SIZE);
cy.get('.euiButton__text').contains('Save').click({ force: true });
cy.get('button[data-test-subj="confirmSaveSavedObjectButton"]').click({
force: true,
});
}
);
});
});

describe('Configure panel settings', { defaultCommandTimeout: 20000 }, () => {
describe('Configure panel settings', () => {
beforeEach(() => {
CURRENT_TENANT.newTenant = 'global';
cy.visit(`${BASE_PATH}/app/visualize#`);
Expand Down Expand Up @@ -256,23 +252,19 @@ describe('Configure panel settings', { defaultCommandTimeout: 20000 }, () => {
});
});

describe(
'Add gantt chart to dashboard',
{ defaultCommandTimeout: 20000 },
() => {
it('Adds gantt chart to dashboard', () => {
CURRENT_TENANT.newTenant = 'global';
cy.visit(`${BASE_PATH}/app/dashboards#/create`);
cy.contains('Add an existing').click({ force: true });
cy.get('input[data-test-subj="savedObjectFinderSearchInput"]').focus();
cy.get('input[data-test-subj="savedObjectFinderSearchInput"]').type(
GANTT_VIS_NAME
);
cy.get(`.euiListGroupItem__label[title="${GANTT_VIS_NAME}"]`).click({
force: true,
});

cy.get('g.traces').should('have.length', DEFAULT_SIZE);
describe('Add gantt chart to dashboard', () => {
it('Adds gantt chart to dashboard', () => {
CURRENT_TENANT.newTenant = 'global';
cy.visit(`${BASE_PATH}/app/dashboards#/create`);
cy.contains('Add an existing').click({ force: true });
cy.get('input[data-test-subj="savedObjectFinderSearchInput"]').focus();
cy.get('input[data-test-subj="savedObjectFinderSearchInput"]').type(
GANTT_VIS_NAME
);
cy.get(`.euiListGroupItem__label[title="${GANTT_VIS_NAME}"]`).click({
force: true,
});
}
);

cy.get('g.traces').should('have.length', DEFAULT_SIZE);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ describe('Aliases', () => {

describe('can flush an alias', () => {
it('successfully flush an index', () => {
let sample_alias = `${SAMPLE_ALIAS_PREFIX}-${1}`;
let sample_alias = `${SAMPLE_ALIAS_PREFIX}-1`;
// Sort all aliases in asc order to make it at first page
cy.contains('Alias name').click();
cy.get('[placeholder="Search..."]').type(`${sample_alias}{enter}`);
// Confirm we have our initial alias
cy.contains(sample_alias);
// index a test doc
Expand All @@ -170,28 +170,20 @@ describe('Aliases', () => {
expect(num).to.equal(1);
});

cy.get('[data-test-subj="moreAction"]').click();
// Flush btn should be disabled if no items selected
cy.get('[data-test-subj="Flush Action"]').should(
'have.class',
'euiContextMenuItem-isDisabled'
);

// Select an alias
cy.get(`[data-test-subj="checkboxSelectRow-${sample_alias}"]`).check({
force: true,
});

cy.get('[data-test-subj="moreAction"]').click();

// Extra wait required for page data to load, otherwise "Enable" button will be disabled
cy.wait(2000);
cy.get('[data-test-subj="moreAction"] button')
.click()
.get('[data-test-subj="Flush Action"]')
.should('be.disabled')
.end();

// Flush btn should be enabled
cy.get('[data-test-subj="Flush Action"]')
.should('exist')
.should('not.have.class', 'euiContextMenuItem-isDisabled')
.click();
cy.get(`#_selection_column_${sample_alias}-checkbox`)
.click()
.get('[data-test-subj="moreAction"] button')
.click()
.get('[data-test-subj="Flush Action"]')
.should('not.be.disabled')
.click()
.end();

// Check for flush index modal
cy.contains('Flush alias');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ describe('Test delete senders', () => {
force: true,
});
cy.wait(NOTIFICATIONS_DELAY);
cy.get('input[placeholder="delete"]').should('be.visible').type('delete')
cy.get('input[placeholder="delete"]').should('be.visible').type('delete');
cy.wait(NOTIFICATIONS_DELAY);
cy.get('[data-test-subj="delete-sender-modal-delete-button"]').click({
force: true,
Expand All @@ -188,7 +188,7 @@ describe('Test delete senders', () => {
force: true,
});
cy.wait(NOTIFICATIONS_DELAY);
cy.get('input[placeholder="delete"]').should('be.visible').type('delete')
cy.get('input[placeholder="delete"]').should('be.visible').type('delete');
cy.wait(NOTIFICATIONS_DELAY);
cy.get('[data-test-subj="delete-sender-modal-delete-button"]').click({
force: true,
Expand Down

0 comments on commit 9c5dd8c

Please sign in to comment.