forked from superdesk/superdesk-client-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
57 additions
and
6 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
e2e/client/playwright/settings.metadata-editor-block.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,33 @@ | ||
import {test} from '@playwright/test'; | ||
import {restoreDatabaseSnapshot, s} from './utils'; | ||
|
||
test('creation and persistance of a custom block', async ({page}) => { | ||
await restoreDatabaseSnapshot(); | ||
await page.goto('/#/settings/vocabularies'); | ||
await page.getByRole('button', {name: 'Custom blocks'}).click(); | ||
await page.getByRole('button', {name: 'Add New'}).click(); | ||
|
||
// Input sample data | ||
await page.locator(s('vocabulary-edit-content', 'vocabulary-edit--id')).fill('test_vocabulary'); | ||
await page.locator(s('vocabulary-edit-content', 'vocabulary-edit-field--name')).fill('test_vocabulary'); | ||
await page.locator(s('vocabulary-edit-content', 'editor3')).getByRole('textbox').fill('test data'); | ||
|
||
// Add formatting options to template editor | ||
await page.locator(s('vocabulary-edit-content', 'open-popover')).click(); | ||
await page.locator(s('tree-select-popover')).getByRole('button', {name: 'h2'}).click(); | ||
await page.locator(s('editor3')).getByText('test data').click(); | ||
|
||
// Apply formatting option to sample text data | ||
await page.locator(s('editor3', 'formatting-option=H2')).click(); | ||
|
||
await page.locator(s('vocabulary-edit-footer')).getByRole('button', {name: 'Save'}).click(); | ||
|
||
// Edit custom block | ||
await page.locator(s('vocabulary-item=test_vocabulary')).hover().then(async () => { | ||
await page.locator(s('vocabulary-item=test_vocabulary', 'vocabulary-item--start-editing')).click(); | ||
|
||
// Remove formatting option | ||
await page.locator(s('editor3', 'formatting-option=H2')).click(); | ||
await page.locator(s('vocabulary-edit-footer')).getByRole('button', {name: 'Save'}).click(); | ||
}); | ||
}); |
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