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

Signed-off-by: Nishant Goel <[email protected]>
  • Loading branch information
nisgoel-amazon committed Aug 5, 2024
1 parent 3df0788 commit 20d920e
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 20d920e

Please sign in to comment.