add tests (#536)

This commit is contained in:
zuomeng wang
2022-11-28 13:17:34 +00:00
committed by GitHub
parent 7392a9bfc5
commit 5eb7830c13
11 changed files with 122 additions and 9 deletions

View File

@@ -1,8 +1,7 @@
import { test, expect, type Page } from '@playwright/test';
import { loadPage } from './libs/load-page';
test.beforeEach(async ({ page }) => {
await page.goto('http://localhost:3000');
});
loadPage();
test.describe('Change Theme', () => {
test('default white', async ({ page }) => {
@@ -28,7 +27,7 @@ test.describe('Change Theme', () => {
await expect(box?.x).not.toBeUndefined();
await page.mouse.move((box?.x ?? 0) + 5, (box?.y ?? 0) + 5);
await page.waitForTimeout(3000);
await page.waitForTimeout(1000);
const darkButton = page.locator('[data-testid=change-theme-dark]');
const darkButtonPositionTop = await darkButton.evaluate(