diff --git a/e2e/client/playwright/multiedit.spec.ts b/e2e/client/playwright/multiedit.spec.ts deleted file mode 100644 index 9b492310dd..0000000000 --- a/e2e/client/playwright/multiedit.spec.ts +++ /dev/null @@ -1,84 +0,0 @@ -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(); - }); -}); diff --git a/e2e/client/playwright/page-object-models/monitoring.ts b/e2e/client/playwright/page-object-models/monitoring.ts index 6b5c32596b..0c2b17e7b1 100644 --- a/e2e/client/playwright/page-object-models/monitoring.ts +++ b/e2e/client/playwright/page-object-models/monitoring.ts @@ -38,15 +38,6 @@ export class Monitoring { .click(); } - async executeBulkAction(action: string, articleNames: Array): Promise { - for (const selectedArticle of articleNames) { - await this.page.locator(s(`article-item=${selectedArticle}`, 'item-type-and-multi-select')).hover(); - await this.page.locator(s(`article-item=${selectedArticle}`, 'multi-select-checkbox')).check(); - } - - await this.page.locator(s('multi-action-bar', 'multi-actions-inline', action)).click(); - } - async createArticleFromTemplate(template: string, options?: {slugline?:string, body_html?: string}): Promise { await this.page.locator(s('content-create')).click(); await this.page.locator(s('content-create-dropdown')).getByRole('button', {name: 'More Templates...'}).click(); diff --git a/e2e/client/playwright/page-object-models/multiedit.ts b/e2e/client/playwright/page-object-models/multiedit.ts deleted file mode 100644 index 15b7d16cff..0000000000 --- a/e2e/client/playwright/page-object-models/multiedit.ts +++ /dev/null @@ -1,19 +0,0 @@ -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 { - 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(); - } -} diff --git a/scripts/apps/authoring/multiedit/views/multiedit.html b/scripts/apps/authoring/multiedit/views/multiedit.html index a74fdd83ac..76a67630e8 100644 --- a/scripts/apps/authoring/multiedit/views/multiedit.html +++ b/scripts/apps/authoring/multiedit/views/multiedit.html @@ -1,8 +1,8 @@ -