-
Notifications
You must be signed in to change notification settings - Fork 798
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[frontend] Impossible to create a relationship from an entity "knowle…
…dge" view (#6343)
- Loading branch information
1 parent
373c14e
commit ac241d0
Showing
7 changed files
with
96 additions
and
6 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
20 changes: 20 additions & 0 deletions
20
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { expect, test } from '../fixtures/baseFixtures'; | ||
import IntrusionSetPage from '../model/intrusionSet.pageModel'; | ||
import IntrusionSetFormPage from '../model/intrusionSetForm.pageModel'; | ||
import IntrusionSetDetailsPage from '../model/intrusionSetDetails.pageModel'; | ||
|
||
test('Create a new relationship in intrusion set knowledge', async ({ page }) => { | ||
const intrusionSetPage = new IntrusionSetPage(page); | ||
const intrusionSetForm = new IntrusionSetFormPage(page); | ||
const intrusionSetDetailsPage = new IntrusionSetDetailsPage(page); | ||
await page.goto('/dashboard/threats/intrusion_sets'); | ||
await intrusionSetPage.addNewIntrusionSet(); | ||
await intrusionSetForm.fillNameInput('Test e2e'); | ||
await intrusionSetPage.getCreateIntrusionSetButton().click(); | ||
await intrusionSetPage.getItemFromList('Test e2e').click(); | ||
await expect(intrusionSetDetailsPage.getIntrusionSetDetailsPage()).toBeVisible(); | ||
await intrusionSetDetailsPage.getKnowledgeTab(); | ||
await intrusionSetDetailsPage.getVictimologyTab(); | ||
await intrusionSetDetailsPage.getCreateRelationshipButton().click(); | ||
await expect(intrusionSetDetailsPage.getStixCoreRelationshipCreationFromEntityComponent()).toBeVisible(); | ||
}); |
22 changes: 22 additions & 0 deletions
22
opencti-platform/opencti-front/tests_e2e/model/intrusionSet.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,22 @@ | ||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
import { Page } from '@playwright/test'; | ||
|
||
export default class IntrusionSetPage { | ||
constructor(private page: Page) {} | ||
|
||
getPage() { | ||
return this.page.getByTestId('instrusionSet-knowledge'); | ||
} | ||
|
||
addNewIntrusionSet() { | ||
return this.page.getByLabel('Add', { exact: true }).click(); | ||
} | ||
|
||
getCreateIntrusionSetButton() { | ||
return this.page.getByRole('button', { name: 'Create', exact: true }); | ||
} | ||
|
||
getItemFromList(name: string) { | ||
return this.page.getByRole('link', { name }).first(); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
opencti-platform/opencti-front/tests_e2e/model/intrusionSetDetails.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,30 @@ | ||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
import { Page } from '@playwright/test'; | ||
|
||
export default class IntrusionSetDetailsPage { | ||
constructor(private page: Page) {} | ||
|
||
getIntrusionSetDetailsPage() { | ||
return this.page.getByTestId('intrusionSet-details-page'); | ||
} | ||
|
||
getTitle(name: string) { | ||
return this.page.getByRole('heading', { name }); | ||
} | ||
|
||
getKnowledgeTab() { | ||
return this.page.getByRole('tab', { name: 'Knowledge' }).click(); | ||
} | ||
|
||
getVictimologyTab() { | ||
return this.page.getByRole('menuitem', { name: 'Victimology' }).click(); | ||
} | ||
|
||
getCreateRelationshipButton() { | ||
return this.page.getByLabel('Add', { exact: true }); | ||
} | ||
|
||
getStixCoreRelationshipCreationFromEntityComponent() { | ||
return this.page.getByRole('heading', { name: 'Create a relationship' }); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
opencti-platform/opencti-front/tests_e2e/model/intrusionSetForm.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,15 @@ | ||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
import { Page } from '@playwright/test'; | ||
|
||
export default class IntrusionSetFormPage { | ||
constructor(private page: Page) {} | ||
|
||
getNameInput() { | ||
return this.page.getByRole('textbox', { name: 'Name' }); | ||
} | ||
|
||
async fillNameInput(input: string) { | ||
await this.getNameInput().click(); | ||
return this.getNameInput().fill(input); | ||
} | ||
} |