Skip to content

Commit

Permalink
move hovering into save fn
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaskikutis committed Aug 1, 2024
1 parent 9a8fa14 commit 6e7cbf7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 4 additions & 4 deletions e2e/client/playwright/multiedit.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
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 {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);
const multiedit = new MultiEdit(page);

await restoreDatabaseSnapshot();
await page.goto('/#/workspace/monitoring');
Expand All @@ -23,7 +23,7 @@ test.describe('Multiedit', async () => {
.locator(s('multiedit-screen', 'multiedit-article=test sports story', 'field--headline'))
.getByRole('textbox')
.fill('test sports story 1.1');
await page.locator(s('multiedit-screen', 'multiedit-article=test sports story')).hover();

await multiedit.save('test sports story');

await page
Expand All @@ -34,7 +34,7 @@ test.describe('Multiedit', async () => {
.locator(s('multiedit-screen', 'multiedit-article=story 2', 'field--headline'))
.getByRole('textbox')
.fill('story 2.1');
await page.locator(s('multiedit-screen', 'multiedit-article=story 2')).hover();

await multiedit.save('story 2');

await page.locator(s('multiedit-subnav')).getByRole('button', {name: 'exit'}).click();
Expand Down
4 changes: 3 additions & 1 deletion e2e/client/playwright/page-object-models/multiedit.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import {Page} from '@playwright/test';
import {s} from '../utils';

export class Multiedit {
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'})
Expand Down

0 comments on commit 6e7cbf7

Please sign in to comment.