Skip to content

Commit 86794d3

Browse files
committed
debug5 split_index
Signed-off-by: Vaibhav Agarwal <[email protected]>
1 parent d7c57bc commit 86794d3

File tree

1 file changed

+28
-93
lines changed

1 file changed

+28
-93
lines changed

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

Lines changed: 28 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -104,99 +104,34 @@ describe("Split Index", () => {
104104

105105
it("Split successfully with advanced setting", () => {
106106
const targetIndex = `${sampleIndex}` + "-setting";
107-
cy.get(`[data-test-subj="checkboxSelectRow-${sampleIndex}"]`)
108-
.click()
109-
.end()
110-
.get('[data-test-subj="moreAction"]')
111-
.click()
112-
.end()
113-
.get('[data-test-subj="Split Action"]')
114-
.click()
115-
.end()
116-
.get("[data-test-subj=targetIndexNameInput]")
117-
.type(`${targetIndex}`)
118-
.end()
119-
// Instead of input shard number at shard field, another option is to populate it in advanced setting
120-
.get('[aria-controls="accordionForCreateIndexSettings"]')
121-
.click()
122-
.end()
123-
.get('[data-test-subj="codeEditorContainer"] textarea')
124-
.focus()
125-
// Need to remove the default {} in advanced setting
126-
.clear()
127-
.type(`{"index.number_of_shards": "${splitNumber}", "index.number_of_replicas": "${replicaNumber}"}`, {
128-
parseSpecialCharSequences: false,
129-
})
130-
.end()
131-
.get('[data-test-subj="splitButton"]')
132-
.click()
133-
.end();
134-
135-
cy.get(`[data-test-subj="viewIndexDetailButton-${targetIndex}"]`).click().end();
136-
cy.get("#indexDetailModalSettings").click().end();
137-
cy.get('[data-test-subj="form-name-index.number_of_shards"] .euiText').should("have.text", `${splitNumber}`).end();
138-
cy.get('[data-test-subj="form-name-index.number_of_replicas"] input').should("have.value", `${replicaNumber}`).end();
107+
cy.get(`[data-test-subj="checkboxSelectRow-${sampleIndex}"]`).click().end();
108+
cy.wait(1000);
109+
cy.get('[data-test-subj="moreAction"]').click().end();
110+
cy.get('[data-test-subj="Split Action"]').click().end();
111+
cy.wait(1000);
112+
// cy.get("[data-test-subj=targetIndexNameInput]")
113+
// .type(`${targetIndex}`)
114+
// .end()
115+
// // Instead of input shard number at shard field, another option is to populate it in advanced setting
116+
// .get('[aria-controls="accordionForCreateIndexSettings"]')
117+
// .click()
118+
// .end()
119+
// .get('[data-test-subj="codeEditorContainer"] textarea')
120+
// .focus()
121+
// // Need to remove the default {} in advanced setting
122+
// .clear()
123+
// .type(`{"index.number_of_shards": "${splitNumber}", "index.number_of_replicas": "${replicaNumber}"}`, {
124+
// parseSpecialCharSequences: false,
125+
// })
126+
// .end()
127+
// .get('[data-test-subj="splitButton"]')
128+
// .click()
129+
// .end();
130+
//
131+
// cy.get(`[data-test-subj="viewIndexDetailButton-${targetIndex}"]`).click().end();
132+
// cy.get("#indexDetailModalSettings").click().end();
133+
// cy.get('[data-test-subj="form-name-index.number_of_shards"] .euiText').should("have.text", `${splitNumber}`).end();
134+
// cy.get('[data-test-subj="form-name-index.number_of_replicas"] input').should("have.value", `${replicaNumber}`).end();
139135
}); // advanced setting
140-
141-
it("Split successfully with alias", () => {
142-
const targetIndex = `${sampleIndex}` + "-alias";
143-
const newAlias = "alias-new";
144-
cy.get(`[data-test-subj="checkboxSelectRow-${sampleIndex}"]`)
145-
.click()
146-
.end()
147-
.get('[data-test-subj="moreAction"]')
148-
.click()
149-
.end()
150-
.get('[data-test-subj="Split Action"]')
151-
.click()
152-
.end()
153-
.get("[data-test-subj=targetIndexNameInput]")
154-
.type(`${targetIndex}`)
155-
.end()
156-
.get('[data-test-subj="numberOfShardsInput"]')
157-
.type(`${splitNumber}{downArrow}{enter}`)
158-
.end()
159-
// Assign to an existing alias and a new alias
160-
.get('[data-test-subj="form-name-aliases"] [data-test-subj="comboBoxSearchInput"]')
161-
.type(`${sampleAlias}{enter}${newAlias}{enter}`)
162-
.end()
163-
.get('[data-test-subj="splitButton"]')
164-
.click()
165-
.end();
166-
167-
cy.get(`[data-test-subj="viewIndexDetailButton-${targetIndex}"]`).click().end();
168-
// Verify alias associated with the new index
169-
cy.get("#indexDetailModalAlias").click().end();
170-
cy.get(`[title="${newAlias}"]`).should("exist").end();
171-
cy.get(`[title="${sampleAlias}"]`).should("exist").end();
172-
}); // Create with alias
173-
174-
it("Update blocks write to true", () => {
175-
// Set index to not blocks write
176-
cy.updateIndexSettings(sampleIndex, {
177-
"index.blocks.write": "false",
178-
}).end();
179-
cy.get(`[data-test-subj="checkboxSelectRow-${sampleIndex}"]`)
180-
.click()
181-
.end()
182-
.get('[data-test-subj="moreAction"]')
183-
.click()
184-
.end()
185-
.get('[data-test-subj="Split Action"]')
186-
.click()
187-
.end()
188-
// Index can't be split if it's blocks write status is not true
189-
.get('[data-test-subj="splitButton"]')
190-
.should("have.class", "euiButton-isDisabled")
191-
.end()
192-
.wait(1000)
193-
// Set index to blocks write
194-
.get('[data-test-subj="set-indexsetting-button"]')
195-
.click()
196-
.end()
197-
.get('[data-test-subj="splitButton"]')
198-
.click()
199-
.end();
200-
}); // Blocks write
201136
});
202137
});

0 commit comments

Comments
 (0)