-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* extracts methods to tasks * uses cypress api for assertions * refactor * Inspect refactor * fixes rebase issue
- Loading branch information
1 parent
ecc8240
commit 24ac6d2
Showing
5 changed files
with
149 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export const INSPECT_BUTTON_ICON = '[data-test-subj="inspect-icon-button"]'; | ||
export const INSPECT_MODAL = '[data-test-subj="modal-inspect-euiModal"]'; | ||
|
||
export interface InspectButtonMetadata { | ||
altInspectId?: string; | ||
id: string; | ||
title: string; | ||
tabId?: string; | ||
} | ||
|
||
export const INSPECT_HOSTS_BUTTONS_IN_SIEM: InspectButtonMetadata[] = [ | ||
{ | ||
id: '[data-test-subj="stat-hosts"]', | ||
title: 'Hosts Stat', | ||
}, | ||
{ | ||
id: '[data-test-subj="stat-authentication"]', | ||
title: 'User Authentications Stat', | ||
}, | ||
{ | ||
id: '[data-test-subj="stat-uniqueIps"]', | ||
title: 'Unique IPs Stat', | ||
}, | ||
{ | ||
id: '[data-test-subj="table-allHosts-loading-false"]', | ||
title: 'All Hosts Table', | ||
tabId: '[data-test-subj="navigation-allHosts"]', | ||
}, | ||
{ | ||
id: '[data-test-subj="table-authentications-loading-false"]', | ||
title: 'Authentications Table', | ||
tabId: '[data-test-subj="navigation-authentications"]', | ||
}, | ||
{ | ||
id: '[data-test-subj="table-uncommonProcesses-loading-false"]', | ||
title: 'Uncommon processes Table', | ||
tabId: '[data-test-subj="navigation-uncommonProcesses"]', | ||
}, | ||
{ | ||
altInspectId: `[data-test-subj="events-viewer-panel"] ${INSPECT_BUTTON_ICON}`, | ||
id: '[data-test-subj="events-container-loading-false"]', | ||
title: 'Events Table', | ||
tabId: '[data-test-subj="navigation-events"]', | ||
}, | ||
]; | ||
|
||
export const INSPECT_NETWORK_BUTTONS_IN_SIEM: InspectButtonMetadata[] = [ | ||
{ | ||
id: '[data-test-subj="stat-networkEvents"]', | ||
title: 'Network events Stat', | ||
}, | ||
{ | ||
id: '[data-test-subj="stat-dnsQueries"]', | ||
title: 'DNS queries Stat', | ||
}, | ||
{ | ||
id: '[data-test-subj="stat-uniqueFlowId"]', | ||
title: 'Unique flow IDs Stat', | ||
}, | ||
{ | ||
id: '[data-test-subj="stat-tlsHandshakes"]', | ||
title: 'TLS handshakes Stat', | ||
}, | ||
{ | ||
id: '[data-test-subj="stat-UniqueIps"]', | ||
title: 'Unique private IPs Stat', | ||
}, | ||
{ | ||
id: '[data-test-subj="table-topNFlowSource-loading-false"]', | ||
title: 'Source IPs Table', | ||
}, | ||
{ | ||
id: '[data-test-subj="table-topNFlowDestination-loading-false"]', | ||
title: 'Destination IPs Table', | ||
}, | ||
{ | ||
id: '[data-test-subj="table-dns-loading-false"]', | ||
title: 'Top DNS Domains Table', | ||
tabId: '[data-test-subj="navigation-dns"]', | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { INSPECT_BUTTON_ICON, InspectButtonMetadata } from '../screens/inspect'; | ||
|
||
import { DEFAULT_TIMEOUT } from '../tasks/login'; | ||
|
||
export const closesModal = () => { | ||
cy.get('[data-test-subj="modal-inspect-close"]', { timeout: DEFAULT_TIMEOUT }).click(); | ||
}; | ||
|
||
export const openStatsAndTables = (table: InspectButtonMetadata) => { | ||
if (table.tabId) { | ||
cy.get(table.tabId).click({ force: true }); | ||
} | ||
cy.get(table.id, { timeout: DEFAULT_TIMEOUT }); | ||
if (table.altInspectId) { | ||
cy.get(table.altInspectId, { timeout: DEFAULT_TIMEOUT }).trigger('click', { | ||
force: true, | ||
}); | ||
} else { | ||
cy.get(`${table.id} ${INSPECT_BUTTON_ICON}`, { | ||
timeout: DEFAULT_TIMEOUT, | ||
}).trigger('click', { force: true }); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters