-
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.
[Endpoint] Functional Tests cleanup (#68756)
* Removed several unnecessary disabled eslint rules * moved common pageobject from endpoint_list to page_utils * Rename functional_endpoint to security_solution_endpoint * Delete `functional_endpoint_ingest_failure` no longer applicable
- Loading branch information
1 parent
28d9c14
commit 577381d
Showing
26 changed files
with
95 additions
and
173 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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
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
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
30 changes: 0 additions & 30 deletions
30
x-pack/test/functional_endpoint/page_objects/page_utils.ts
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
x-pack/test/functional_endpoint_ingest_failure/apps/endpoint/index.ts
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
x-pack/test/functional_endpoint_ingest_failure/apps/endpoint/landing_page.ts
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
x-pack/test/functional_endpoint_ingest_failure/ftr_provider_context.d.ts
This file was deleted.
Oops, something went wrong.
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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
76 changes: 76 additions & 0 deletions
76
x-pack/test/security_solution_endpoint/page_objects/page_utils.ts
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,76 @@ | ||
/* | ||
* 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 { FtrProviderContext } from '../ftr_provider_context'; | ||
import { WebElementWrapper } from '../../../../test/functional/services/lib/web_element_wrapper'; | ||
|
||
export function EndpointPageUtils({ getService }: FtrProviderContext) { | ||
const testSubjects = getService('testSubjects'); | ||
const find = getService('find'); | ||
|
||
return { | ||
/** | ||
* Finds a given EuiCheckbox by test subject and clicks on it | ||
* | ||
* @param euiCheckBoxTestId | ||
*/ | ||
async clickOnEuiCheckbox(euiCheckBoxTestId: string) { | ||
// This utility is needed because EuiCheckbox forwards the test subject on to | ||
// the actual `<input>` which is not actually visible/accessible on the page. | ||
// In order to actually cause the state of the checkbox to change, the `<label>` | ||
// must be clicked. | ||
const euiCheckboxLabelElement = await find.byXPath( | ||
`//input[@data-test-subj='${euiCheckBoxTestId}']/../label` | ||
); | ||
|
||
await euiCheckboxLabelElement.click(); | ||
}, | ||
|
||
/** | ||
* Finds the Table with the given `selector` (test subject) and returns | ||
* back an array containing the table's header column text | ||
* | ||
* @param selector | ||
* @returns Promise<string[]> | ||
*/ | ||
async tableHeaderVisibleText(selector: string) { | ||
const $ = await (await testSubjects.find(selector)).parseDomContent(); | ||
return $('thead tr th') | ||
.toArray() | ||
.map((th) => | ||
$(th) | ||
.text() | ||
.replace(/ /g, '') | ||
.trim() | ||
); | ||
}, | ||
|
||
/** | ||
* Finds a table and returns the data in a nested array with row 0 is the headers if they exist. | ||
* It uses euiTableCellContent to avoid poluting the array data with the euiTableRowCell__mobileHeader data. | ||
* @param dataTestSubj | ||
* @returns Promise<string[][]> | ||
*/ | ||
async tableData(dataTestSubj: string) { | ||
await testSubjects.exists(dataTestSubj); | ||
const hostTable: WebElementWrapper = await testSubjects.find(dataTestSubj); | ||
const $ = await hostTable.parseDomContent(); | ||
return $('tr') | ||
.toArray() | ||
.map((row) => | ||
$(row) | ||
.find('.euiTableCellContent') | ||
.toArray() | ||
.map((cell) => | ||
$(cell) | ||
.text() | ||
.replace(/ /g, '') | ||
.trim() | ||
) | ||
); | ||
}, | ||
}; | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.