Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

select checkbox via id instead of class name #1503

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ describe('Aliases', () => {

describe('can flush an alias', () => {
it('successfully flush an index', () => {
let sample_alias = `${SAMPLE_ALIAS_PREFIX}-${1}`;
let sample_alias = `${SAMPLE_ALIAS_PREFIX}-1`;
// Sort all aliases in asc order to make it at first page
cy.contains('Alias name').click();
cy.get('[placeholder="Search..."]').type(`${sample_alias}{enter}`);
// Confirm we have our initial alias
cy.contains(sample_alias);
// index a test doc
Expand All @@ -170,28 +170,20 @@ describe('Aliases', () => {
expect(num).to.equal(1);
});

cy.get('[data-test-subj="moreAction"]').click();
// Flush btn should be disabled if no items selected
cy.get('[data-test-subj="Flush Action"]').should(
'have.class',
'euiContextMenuItem-isDisabled'
);

// Select an alias
cy.get(`[data-test-subj="checkboxSelectRow-${sample_alias}"]`).check({
force: true,
});

cy.get('[data-test-subj="moreAction"]').click();

// Extra wait required for page data to load, otherwise "Enable" button will be disabled
cy.wait(2000);
cy.get('[data-test-subj="moreAction"] button')
.click()
.get('[data-test-subj="Flush Action"]')
.should('be.disabled')
.end();

// Flush btn should be enabled
cy.get('[data-test-subj="Flush Action"]')
.should('exist')
.should('not.have.class', 'euiContextMenuItem-isDisabled')
.click();
cy.get(`#_selection_column_${sample_alias}-checkbox`)
.click()
.get('[data-test-subj="moreAction"] button')
.click()
.get('[data-test-subj="Flush Action"]')
.should('not.be.disabled')
.click()
.end();

// Check for flush index modal
cy.contains('Flush alias');
Expand Down
Loading