Skip to content

Commit c579fe2

Browse files
test: add dropped-button-visible-on-thumb test
1 parent f04e1f6 commit c579fe2

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { test, expect } from '@playwright/test';
2+
import {
3+
dragAndDrop,
4+
getByShapeTypeInThumb,
5+
getLocatorPosition,
6+
} from '../helpers';
7+
8+
test('drop button in canvas, ensure is visible on thumb', async ({ page }) => {
9+
await page.goto('');
10+
11+
// Drag & drop button in canvas
12+
const button = page.getByAltText('Button', { exact: true });
13+
await expect(button).toBeVisible();
14+
15+
const position = await getLocatorPosition(button);
16+
const targetPosition = { x: position.x + 500, y: position.y };
17+
await dragAndDrop(page, position, targetPosition);
18+
19+
// Open Pages panel
20+
await page.getByText('Pages').click();
21+
22+
// Verify button is visible in thumb
23+
const buttonInThumb = await getByShapeTypeInThumb(page, 0, 'button');
24+
expect(buttonInThumb).toBeDefined();
25+
});

0 commit comments

Comments
 (0)