Skip to content

Commit 781d4a8

Browse files
Merge branch 'main' into #938_server_starts_before_cypress_test
2 parents 67a59a5 + be76a29 commit 781d4a8

File tree

39 files changed

+123
-164
lines changed

39 files changed

+123
-164
lines changed

babel.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ module.exports = function (api) {
1212
presets: [require("@babel/preset-env"), require("@babel/preset-react"), require("@babel/preset-typescript")],
1313
plugins: [
1414
[require("@babel/plugin-transform-runtime"), { regenerator: true }],
15-
require("@babel/plugin-proposal-class-properties"),
16-
require("@babel/plugin-proposal-object-rest-spread"),
15+
require("@babel/plugin-transform-class-properties"),
16+
require("@babel/plugin-transform-object-rest-spread"),
1717
[require("@babel/plugin-transform-modules-commonjs"), { allowTopLevelThis: true }],
1818
],
1919
};

cypress/integration/plugins/index-management-dashboards-plugin/aliases.js

+23-2
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,32 @@ describe("Aliases", () => {
2626
});
2727

2828
beforeEach(() => {
29+
// Intercept the specific POST request
30+
cy.intercept("POST", "/api/ism/apiCaller", (req) => {
31+
if (req.body.data && req.body.data.name === "**" && req.body.data.s === "alias:desc" && req.body.endpoint === "cat.aliases") {
32+
req.alias = "apiCaller"; // Assign an alias directly if the condition is met
33+
}
34+
});
35+
2936
// Visit ISM OSD
3037
cy.visit(`${BASE_PATH}/app/${IM_PLUGIN_NAME}#/aliases`);
3138

32-
// Common text to wait for to confirm page loaded, give up to 60 seconds for initial load
33-
cy.contains("Rows per page", { timeout: 60000 });
39+
// Wait for 120 seconds for OSD to start.
40+
// eslint-disable-next-line cypress/no-unnecessary-waiting
41+
// cy.wait(120000);
42+
43+
const startTime = new Date().getTime();
44+
45+
// Wait for the API call to complete
46+
cy.wait("@apiCaller", { timeout: 240000 }).then(() => {
47+
// Log the calculated duration
48+
const endTime = new Date().getTime();
49+
const duration = endTime - startTime; // Duration in milliseconds
50+
cy.log(`@apiCaller completed in ${duration} milliseconds`);
51+
});
52+
53+
// Common text to wait for to confirm page loaded, give up to 120 seconds for initial load
54+
cy.contains("Rows per page", { timeout: 120000 }).should("be.visible");
3455
});
3556

