Skip to content

Commit

Permalink
fix cypress tests
Browse files Browse the repository at this point in the history
Signed-off-by: Joanne Wang <[email protected]>
  • Loading branch information
jowg-amazon committed Sep 16, 2024
1 parent b8fb210 commit 6765788
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 19 deletions.
8 changes: 4 additions & 4 deletions cypress/integration/bucket_level_monitor_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,8 @@ describe('Bucket-Level Monitors', () => {
// Add a trigger
addTriggerToVisualEditorMonitor(SAMPLE_TRIGGER, 0, SAMPLE_ACTION, true);

// Click update button to save monitor changes
cy.get('button').contains('Update').last().click({ force: true });
// Click save to save monitor changes
cy.get('button').contains('Save').last().click({ force: true });

// Confirm we can see only one row in the trigger list by checking <caption> element
cy.contains('This table contains 1 row');
Expand Down Expand Up @@ -375,8 +375,8 @@ describe('Bucket-Level Monitors', () => {
timeout: 25000,
});

// Click the update button
cy.get('button').contains('Update').last().click({ force: true });
// Click the save button
cy.get('button').contains('Save').last().click({ force: true });

// Confirm we're on the Monitor Details page by searching for the History element
cy.contains('History', { timeout: 20000 });
Expand Down
4 changes: 2 additions & 2 deletions cypress/integration/cluster_metrics_monitor_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,8 @@ describe('ClusterMetricsMonitor', () => {
'ctx.results[0].number_of_pending_tasks >= 0'
);

// Click update button to save monitor changes
cy.get('button').contains('Update').last().click({ force: true });
// Click save button to save monitor changes
cy.get('button').contains('Save').last().click({ force: true });

// Confirm we can see only one row in the trigger list by checking <caption> element
cy.contains('This table contains 1 row');
Expand Down
3 changes: 2 additions & 1 deletion cypress/integration/composite_level_monitor_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ describe('CompositeLevelMonitor', () => {

it('by visual editor', () => {
// Verify edit page
cy.contains('Edit').click({ force: true });
cy.contains('Edit monitor', { timeout: 20000 });
cy.get('input[name="name"]').type('_edited');

Expand All @@ -150,7 +151,7 @@ describe('CompositeLevelMonitor', () => {
.type('{enter}');

cy.intercept('api/alerting/workflows/*').as('updateMonitorRequest');
cy.get('button').contains('Update').click({ force: true });
cy.get('button').contains('Save').click({ force: true });

// Wait for monitor to be created
cy.wait('@updateMonitorRequest').then(() => {
Expand Down
12 changes: 6 additions & 6 deletions cypress/integration/document_level_monitor_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,8 @@ describe('DocumentLevelMonitor', () => {

// TODO: Test with Notifications plugin

// Click the update button
cy.get('button').contains('Update').last().click({ force: true });
// Click the save button
cy.get('button').contains('Save').last().click({ force: true });

// Confirm we can see only one row in the trigger list by checking <caption> element
cy.contains('This table contains 2 rows');
Expand Down Expand Up @@ -446,8 +446,8 @@ describe('DocumentLevelMonitor', () => {

// TODO: Test with Notifications plugin

// Click the create button
cy.get('button').contains('Update').last().click({ force: true });
// Click the save button
cy.get('button').contains('Save').last().click({ force: true });

// Confirm we can see only one row in the trigger list by checking <caption> element
cy.contains('This table contains 1 row');
Expand Down Expand Up @@ -489,8 +489,8 @@ describe('DocumentLevelMonitor', () => {
cy.get('[data-test-subj="indicesComboBox"]').should('not.have.text', TESTING_INDEX_A);
cy.get('[data-test-subj="indicesComboBox"]').contains(TESTING_INDEX_B, { timeout: 20000 });

// Click the update button
cy.get('button').contains('Update').last().click({ force: true });
// Click the save button
cy.get('button').contains('Save').last().click({ force: true });

// Confirm we're on the Monitor Details page by searching for the History element
cy.contains('History', { timeout: 20000 });
Expand Down
12 changes: 6 additions & 6 deletions cypress/integration/query_level_monitor_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ describe('Query-Level Monitors', () => {
.clear()
.type(UPDATED_MONITOR, { force: true });

// Click Update button
cy.get('button').contains('Update').last().click({ force: true });
// Click save button
cy.get('button').contains('Save').last().click({ force: true });

// Confirm the update process is done and the page loaded
cy.contains('Edit monitor');
Expand Down Expand Up @@ -222,8 +222,8 @@ describe('Query-Level Monitors', () => {
timeout: 25000,
});

// Click the update button
cy.get('button').contains('Update').last().click();
// Click the save button
cy.get('button').contains('Save').last().click();

// Confirm we're on the Monitor Details page by searching for the History element
cy.contains('History', { timeout: 25000 });
Expand Down Expand Up @@ -339,8 +339,8 @@ describe('Query-Level Monitors', () => {
addVisualQueryLevelTrigger(trigger.name, i, true, `IS ${trigger.enum}`, `${i}`);
}

// Click Update button
cy.get('button').contains('Update').last().click({ force: true });
// Click save button
cy.get('button').contains('Save').last().click({ force: true });

// Confirm we can see the correct number of rows in the trigger list by checking <caption> element
cy.contains(`This table contains ${triggers.length} rows`, { timeout: 25000 });
Expand Down

0 comments on commit 6765788

Please sign in to comment.