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.
Merge branch 'develop' into format-date-time
- Loading branch information
Showing
59 changed files
with
656 additions
and
311 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
import {test, expect} from '@playwright/test'; | ||
import {Monitoring} from './page-object-models/monitoring'; | ||
import {Authoring} from './page-object-models/authoring'; | ||
import {MultiEdit} from './page-object-models/multiedit'; | ||
import {restoreDatabaseSnapshot, s} from './utils'; | ||
|
||
test.describe('Multiedit', async () => { | ||
test('editing articles in multi-edit mode', async ({page}) => { | ||
const monitoring = new Monitoring(page); | ||
const multiedit = new MultiEdit(page); | ||
|
||
await restoreDatabaseSnapshot(); | ||
await page.goto('/#/workspace/monitoring'); | ||
await monitoring.selectDeskOrWorkspace('Sports'); | ||
|
||
await monitoring.executeBulkAction('Multi-edit', ['test sports story', 'story 2']); | ||
|
||
await page | ||
.locator(s('multiedit-screen', 'multiedit-article=test sports story', 'field--headline')) | ||
.getByRole('textbox') | ||
.clear(); | ||
await page | ||
.locator(s('multiedit-screen', 'multiedit-article=test sports story', 'field--headline')) | ||
.getByRole('textbox') | ||
.fill('test sports story 1.1'); | ||
|
||
await multiedit.save('test sports story'); | ||
|
||
await page | ||
.locator(s('multiedit-screen', 'multiedit-article=story 2', 'field--headline')) | ||
.getByRole('textbox') | ||
.clear(); | ||
await page | ||
.locator(s('multiedit-screen', 'multiedit-article=story 2', 'field--headline')) | ||
.getByRole('textbox') | ||
.fill('story 2.1'); | ||
|
||
await multiedit.save('story 2'); | ||
|
||
await page.locator(s('multiedit-subnav')).getByRole('button', {name: 'exit'}).click(); | ||
|
||
await monitoring.executeActionOnMonitoringItem( | ||
page.locator(s('article-item=test sports story 1.1')), | ||
'Edit', | ||
); | ||
await expect( | ||
page.locator(s('authoring', 'field--headline')).getByRole('textbox'), | ||
).toHaveText('test sports story 1.1'); | ||
|
||
await monitoring.executeActionOnMonitoringItem( | ||
page.locator(s('article-item=story 2.1')), | ||
'Edit', | ||
); | ||
await expect( | ||
page.locator(s('authoring', 'field--headline')).getByRole('textbox'), | ||
).toHaveText('story 2.1'); | ||
}); | ||
|
||
test('removing an article from multi-edit view', async ({page}) => { | ||
const monitoring = new Monitoring(page); | ||
const authoring = new Authoring(page); | ||
|
||
await restoreDatabaseSnapshot(); | ||
await page.goto('/#/workspace/monitoring'); | ||
|
||
await monitoring.selectDeskOrWorkspace('Sports'); | ||
|
||
await monitoring.executeActionOnMonitoringItem( | ||
page.locator(s('article-item=test sports story')), | ||
'Edit', | ||
); | ||
await authoring.executeActionInEditor( | ||
'Multiedit', | ||
'OK', | ||
); | ||
|
||
await page.locator(s('multiedit-screen', 'multiedit-article=test sports story')).hover(); | ||
await page | ||
.locator(s('multiedit-screen', 'multiedit-article=test sports story')) | ||
.getByRole('button', {name: 'remove item'}) | ||
.click(); | ||
await expect(page.locator(s('multiedit-screen', 'multiedit-article=test sports story'))).not.toBeVisible(); | ||
}); | ||
}); |
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,19 @@ | ||
import {Page} from '@playwright/test'; | ||
import {s} from '../utils'; | ||
|
||
export class MultiEdit { | ||
private page: Page; | ||
|
||
constructor(page: Page) { | ||
this.page = page; | ||
} | ||
|
||
async save(article: string): Promise<void> { | ||
await this.page.locator(s('multiedit-screen', `multiedit-article=${article}`)).hover(); | ||
|
||
await this.page | ||
.locator(s('multiedit-screen', `multiedit-article=${article}`)) | ||
.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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
9 changes: 3 additions & 6 deletions
9
scripts/apps/authoring-react/article-widgets/comments/index.tsx
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
Oops, something went wrong.