mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-24 20:41:49 +03:00
25 lines
811 B
TypeScript
25 lines
811 B
TypeScript
import { test } from '@affine-test/kit/playwright';
|
|
import type { Page } from '@playwright/test';
|
|
import { expect } from '@playwright/test';
|
|
|
|
async function openStorybook(page: Page) {
|
|
return page.goto(`http://localhost:6006`);
|
|
}
|
|
|
|
test('Basic', async ({ page }) => {
|
|
await openStorybook(page);
|
|
await page.click('#storybook-explorer-tree >> #affine-button');
|
|
await page.click('#affine-button--test');
|
|
|
|
const iframe = page.frameLocator('iframe');
|
|
await iframe.locator('input[data-testid="test-input"]').type('Hello World!');
|
|
|
|
expect(
|
|
await iframe.locator('input[data-testid="test-input"]').inputValue()
|
|
).toBe('Hello World!');
|
|
await iframe.locator('[data-testid="clear-button"]').click();
|
|
expect(
|
|
await iframe.locator('input[data-testid="test-input"]').textContent()
|
|
).toBe('');
|
|
});
|