Skip to content

Commit

Permalink
[discover] add wait for rendering historgram and disable home modals (#…
Browse files Browse the repository at this point in the history
…1302)

histogram can render slower than cypress selecting element but with the optimizations to the table this could have a slight race condition.

also disable home modals when fleshing tenant settings

Signed-off-by: Suchit Sahoo <suchsah@amazon.com>
  • Loading branch information
LDrago27 authored May 8, 2024
1 parent d94417d commit d106cbb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ describe('discover_advanced_setting', () => {
});
cy.reload();
cy.switchDiscoverTable('new');
cy.wait(2000); // Intentional Wait to account for low performant env

cy.get('.euiDataGridRowCell--date')
.eq(0)
Expand All @@ -123,6 +124,7 @@ describe('discover_advanced_setting', () => {
});
cy.reload();
cy.switchDiscoverTable('new');
cy.wait(2000); // Intentional Wait to account for low performant env

cy.get('.euiDataGridRowCell--date')
.eq(0)
Expand All @@ -144,6 +146,7 @@ describe('discover_advanced_setting', () => {
'discover:sort:defaultOrder': 'desc',
});
cy.reload();
cy.wait(2000); // Intentional Wait to account for low performant env

cy.get('[data-test-subj="docTableField"]')
.eq(0)
Expand All @@ -163,6 +166,7 @@ describe('discover_advanced_setting', () => {
'discover:sort:defaultOrder': 'asc',
});
cy.reload();
cy.wait(2000); // Intentional Wait to account for low performant env

cy.get('[data-test-subj="docTableField"]')
.eq(0)
Expand Down Expand Up @@ -192,6 +196,7 @@ describe('discover_advanced_setting', () => {
});
cy.reload();
cy.switchDiscoverTable('new');
cy.wait(2000); // Intentional Wait to account for low performant env
});

it('check new table respects Number of rows setting', function () {
Expand All @@ -203,6 +208,7 @@ describe('discover_advanced_setting', () => {

it('check legacy table respects Number of rows setting', function () {
cy.switchDiscoverTable('legacy');
cy.wait(2000); // Intentional Wait to account for low performant env
cy.get('[aria-label="Next"]').should('have.length', 5);
});

Expand Down Expand Up @@ -326,7 +332,8 @@ describe('discover_advanced_setting', () => {
'doc_table:highlight': false,
});
cy.reload();
// cy.switchDiscoverTable("legacy");
cy.wait(2000); // Intentional Wait to account for low performant env

cy.get('mark').should('not.exist');

// reset the setting to default value
Expand Down Expand Up @@ -373,6 +380,8 @@ describe('discover_advanced_setting', () => {
defaultColumns: ['host', 'agent'],
});
cy.reload();
cy.wait(2000); // Intentional Wait to account for low performant env

cy.get('[data-test-subj="docTableHeader-agent"]').should('be.visible');
cy.get('[data-test-subj="docTableHeader-host"]').should('be.visible');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ describe('discover_table', () => {
describe('expand multiple documents in legacy table', () => {
before(() => {
cy.switchDiscoverTable('legacy');
cy.wait(2000); // Intentional Wait to account for low performant env
});

it('checks if multiple documents can be expanded in legacy table', function () {
Expand Down
2 changes: 2 additions & 0 deletions cypress/utils/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,8 @@ Cypress.Commands.add('loadSampleData', (type) => {

Cypress.Commands.add('fleshTenantSettings', () => {
if (Cypress.env('SECURITY_ENABLED')) {
localStorage.setItem('home:newThemeModal:show', 'false');
localStorage.setItem('home:welcome:show', 'false');
// Go to the home page to flesh the tenant settings
cy.visit(`/app/home`);
cy.waitForLoader();
Expand Down

0 comments on commit d106cbb

Please sign in to comment.