Skip to content

Commit

Permalink
Reordering rollup and transform tests as after deleting and testing e…
Browse files Browse the repository at this point in the history
…nable/disable feature creating flakiness in tests (#1513)

Signed-off-by: Nishant Goel <[email protected]>
(cherry picked from commit 38b9638)
  • Loading branch information
nisgoel-amazon authored and github-actions[bot] committed Aug 6, 2024
1 parent 09bf9ce commit 4390053
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,42 +210,6 @@ describe('Rollups', () => {
});
});

describe('can be deleted', () => {
before(() => {
cy.deleteAllIndices();
cy.deleteIMJobs();
cy.createRollup(ROLLUP_ID, sampleRollup);
});

it('successfully', () => {
// Confirm we have our initial rollup
cy.contains(ROLLUP_ID);

// Select checkbox for our rollup job
cy.get(`#_selection_column_${ROLLUP_ID}-checkbox`).check({ force: true });

// Click on Actions popover menu
cy.get(`[data-test-subj="actionButton"]`).click({ force: true });

// Click Delete button
cy.get(`[data-test-subj="deleteButton"]`).click({ force: true });

// Type "delete" to confirm deletion
cy.get(`input[placeholder="delete"]`).type('delete', { force: true });

// Click the delete confirmation button in modal
cy.get(`[data-test-subj="confirmModalConfirmButton"]`).click();

// Confirm we got deleted toaster
cy.contains(`"${ROLLUP_ID}" successfully deleted!`);

// Confirm showing empty loading state
cy.contains(
'Rollup jobs help you conserve storage space for historical time series data while preserving the specific information you need'
);
});
});

describe('can be enabled and disabled', () => {
before(() => {
cy.deleteAllIndices();
Expand Down Expand Up @@ -293,4 +257,40 @@ describe('Rollups', () => {
cy.contains(`${ROLLUP_ID} is enabled`);
});
});

describe('can be deleted', () => {
before(() => {
cy.deleteAllIndices();
cy.deleteIMJobs();
cy.createRollup(ROLLUP_ID, sampleRollup);
});

it('successfully', () => {
// Confirm we have our initial rollup
cy.contains(ROLLUP_ID);

// Select checkbox for our rollup job
cy.get(`#_selection_column_${ROLLUP_ID}-checkbox`).check({ force: true });

// Click on Actions popover menu
cy.get(`[data-test-subj="actionButton"]`).click({ force: true });

// Click Delete button
cy.get(`[data-test-subj="deleteButton"]`).click({ force: true });

// Type "delete" to confirm deletion
cy.get(`input[placeholder="delete"]`).type('delete', { force: true });

// Click the delete confirmation button in modal
cy.get(`[data-test-subj="confirmModalConfirmButton"]`).click();

// Confirm we got deleted toaster
cy.contains(`"${ROLLUP_ID}" successfully deleted!`);

// Confirm showing empty loading state
cy.contains(
'Rollup jobs help you conserve storage space for historical time series data while preserving the specific information you need'
);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -188,50 +188,6 @@ describe('Transforms', () => {
});
});

describe('can be deleted', () => {
beforeEach(() => {
cy.createTransform(TRANSFORM_ID, sampleTransform);
cy.reload();
});

it('successfully', () => {
// Confirm we have our initial transform
cy.contains(TRANSFORM_ID);

// Disable transform
cy.get(`#_selection_column_${TRANSFORM_ID}-checkbox`).check({
force: true,
});
cy.get(`[data-test-subj="disableButton"]`).click({ force: true });
cy.contains(`"${TRANSFORM_ID}" is disabled`);

// Select checkbox for our transform job
cy.get(`#_selection_column_${TRANSFORM_ID}-checkbox`).check({
force: true,
});

// Click on Actions popover menu
cy.get(`[data-test-subj="actionButton"]`).click({ force: true });

// Click Delete button
cy.get(`[data-test-subj="deleteButton"]`).click({ force: true });

// Type "delete" to confirm deletion
cy.get(`input[placeholder="delete"]`).type('delete', { force: true });

// Click the delete confirmation button in modal
cy.get(`[data-test-subj="confirmModalConfirmButton"]`).click();

// Confirm we got deleted toaster
cy.contains(`"${TRANSFORM_ID}" successfully deleted`);

// Confirm showing empty loading state
cy.contains(
'Transform jobs help you create a materialized view on top of existing data.'
);
});
});

describe('can be enabled and disabled', () => {
beforeEach(() => {
cy.createTransform(TRANSFORM_ID, sampleTransform);
Expand Down Expand Up @@ -290,4 +246,48 @@ describe('Transforms', () => {
cy.contains(`"${TRANSFORM_ID}" is enabled`);
});
});

describe('can be deleted', () => {
beforeEach(() => {
cy.createTransform(TRANSFORM_ID, sampleTransform);
cy.reload();
});

it('successfully', () => {
// Confirm we have our initial transform
cy.contains(TRANSFORM_ID);

// Disable transform
cy.get(`#_selection_column_${TRANSFORM_ID}-checkbox`).check({
force: true,
});
cy.get(`[data-test-subj="disableButton"]`).click({ force: true });
cy.contains(`"${TRANSFORM_ID}" is disabled`);

// Select checkbox for our transform job
cy.get(`#_selection_column_${TRANSFORM_ID}-checkbox`).check({
force: true,
});

// Click on Actions popover menu
cy.get(`[data-test-subj="actionButton"]`).click({ force: true });

// Click Delete button
cy.get(`[data-test-subj="deleteButton"]`).click({ force: true });

// Type "delete" to confirm deletion
cy.get(`input[placeholder="delete"]`).type('delete', { force: true });

// Click the delete confirmation button in modal
cy.get(`[data-test-subj="confirmModalConfirmButton"]`).click();

// Confirm we got deleted toaster
cy.contains(`"${TRANSFORM_ID}" successfully deleted`);

// Confirm showing empty loading state
cy.contains(
'Transform jobs help you create a materialized view on top of existing data.'
);
});
});
});

0 comments on commit 4390053

Please sign in to comment.