We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我看了下comfy的前端测试,他们相当于是在Playwright的基础上又搭了一套框架,咱们没必要搞那么复杂,直接用Playwright就行。
虽然没法直接操作canvas里的节点,但是可以根据xy定位操作,只需要一些固定的测试用工作流。下面这段代码就是一个简单的节点移动测试: test('move node test', async ({ page }) => { await page.goto('http://127.0.0.1:8188/'); await page.waitForTimeout(1000); await page.getByLabel('Workflows (w)').click(); await page.getByLabel('BizyAirMoveTest.json').locator('div').first().click(); await page.locator('#graph-canvas').click({ position: { x: 732, y: 259 } }); await page.mouse.down(); await page.mouse.move(1058, 204); await page.mouse.up(); await expect(page).toHaveScreenshot('move_node.png'); }); 效果如下:
test('move node test', async ({ page }) => {
await page.goto('http://127.0.0.1:8188/');
await page.waitForTimeout(1000);
await page.getByLabel('Workflows (w)').click();
await page.getByLabel('BizyAirMoveTest.json').locator('div').first().click();
await page.locator('#graph-canvas').click({
position: {
x: 732,
y: 259
}
});
await page.mouse.down();
await page.mouse.move(1058, 204);
await page.mouse.up();
await expect(page).toHaveScreenshot('move_node.png');
当然还有很多要考虑,比如测试怎么写保障通用、需要哪些测试、github action怎么触发等等。 我计划先搭好workflow写几个示例,后面慢慢完善。
The text was updated successfully, but these errors were encountered:
wjymtg
No branches or pull requests
我看了下comfy的前端测试,他们相当于是在Playwright的基础上又搭了一套框架,咱们没必要搞那么复杂,直接用Playwright就行。
虽然没法直接操作canvas里的节点,但是可以根据xy定位操作,只需要一些固定的测试用工作流。下面这段代码就是一个简单的节点移动测试:
test('move node test', async ({ page }) => {
await page.goto('http://127.0.0.1:8188/');
await page.waitForTimeout(1000);
await page.getByLabel('Workflows (w)').click();
await page.getByLabel('BizyAirMoveTest.json').locator('div').first().click();
await page.locator('#graph-canvas').click({
position: {
x: 732,
y: 259
}
});
await page.mouse.down();
await page.mouse.move(1058, 204);
await page.mouse.up();
await expect(page).toHaveScreenshot('move_node.png');
});
效果如下:
2024-12-09.18-31-58.mp4
当然还有很多要考虑,比如测试怎么写保障通用、需要哪些测试、github action怎么触发等等。
我计划先搭好workflow写几个示例,后面慢慢完善。
The text was updated successfully, but these errors were encountered: