2023-04-25 06:12:48 +03:00
|
|
|
import { test } from '@affine-test/kit/playwright';
|
2023-03-03 05:00:56 +03:00
|
|
|
import { expect } from '@playwright/test';
|
|
|
|
|
2023-04-17 00:02:41 +03:00
|
|
|
test('should broadcast a message to all debug pages', async ({
|
|
|
|
page,
|
|
|
|
context,
|
|
|
|
}) => {
|
|
|
|
await page.goto('http://localhost:8080/_debug/broadcast');
|
|
|
|
const page2 = await context.newPage();
|
|
|
|
await page2.goto('http://localhost:8080/_debug/broadcast');
|
|
|
|
await page.waitForSelector('#__next');
|
|
|
|
await page2.waitForSelector('#__next');
|
|
|
|
await page.click('[data-testid="create-page"]');
|
|
|
|
expect(await page.locator('tr').count()).toBe(2);
|
|
|
|
expect(await page2.locator('tr').count()).toBe(2);
|
|
|
|
await page2.click('[data-testid="create-page"]');
|
|
|
|
expect(await page.locator('tr').count()).toBe(3);
|
|
|
|
expect(await page2.locator('tr').count()).toBe(3);
|
2023-03-03 05:00:56 +03:00
|
|
|
});
|