-
Notifications
You must be signed in to change notification settings - Fork 799
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[frontend] e2e create report + lot of page models
- Loading branch information
Showing
50 changed files
with
876 additions
and
162 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
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
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
8 changes: 4 additions & 4 deletions
8
opencti-platform/opencti-front/tests_e2e/Export file/exportReport.spec.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
2 changes: 1 addition & 1 deletion
2
opencti-platform/opencti-front/tests_e2e/dashboard/createDashboard.spec.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
2 changes: 1 addition & 1 deletion
2
opencti-platform/opencti-front/tests_e2e/dashboard/updateDashboard.spec.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
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
2 changes: 1 addition & 1 deletion
2
opencti-platform/opencti-front/tests_e2e/groupings/createGrouping.spec.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
4 changes: 2 additions & 2 deletions
4
opencti-platform/opencti-front/tests_e2e/intrusionSet/createIntrusionSetRelationship.spec.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
37 changes: 37 additions & 0 deletions
37
opencti-platform/opencti-front/tests_e2e/model/field/AutocompleteField.pageModel.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,37 @@ | ||
import { Locator, Page } from '@playwright/test'; | ||
|
||
export default class AutocompleteFieldPageModel { | ||
private readonly inputLocator: Locator; | ||
private readonly parentLocator: Locator; | ||
|
||
constructor( | ||
private readonly page: Page, | ||
private readonly label: string, | ||
private readonly multiple: boolean, | ||
readonly rootLocator?: Locator, | ||
) { | ||
this.inputLocator = (rootLocator ?? page).getByRole('combobox', { name: label }); | ||
this.parentLocator = this.inputLocator.locator('../../../..'); | ||
} | ||
|
||
async selectOption(option: string) { | ||
await this.inputLocator.click(); | ||
await this.inputLocator.fill(option); | ||
const list = this.page.getByRole('listbox', { name: this.label }); | ||
return list.getByText(option, { exact: true }).click(); | ||
} | ||
|
||
getOption(option: string) { | ||
return this.multiple | ||
? this.parentLocator.getByRole('button', { name: option }) | ||
: this.inputLocator; | ||
} | ||
|
||
openAddOptionForm() { | ||
return this.parentLocator.getByRole('button', { name: 'Add', exact: true }).click(); | ||
} | ||
|
||
getByText(input: string) { | ||
return this.parentLocator.getByText(input); | ||
} | ||
} |
Oops, something went wrong.