-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
add rename thumb page
- Loading branch information
Showing
1 changed file
with
34 additions
and
0 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,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(); | ||
}); |