Skip to content

Commit

Permalink
select checkbox via id instead of class name (#1503)
Browse files Browse the repository at this point in the history
* select checkbox via id instead of class name

Signed-off-by: Nishant Goel <nisgoel@amazon.com>

* Re trigger PR workflows

Signed-off-by: Nishant Goel <nisgoel@amazon.com>

* Instead of sorting in asc order on aliases page, search the alias via text

Signed-off-by: Nishant Goel <nisgoel@amazon.com>

---------

Signed-off-by: Nishant Goel <nisgoel@amazon.com>
(cherry picked from commit 77b4d19)
  • Loading branch information
nisgoel-amazon authored and github-actions[bot] committed Aug 5, 2024
1 parent 0a0f03d commit eb58bd6
Showing 1 changed file with 15 additions and 23 deletions.
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

0 comments on commit eb58bd6

Please sign in to comment.