3657
describe("can be searched / sorted / paginated", () => {

cypress/integration/plugins/index-management-dashboards-plugin/indices_spec.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import samplePolicy from "../../../fixtures/plugins/index-management-dashboards-
99
const POLICY_ID = "test_policy_id";
1010
const SAMPLE_INDEX = "sample_index";
1111

12-
describe("Indices", () => {
12+
describe("Indexes", () => {
1313
beforeEach(() => {
1414
// Set welcome screen tracking to false
1515
localStorage.setItem("home:welcome:show", "false");
@@ -52,7 +52,7 @@ describe("Indices", () => {
5252
});
5353
});
5454

55-
describe("can show data stream indices", () => {
55+
describe("can show data stream indexes", () => {
5656
before(() => {
5757
cy.deleteAllIndices();
5858
cy.deleteIMJobs();
@@ -169,7 +169,7 @@ describe("Indices", () => {
169169
});
170170
});
171171

172-
describe("can make indices deleted", () => {
172+
describe("can make indexes deleted", () => {
173173
before(() => {
174174
cy.deleteAllIndices();
175175
cy.deleteIMJobs();
@@ -417,7 +417,7 @@ describe("Indices", () => {
417417
cy.get('[data-test-subj="Close Action"]').should("exist").should("not.have.class", "euiContextMenuItem-isDisabled").click();
418418

419419
// Check for close index modal
420-
cy.contains("Close indices");
420+
cy.contains("Close indexes");
421421

422422
// Close confirm button should be disabled
423423
cy.get('[data-test-subj="Close Confirm button"]').should("have.class", "euiButton-isDisabled");
@@ -457,7 +457,7 @@ describe("Indices", () => {
457457
cy.get('[data-test-subj="Open Action"]').should("exist").should("not.have.class", "euiContextMenuItem-isDisabled").click();
458458

459459
// Check for open index modal
460-
cy.contains("Open indices");
460+
cy.contains("Open indexes");
461461

462462
cy.get('[data-test-subj="Open Confirm button"]').click();
463463

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

+7-7
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const POLICY_ID_ROLLOVER = "test_policy_rollover";
1414
const SAMPLE_INDEX = "sample_index";
1515
const SAMPLE_INDEX_ROLLOVER = "sample_index-01";
1616

17-
describe("Managed indices", () => {
17+
describe("Managed indexes", () => {
1818
beforeEach(() => {
1919
// Set welcome screen tracking to false
2020
localStorage.setItem("home:welcome:show", "false");
@@ -58,13 +58,13 @@ describe("Managed indices", () => {
5858
});
5959

6060
// Confirm we got a remove policy toaster
61-
cy.contains("Removed policy from 1 managed indices");
61+
cy.contains("Removed policy from 1 managed indexes");
6262

6363
// Wait some time for remove policy to execute before reload
6464
cy.wait(3000).reload();
6565

6666
// Confirm we are back to empty loading state, give 20 seconds as OSD takes a while to load
67-
cy.contains("There are no existing managed indices.", { timeout: 20000 });
67+
cy.contains("There are no existing managed indexes.", { timeout: 20000 });
6868
});
6969
});
7070

@@ -121,7 +121,7 @@ describe("Managed indices", () => {
121121
cy.get(`[data-test-subj="retryModalRetryButton"]`).click({ force: true });
122122

123123
// Confirm we got retry toaster
124-
cy.contains("Retried 1 managed indices");
124+
cy.contains("Retried 1 managed indexes");
125125

126126
// Reload the page
127127
cy.reload();
@@ -238,10 +238,10 @@ describe("Managed indices", () => {
238238
});
239239

240240
// Confirm we got the change policy toaster
241-
cy.contains("Changed policy on 1 indices");
241+
cy.contains("Changed policy on 1 indexes");
242242

243243
// Click back to Managed Indices page by clicking "Managed indices" breadcrumb
244-
cy.contains("Policy managed indices").click();
244+
cy.contains("Policy managed indexes").click();
245245

246246
// Speed up execution of managed index
247247
cy.updateManagedIndexConfigStartTime(SAMPLE_INDEX);
@@ -257,7 +257,7 @@ describe("Managed indices", () => {
257257
});
258258
});
259259

260-
describe("can manage data stream indices", () => {
260+
describe("can manage data stream indexes", () => {
261261
before(() => {
262262
cy.deleteAllIndices();
263263
cy.deleteIMJobs();

cypress/integration/plugins/index-management-dashboards-plugin/rollups_spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ describe("Rollups", () => {
142142
cy.get("button").contains("Next").click({ force: true });
143143

144144
// Confirm that we got to step 4 of creation page
145-
cy.contains("Job name and indices");
145+
cy.contains("Job name and indexes");
146146

147147
// Click the create button
148148
cy.get("button").contains("Create").click({ force: true });

cypress/integration/plugins/index-management-dashboards-plugin/snapshots_spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ describe("Snapshots", () => {
8383
});
8484

8585
describe("Snapshot can be restored", () => {
86-
it("Successfully restores indices from snapshot", () => {
86+
it("Successfully restores indexes from snapshot", () => {
8787
// Must wait here before refreshing so snapshot status becomes 'success'
8888
cy.wait(5000);
8989

cypress/utils/commands.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@ Cypress.Commands.add("login", () => {
9797
});
9898

9999
Cypress.Commands.add("deleteAllIndices", () => {
100-
cy.log("Deleting all indices");
100+
cy.log("Deleting all indexes");
101101
cy.request("DELETE", `${Cypress.env("openSearchUrl")}/index*,sample*,opensearch_dashboards*`);
102102
cy.request("DELETE", `${Cypress.env("openSearchUrl")}/.opendistro-ism*?expand_wildcards=all`);
103103
});
104104

105105
Cypress.Commands.add("deleteADSystemIndices", () => {
106-
cy.log("Deleting AD system indices");
106+
cy.log("Deleting AD system indexes");
107107
cy.request("DELETE", `${Cypress.env("openSearchUrl")}/.opendistro-anomaly*`);
108108
});
109109

integtest.sh

-77
This file was deleted.

public/pages/ChangePolicy/containers/ChangePolicy/ChangePolicy.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export default class ChangePolicy extends Component<ChangePolicyProps, ChangePol
9898
if (changePolicyResponse.ok) {
9999
const { updatedIndices, failedIndices, failures } = changePolicyResponse.response;
100100
if (updatedIndices) {
101-
this.context.notifications.toasts.addSuccess(`Changed policy on ${updatedIndices} indices`);
101+
this.context.notifications.toasts.addSuccess(`Changed policy on ${updatedIndices} indexes`);
102102
}
103103
if (failures) {
104104
this.context.notifications.toasts.addDanger(

public/pages/CreateDataStream/containers/BackingIndices/BackingIndices.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export default function BackingIndices(props: SubDetailProps) {
103103
{
104104
field: "managed",
105105
name: "Managed by policy",
106-
sortable: false,
106+
sortable: true,
107107
truncateText: true,
108108
textOnly: true,
109109
render: renderNumber,

public/pages/CreateRollup/components/JobNameAndIndices/JobNameAndIndices.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default class JobNameAndIndices extends Component<JobNameAndIndicesProps>
4444
</ModalConsumer>
4545
}
4646
bodyStyles={{ padding: "initial" }}
47-
title="Job name and indices"
47+
title="Job name and indexes"
4848
titleSize="m"
4949
>
5050
<div style={{ padding: "15px" }}>

public/pages/CreateRollup/containers/CreateRollupForm/CreateRollupForm.test.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ describe("<CreateRollupForm /> creation", () => {
303303
userEvent.click(getByTestId("createRollupNextButton"));
304304

305305
//Check that it routes to step 4
306-
expect(queryByText("Job name and indices")).not.toBeNull();
306+
expect(queryByText("Job name and indexes")).not.toBeNull();
307307

308308
//Test create
309309
userEvent.click(getByTestId("createRollupSubmitButton"));
@@ -430,6 +430,6 @@ describe("<CreateRollupForm /> creation", () => {
430430

431431
//Check that it routes to step 4
432432
userEvent.click(getByTestId("createRollupNextButton"));
433-
expect(queryByText("Job name and indices")).not.toBeNull();
433+
expect(queryByText("Job name and indexes")).not.toBeNull();
434434
});
435435
});

public/pages/Indices/components/CloseIndexModal/CloseIndexModal.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default function CloseIndexModal(props: CloseIndexModalProps) {
4444
return (
4545
<EuiModal onClose={onClose}>
4646
<EuiModalHeader>
47-
<EuiModalHeaderTitle>Close indices</EuiModalHeaderTitle>
47+
<EuiModalHeaderTitle>Close indexes</EuiModalHeaderTitle>
4848
</EuiModalHeader>
4949

5050
<EuiModalBody>

public/pages/Indices/components/CloseIndexModal/__snapshots__/CloseIndexModal.test.tsx.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ HTMLCollection [
3939
<div
4040
class="euiModalHeader__title"
4141
>
42-
Close indices
42+
Close indexes
4343
</div>
4444
</div>
4545
<div

public/pages/Indices/components/DeleteIndexModal/DeleteIndexModal.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default function DeleteIndexModal(props: DeleteIndexModalProps) {
4444
return (
4545
<EuiModal onClose={onClose}>
4646
<EuiModalHeader>
47-
<EuiModalHeaderTitle>Delete indices</EuiModalHeaderTitle>
47+
<EuiModalHeaderTitle>Delete indexes</EuiModalHeaderTitle>
4848
</EuiModalHeader>
4949

5050
<EuiModalBody>

public/pages/Indices/components/DeleteIndexModal/__snapshots__/DeleteIndexModal.test.tsx.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ HTMLCollection [
3939
<div
4040
class="euiModalHeader__title"
4141
>
42-
Delete indices
42+
Delete indexes
4343
</div>
4444
</div>
4545
<div

public/pages/Indices/components/IndexControls/IndexControls.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export default class IndexControls extends Component<IndexControlsProps, IndexCo
7676
</EuiFlexItem>
7777
<EuiFlexItem grow={false}>
7878
<EuiSwitch
79-
label="Show data stream indices"
79+
label="Show data stream indexes"
8080
checked={showDataStreams}
8181
onChange={toggleShowDataStreams}
8282
data-test-subj="toggleShowDataStreams"

public/pages/Indices/components/IndexControls/__snapshots__/IndexControls.test.tsx.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ exports[`<IndexControls /> spec renders data streams selection field 1`] = `
123123
class="euiSwitch__label"
124124
id="some_html_id"
125125
>
126-
Show data stream indices
126+
Show data stream indexes
127127
</span>
128128
</div>
129129
</div>
@@ -215,7 +215,7 @@ exports[`<IndexControls /> spec renders the component 1`] = `
215215
class="euiSwitch__label"
216216
id="some_html_id"
217217
>
218-
Show data stream indices
218+
Show data stream indexes
219219
</span>
220220
</div>
221221
</div>

public/pages/Indices/components/OpenIndexModal/OpenIndexModal.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default function OpenIndexModal(props: OpenIndexModalProps) {
3131
return (
3232
<EuiModal onClose={onClose}>
3333
<EuiModalHeader>
34-
<EuiModalHeaderTitle>Open indices</EuiModalHeaderTitle>
34+
<EuiModalHeaderTitle>Open indexes</EuiModalHeaderTitle>
3535
</EuiModalHeader>
3636

3737
<EuiModalBody>

public/pages/Indices/components/OpenIndexModal/__snapshots__/OpenIndexModal.test.tsx.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ HTMLCollection [
3939
<div
4040
class="euiModalHeader__title"
4141
>
42-
Open indices
42+
Open indexes
4343
</div>
4444
</div>
4545
<div

public/pages/Indices/containers/Indices/Indices.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ export default class Indices extends Component<IndicesProps, IndicesState> {
269269
/>
270270
}
271271
bodyStyles={{ padding: "initial" }}
272-
title="Indices"
272+
title="Indexes"
273273
itemCount={totalIndices}
274274
>
275275
<IndexControls

0 commit comments

Comments
 (0)