Skip to content

Commit 71d54c8

Browse files
authored
adds kibana navigation tests (#69733)
1 parent e87a4b2 commit 71d54c8

17 files changed

+148
-47
lines changed

x-pack/plugins/security_solution/cypress/integration/cases.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import { backToCases, createNewCase } from '../tasks/create_new_case';
4444
import { loginAndWaitForPageWithoutDateRange } from '../tasks/login';
4545
import { esArchiverLoad, esArchiverUnload } from '../tasks/es_archiver';
4646

47-
import { CASES } from '../urls/navigation';
47+
import { CASES_URL } from '../urls/navigation';
4848

4949
describe('Cases', () => {
5050
before(() => {
@@ -56,7 +56,7 @@ describe('Cases', () => {
5656
});
5757

5858
it('Creates a new case with timeline and opens the timeline', () => {
59-
loginAndWaitForPageWithoutDateRange(CASES);
59+
loginAndWaitForPageWithoutDateRange(CASES_URL);
6060
goToCreateNewCase();
6161
createNewCase(case1);
6262
backToCases();

x-pack/plugins/security_solution/cypress/integration/cases_connectors.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
} from '../tasks/configure_cases';
1616
import { loginAndWaitForPageWithoutDateRange } from '../tasks/login';
1717

18-
import { CASES } from '../urls/navigation';
18+
import { CASES_URL } from '../urls/navigation';
1919

2020
describe('Cases connectors', () => {
2121
before(() => {
@@ -25,7 +25,7 @@ describe('Cases connectors', () => {
2525
});
2626

2727
it('Configures a new connector', () => {
28-
loginAndWaitForPageWithoutDateRange(CASES);
28+
loginAndWaitForPageWithoutDateRange(CASES_URL);
2929
goToEditExternalConnection();
3030
openAddNewConnectorOption();
3131
addServiceNowConnector(serviceNowConnector);

x-pack/plugins/security_solution/cypress/integration/events_viewer.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import {
3333
} from '../tasks/hosts/events';
3434
import { clearSearchBar, kqlSearch } from '../tasks/security_header';
3535

36-
import { HOSTS_PAGE } from '../urls/navigation';
36+
import { HOSTS_URL } from '../urls/navigation';
3737
import { resetFields } from '../tasks/timeline';
3838

3939
const defaultHeadersInDefaultEcsCategory = [
@@ -49,7 +49,7 @@ const defaultHeadersInDefaultEcsCategory = [
4949
describe('Events Viewer', () => {
5050
context('Fields rendering', () => {
5151
before(() => {
52-
loginAndWaitForPage(HOSTS_PAGE);
52+
loginAndWaitForPage(HOSTS_URL);
5353
openEvents();
5454
});
5555

@@ -75,7 +75,7 @@ describe('Events Viewer', () => {
7575

7676
context('Events viewer query modal', () => {
7777
before(() => {
78-
loginAndWaitForPage(HOSTS_PAGE);
78+
loginAndWaitForPage(HOSTS_URL);
7979
openEvents();
8080
});
8181

@@ -93,7 +93,7 @@ describe('Events Viewer', () => {
9393

9494
context('Events viewer fields behaviour', () => {
9595
before(() => {
96-
loginAndWaitForPage(HOSTS_PAGE);
96+
loginAndWaitForPage(HOSTS_URL);
9797
openEvents();
9898
});
9999

@@ -124,7 +124,7 @@ describe('Events Viewer', () => {
124124

125125
context('Events behaviour', () => {
126126
before(() => {
127-
loginAndWaitForPage(HOSTS_PAGE);
127+
loginAndWaitForPage(HOSTS_URL);
128128
openEvents();
129129
waitsForEventsToBeLoaded();
130130
});
@@ -155,7 +155,7 @@ describe('Events Viewer', () => {
155155

156156
context.skip('Events columns', () => {
157157
before(() => {
158-
loginAndWaitForPage(HOSTS_PAGE);
158+
loginAndWaitForPage(HOSTS_URL);
159159
openEvents();
160160
waitsForEventsToBeLoaded();
161161
});

x-pack/plugins/security_solution/cypress/integration/fields_browser.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import { loginAndWaitForPage } from '../tasks/login';
3131
import { openTimeline } from '../tasks/security_main';
3232
import { openTimelineFieldsBrowser, populateTimeline } from '../tasks/timeline';
3333

34-
import { HOSTS_PAGE } from '../urls/navigation';
34+
import { HOSTS_URL } from '../urls/navigation';
3535

3636
const defaultHeaders = [
3737
{ id: '@timestamp' },
@@ -47,7 +47,7 @@ const defaultHeaders = [
4747
describe('Fields Browser', () => {
4848
context('Fields Browser rendering', () => {
4949
before(() => {
50-
loginAndWaitForPage(HOSTS_PAGE);
50+
loginAndWaitForPage(HOSTS_URL);
5151
openTimeline();
5252
populateTimeline();
5353
openTimelineFieldsBrowser();
@@ -110,7 +110,7 @@ describe('Fields Browser', () => {
110110

111111
context('Editing the timeline', () => {
112112
before(() => {
113-
loginAndWaitForPage(HOSTS_PAGE);
113+
loginAndWaitForPage(HOSTS_URL);
114114
openTimeline();
115115
populateTimeline();
116116
openTimelineFieldsBrowser();

x-pack/plugins/security_solution/cypress/integration/inspect.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ import {
1919
openTimelineSettings,
2020
} from '../tasks/timeline';
2121

22-
import { HOSTS_PAGE, NETWORK_PAGE } from '../urls/navigation';
22+
import { HOSTS_URL, NETWORK_URL } from '../urls/navigation';
2323

2424
describe('Inspect', () => {
2525
context('Hosts stats and tables', () => {
2626
before(() => {
27-
loginAndWaitForPage(HOSTS_PAGE);
27+
loginAndWaitForPage(HOSTS_URL);
2828
});
2929
afterEach(() => {
3030
closesModal();
@@ -40,7 +40,7 @@ describe('Inspect', () => {
4040

4141
context('Network stats and tables', () => {
4242
before(() => {
43-
loginAndWaitForPage(NETWORK_PAGE);
43+
loginAndWaitForPage(NETWORK_URL);
4444
});
4545
afterEach(() => {
4646
closesModal();
@@ -57,7 +57,7 @@ describe('Inspect', () => {
5757
context('Timeline', () => {
5858
it('inspects the timeline', () => {
5959
const hostExistsQuery = 'host.name: *';
60-
loginAndWaitForPage(HOSTS_PAGE);
60+
loginAndWaitForPage(HOSTS_URL);
6161
openTimeline();
6262
executeTimelineKQL(hostExistsQuery);
6363
openTimelineSettings();

x-pack/plugins/security_solution/cypress/integration/navigation.spec.ts

Lines changed: 71 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,45 +16,107 @@ import {
1616
import { loginAndWaitForPage } from '../tasks/login';
1717
import { navigateFromHeaderTo } from '../tasks/security_header';
1818

19-
import { TIMELINES_PAGE } from '../urls/navigation';
19+
import {
20+
ALERTS_URL,
21+
CASES_URL,
22+
HOSTS_URL,
23+
KIBANA_HOME,
24+
MANAGEMENT_URL,
25+
NETWORK_URL,
26+
OVERVIEW_URL,
27+
TIMELINES_URL,
28+
} from '../urls/navigation';
29+
import { openKibanaNavigation, navigateFromKibanaCollapsibleTo } from '../tasks/kibana_navigation';
30+
import {
31+
ALERTS_PAGE,
32+
CASES_PAGE,
33+
HOSTS_PAGE,
34+
MANAGEMENT_PAGE,
35+
NETWORK_PAGE,
36+
OVERVIEW_PAGE,
37+
TIMELINES_PAGE,
38+
} from '../screens/kibana_navigation';
2039

2140
describe('top-level navigation common to all pages in the Security app', () => {
2241
before(() => {
23-
loginAndWaitForPage(TIMELINES_PAGE);
42+
loginAndWaitForPage(TIMELINES_URL);
2443
});
2544

2645
it('navigates to the Overview page', () => {
2746
navigateFromHeaderTo(OVERVIEW);
28-
cy.url().should('include', '/security/overview');
47+
cy.url().should('include', OVERVIEW_URL);
2948
});
3049

3150
it('navigates to the Alerts page', () => {
3251
navigateFromHeaderTo(ALERTS);
33-
cy.url().should('include', '/security/alerts');
52+
cy.url().should('include', ALERTS_URL);
3453
});
3554

3655
it('navigates to the Hosts page', () => {
3756
navigateFromHeaderTo(HOSTS);
38-
cy.url().should('include', '/security/hosts');
57+
cy.url().should('include', HOSTS_URL);
3958
});
4059

4160
it('navigates to the Network page', () => {
4261
navigateFromHeaderTo(NETWORK);
43-
cy.url().should('include', '/security/network');
62+
cy.url().should('include', NETWORK_URL);
4463
});
4564

4665
it('navigates to the Timelines page', () => {
4766
navigateFromHeaderTo(TIMELINES);
48-
cy.url().should('include', '/security/timelines');
67+
cy.url().should('include', TIMELINES_URL);
4968
});
5069

5170
it('navigates to the Cases page', () => {
5271
navigateFromHeaderTo(CASES);
53-
cy.url().should('include', '/security/cases');
72+
cy.url().should('include', CASES_URL);
5473
});
5574

5675
it('navigates to the Management page', () => {
5776
navigateFromHeaderTo(MANAGEMENT);
58-
cy.url().should('include', '/security/management');
77+
cy.url().should('include', MANAGEMENT_URL);
78+
});
79+
});
80+
81+
describe('Kibana navigation to all pages in the Security app ', () => {
82+
before(() => {
83+
loginAndWaitForPage(KIBANA_HOME);
84+
});
85+
beforeEach(() => {
86+
openKibanaNavigation();
87+
});
88+
it('navigates to the Overview page', () => {
89+
navigateFromKibanaCollapsibleTo(OVERVIEW_PAGE);
90+
cy.url().should('include', OVERVIEW_URL);
91+
});
92+
93+
it('navigates to the Alerts page', () => {
94+
navigateFromKibanaCollapsibleTo(ALERTS_PAGE);
95+
cy.url().should('include', ALERTS_URL);
96+
});
97+
98+
it('navigates to the Hosts page', () => {
99+
navigateFromKibanaCollapsibleTo(HOSTS_PAGE);
100+
cy.url().should('include', HOSTS_URL);
101+
});
102+
103+
it('navigates to the Network page', () => {
104+
navigateFromKibanaCollapsibleTo(NETWORK_PAGE);
105+
cy.url().should('include', NETWORK_URL);
106+
});
107+
108+
it('navigates to the Timelines page', () => {
109+
navigateFromKibanaCollapsibleTo(TIMELINES_PAGE);
110+
cy.url().should('include', TIMELINES_URL);
111+
});
112+
113+
it('navigates to the Cases page', () => {
114+
navigateFromKibanaCollapsibleTo(CASES_PAGE);
115+
cy.url().should('include', CASES_URL);
116+
});
117+
118+
it('navigates to the Management page', () => {
119+
navigateFromKibanaCollapsibleTo(MANAGEMENT_PAGE);
120+
cy.url().should('include', MANAGEMENT_URL);
59121
});
60122
});

x-pack/plugins/security_solution/cypress/integration/overview.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import { HOST_STATS, NETWORK_STATS } from '../screens/overview';
99
import { expandHostStats, expandNetworkStats } from '../tasks/overview';
1010
import { loginAndWaitForPage } from '../tasks/login';
1111

12-
import { OVERVIEW_PAGE } from '../urls/navigation';
12+
import { OVERVIEW_URL } from '../urls/navigation';
1313

1414
describe('Overview Page', () => {
1515
before(() => {
1616
cy.stubSecurityApi('overview');
17-
loginAndWaitForPage(OVERVIEW_PAGE);
17+
loginAndWaitForPage(OVERVIEW_URL);
1818
});
1919

2020
it('Host stats render with correct values', () => {

x-pack/plugins/security_solution/cypress/integration/search_bar.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ import { openAddFilterPopover, fillAddFilterForm } from '../tasks/search_bar';
99
import { GLOBAL_SEARCH_BAR_FILTER_ITEM } from '../screens/search_bar';
1010
import { hostIpFilter } from '../objects/filter';
1111

12-
import { HOSTS_PAGE } from '../urls/navigation';
12+
import { HOSTS_URL } from '../urls/navigation';
1313
import { waitForAllHostsToBeLoaded } from '../tasks/hosts/all_hosts';
1414

1515
// FAILING: https://github.com/elastic/kibana/issues/69595
1616
describe.skip('SearchBar', () => {
1717
before(() => {
18-
loginAndWaitForPage(HOSTS_PAGE);
18+
loginAndWaitForPage(HOSTS_URL);
1919
waitForAllHostsToBeLoaded();
2020
});
2121

x-pack/plugins/security_solution/cypress/integration/timeline_data_providers.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ import { loginAndWaitForPage } from '../tasks/login';
2222
import { openTimeline } from '../tasks/security_main';
2323
import { createNewTimeline } from '../tasks/timeline';
2424

25-
import { HOSTS_PAGE } from '../urls/navigation';
25+
import { HOSTS_URL } from '../urls/navigation';
2626

2727
describe('timeline data providers', () => {
2828
before(() => {
29-
loginAndWaitForPage(HOSTS_PAGE);
29+
loginAndWaitForPage(HOSTS_URL);
3030
waitForAllHostsToBeLoaded();
3131
});
3232

x-pack/plugins/security_solution/cypress/integration/timeline_flyout_button.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ import { loginAndWaitForPage } from '../tasks/login';
1111
import { openTimeline, openTimelineIfClosed } from '../tasks/security_main';
1212
import { createNewTimeline } from '../tasks/timeline';
1313

14-
import { HOSTS_PAGE } from '../urls/navigation';
14+
import { HOSTS_URL } from '../urls/navigation';
1515

1616
describe('timeline flyout button', () => {
1717
before(() => {
18-
loginAndWaitForPage(HOSTS_PAGE);
18+
loginAndWaitForPage(HOSTS_URL);
1919
waitForAllHostsToBeLoaded();
2020
});
2121

0 commit comments

Comments
 (0)