Skip to content

Commit aa5fbff

Browse files
authored
Fix failing cypress tests (#1388)
Signed-off-by: Hari Kurapati <kurahari@amazon.com>
1 parent 0761cb3 commit aa5fbff

5 files changed

Lines changed: 15 additions & 8 deletions

File tree

.github/workflows/cypress-with-security-workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
branches:
88
- "*"
99
env:
10-
OPENSEARCH_DASHBOARDS_VERSION: 'main'
10+
OPENSEARCH_DASHBOARDS_VERSION: '3.5'
1111
jobs:
1212
tests:
1313
name: Run Cypress E2E tests with security

.github/workflows/cypress-workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
branches:
88
- "*"
99
env:
10-
OPENSEARCH_DASHBOARDS_VERSION: 'main'
10+
OPENSEARCH_DASHBOARDS_VERSION: '3.5'
1111
CYPRESS_MEMORY_LIMIT: '40960'
1212
NODE_OPTIONS: '--max-old-space-size=40960'
1313
jobs:

.github/workflows/unit-tests-workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
branches:
88
- "*"
99
env:
10-
OPENSEARCH_DASHBOARDS_VERSION: 'main'
10+
OPENSEARCH_DASHBOARDS_VERSION: '3.5'
1111
jobs:
1212
Get-CI-Image-Tag:
1313
uses: opensearch-project/opensearch-build/.github/workflows/get-ci-image-tag.yml@main

cypress/e2e/plugins/index-management-dashboards-plugin/managed_indices_spec.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ describe("Managed indexes", () => {
2929
// Common text to wait for to confirm page loaded, give up to 60 seconds for initial load
3030
cy.contains("Edit rollover alias", { timeout: 60000 });
3131

32-
cy.get('[data-test-subj="toastCloseButton"]').click({ force: true });
32+
cy.dismissToast();
3333
});
3434

3535
describe("can have policies removed", () => {
@@ -90,7 +90,7 @@ describe("Managed indexes", () => {
9090
// Wait up to 5 seconds for the managed index to execute
9191
// eslint-disable-next-line cypress/no-unnecessary-waiting
9292
cy.wait(5000).reload();
93-
cy.get('[data-test-subj="toastCloseButton"]').click({ force: true });
93+
cy.dismissToast();
9494

9595
// Confirm managed index successfully initialized the policy
9696
cy.contains("Successfully initialized", { timeout: 20000 });
@@ -100,7 +100,7 @@ describe("Managed indexes", () => {
100100
// Wait up to 5 seconds for managed index to execute
101101
// eslint-disable-next-line cypress/no-unnecessary-waiting
102102
cy.wait(5000).reload();
103-
cy.get('[data-test-subj="toastCloseButton"]').click({ force: true });
103+
cy.dismissToast();
104104

105105
// Confirm we have a Failed execution, wait up to 20 seconds as OSD takes a while to load
106106
cy.contains("Failed", { timeout: 20000 });
@@ -125,7 +125,7 @@ describe("Managed indexes", () => {
125125

126126
// Reload the page
127127
cy.reload();
128-
cy.get('[data-test-subj="toastCloseButton"]').click({ force: true });
128+
cy.dismissToast();
129129

130130
// Confirm we see managed index attempting to retry, give 20 seconds for OSD load
131131
cy.contains("Pending retry of failed managed index", { timeout: 20000 });
@@ -136,7 +136,7 @@ describe("Managed indexes", () => {
136136
// Wait up to 5 seconds for managed index to execute
137137
// eslint-disable-next-line cypress/no-unnecessary-waiting
138138
cy.wait(5000).reload();
139-
cy.get('[data-test-subj="toastCloseButton"]').click({ force: true });
139+
cy.dismissToast();
140140

141141
// Confirm managed index successfully rolled over
142142
cy.contains("Successfully rolled over", { timeout: 20000 });

cypress/e2e/plugins/index-management-dashboards-plugin/policies_spec.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ describe("Policies", () => {
7373
add: ["alias1", "alias2"],
7474
remove: ["alias3", "alias5", "alias6"],
7575
};
76+
const testIndexPattern = "test-index-pattern";
7677

7778
// Route us to create policy page
7879
cy.contains("Create policy").click({ force: true });
@@ -89,6 +90,12 @@ describe("Policies", () => {
8990
// Type in the policy description
9091
cy.get(`[data-test-subj="create-policy-description"]`).type("{selectall}{backspace}" + sampleAliasPolicy.policy.description);
9192

93+
// Add an ISM template
94+
cy.get("button").contains("Add template").click({ force: true });
95+
96+
// Enter an index pattern
97+
cy.get(`[data-test-subj="comboBoxInput"]`).type(testIndexPattern);
98+
9299
// Add a state
93100
cy.get("button").contains("Add state").click({ force: true });
94101

0 commit comments

Comments
 (0)