Skip to content

Commit

Permalink
Adding e2e test to assert different navigation states
Browse files Browse the repository at this point in the history
  • Loading branch information
yngrdyn committed Sep 27, 2023
1 parent 41ccb7c commit 6f7d39e
Showing 1 changed file with 40 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -644,14 +644,48 @@ describe('[Logs onboarding] System logs', () => {
.contains('Logs are being shipped!')
.should('exist');
});
});

it('when user clicks on Explore Logs it navigates to observability log explorer', () => {
cy.wait('@systemIntegrationInstall');
cy.wait('@checkOnboardingProgress');
cy.getByTestSubj('obltOnboardingExploreLogs').should('exist').click();
describe('Explore Logs', () => {
describe('when integration installation fails', () => {
beforeEach(() => {
cy.deleteIntegration('system');
cy.intercept('GET', '/api/fleet/epm/packages/system', {
statusCode: 500,
body: {
message: 'Internal error',
},
}).as('systemIntegrationInstall');
cy.loginAsLogMonitoringUser();
cy.visitKibana('/app/observabilityOnboarding/systemLogs');
});

it('when users clicks on Explore logs they navigate to log explorer - All logs', () => {
cy.wait('@systemIntegrationInstall');
cy.getByTestSubj('obltOnboardingExploreLogs').should('exist').click();

cy.url().should('include', '/app/observability-log-explorer');
cy.get('button').contains('[System] syslog').should('exist');
cy.url().should('include', '/app/observability-log-explorer');
cy.get('button').contains('All logs').should('exist');
});
});

describe('when integration installation succeed', () => {
beforeEach(() => {
cy.deleteIntegration('system');
cy.intercept('GET', '/api/fleet/epm/packages/system').as(
'systemIntegrationInstall'
);
cy.loginAsLogMonitoringUser();
cy.visitKibana('/app/observabilityOnboarding/systemLogs');
});

it('when users clicks on Explore logs they navigate to log explorer and System integration is selected', () => {
cy.wait('@systemIntegrationInstall');
cy.getByTestSubj('obltOnboardingExploreLogs').should('exist').click();

cy.url().should('include', '/app/observability-log-explorer');
cy.get('button').contains('[System] syslog').should('exist');
});
});
});
});

0 comments on commit 6f7d39e

Please sign in to comment.