Skip to content

Commit

Permalink
Merge pull request #580 from Lemoncode/feature/#550-QA-rename-thumb-page
Browse files Browse the repository at this point in the history
add rename thumb page
  • Loading branch information
brauliodiez authored Nov 26, 2024
2 parents b50d020 + 9ea9bd8 commit b852295
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions e2e/inline-edit/rename-thumb-page.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { test, expect } from '@playwright/test';

test('rename-thumb-page-through-direct-edit-and-context-menu', async ({
page,
}) => {
await page.goto('');

await page.getByText('Pages').click();
const thumb = page.getByText('Page 1', { exact: true });
await expect(thumb).toBeVisible();
await expect(thumb).toHaveText('Page 1');

await thumb.dblclick();
const input = page.getByRole('textbox');
const newTextContent = 'Change the name';
await input.fill(newTextContent);
await page.keyboard.press('Enter');
const renamedPage = page.getByText(newTextContent, { exact: true });
await expect(renamedPage).toBeVisible();

const siblingElement = page.getByText('Change the name', { exact: true });
const divThumb = siblingElement.locator('..');
await divThumb.click({ button: 'right' });
await page.getByText('Rename').click();

const secondNewTextContent = 'Other name';
await expect(input).toBeVisible();
await input.fill(secondNewTextContent);
await page.keyboard.press('Enter');
const secondRenamedPage = page.getByText(secondNewTextContent, {
exact: true,
});
await expect(secondRenamedPage).toBeVisible();
});

0 comments on commit b852295

Please sign in to comment.