Skip to content

Commit 6f7d39e

Browse files
committed
Adding e2e test to assert different navigation states
1 parent 41ccb7c commit 6f7d39e

1 file changed

Lines changed: 40 additions & 6 deletions

File tree

x-pack/plugins/observability_onboarding/e2e/cypress/e2e/logs/system_logs.cy.ts

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -644,14 +644,48 @@ describe('[Logs onboarding] System logs', () => {
644644
.contains('Logs are being shipped!')
645645
.should('exist');
646646
});
647+
});
647648

648-
it('when user clicks on Explore Logs it navigates to observability log explorer', () => {
649-
cy.wait('@systemIntegrationInstall');
650-
cy.wait('@checkOnboardingProgress');
651-
cy.getByTestSubj('obltOnboardingExploreLogs').should('exist').click();
649+
describe('Explore Logs', () => {
650+
describe('when integration installation fails', () => {
651+
beforeEach(() => {
652+
cy.deleteIntegration('system');
653+
cy.intercept('GET', '/api/fleet/epm/packages/system', {
654+
statusCode: 500,
655+
body: {
656+
message: 'Internal error',
657+
},
658+
}).as('systemIntegrationInstall');
659+
cy.loginAsLogMonitoringUser();
660+
cy.visitKibana('/app/observabilityOnboarding/systemLogs');
661+
});
662+
663+
it('when users clicks on Explore logs they navigate to log explorer - All logs', () => {
664+
cy.wait('@systemIntegrationInstall');
665+
cy.getByTestSubj('obltOnboardingExploreLogs').should('exist').click();
652666

653-
cy.url().should('include', '/app/observability-log-explorer');
654-
cy.get('button').contains('[System] syslog').should('exist');
667+
cy.url().should('include', '/app/observability-log-explorer');
668+
cy.get('button').contains('All logs').should('exist');
669+
});
670+
});
671+
672+
describe('when integration installation succeed', () => {
673+
beforeEach(() => {
674+
cy.deleteIntegration('system');
675+
cy.intercept('GET', '/api/fleet/epm/packages/system').as(
676+
'systemIntegrationInstall'
677+
);
678+
cy.loginAsLogMonitoringUser();
679+
cy.visitKibana('/app/observabilityOnboarding/systemLogs');
680+
});
681+
682+
it('when users clicks on Explore logs they navigate to log explorer and System integration is selected', () => {
683+
cy.wait('@systemIntegrationInstall');
684+
cy.getByTestSubj('obltOnboardingExploreLogs').should('exist').click();
685+
686+
cy.url().should('include', '/app/observability-log-explorer');
687+
cy.get('button').contains('[System] syslog').should('exist');
688+
});
655689
});
656690
});
657691
});

0 commit comments

Comments
 (0)