稳定AI游戏创作界面异步测试
等待运行活动投影完成后再断言详情 放宽高负载下预览授权状态的有界等待 保持产品运行与预览行为不变
This commit is contained in:
@@ -6858,23 +6858,29 @@ export function registerProjectSupervisorSurfaceTests() {
|
||||
|
||||
await driver.submit('生成同 revision 首次验证');
|
||||
await driver.emitValidation(1, 1000);
|
||||
await waitFor(() => {
|
||||
expect(
|
||||
driver.invoke.mock.calls.filter(
|
||||
([command]) => command === 'start_local_game_preview',
|
||||
),
|
||||
).toHaveLength(1);
|
||||
expect(driver.readAuthorization()).toBeNull();
|
||||
});
|
||||
await waitFor(
|
||||
() => {
|
||||
expect(
|
||||
driver.invoke.mock.calls.filter(
|
||||
([command]) => command === 'start_local_game_preview',
|
||||
),
|
||||
).toHaveLength(1);
|
||||
expect(driver.readAuthorization()).toBeNull();
|
||||
},
|
||||
{ timeout: 3000 },
|
||||
);
|
||||
|
||||
await driver.submit('同一 Run 新授权后重新验证同一 revision');
|
||||
await waitFor(() => {
|
||||
expect(driver.readAuthorization()).toMatchObject({
|
||||
afterRevision: 1,
|
||||
afterValidatedAt: 1000,
|
||||
authorizationId: expect.any(String),
|
||||
});
|
||||
});
|
||||
await waitFor(
|
||||
() => {
|
||||
expect(driver.readAuthorization()).toMatchObject({
|
||||
afterRevision: 1,
|
||||
afterValidatedAt: 1000,
|
||||
authorizationId: expect.any(String),
|
||||
});
|
||||
},
|
||||
{ timeout: 3000 },
|
||||
);
|
||||
await driver.emitValidation(1, 2000);
|
||||
expect(
|
||||
await screen.findByLabelText('游戏运行', {}, { timeout: 3000 }),
|
||||
@@ -7149,11 +7155,16 @@ export function registerProjectSupervisorSurfaceTests() {
|
||||
});
|
||||
expect(screen.queryByText('等待新的运行事件')).toBeNull();
|
||||
fireEvent.click(screen.getByRole('button', { name: '运行详情' }));
|
||||
expect(
|
||||
within(screen.getByLabelText('最近运行活动')).getByText(
|
||||
/新受理 Run 正在执行/,
|
||||
),
|
||||
).not.toBeNull();
|
||||
await waitFor(
|
||||
() => {
|
||||
expect(
|
||||
within(screen.getByLabelText('最近运行活动')).getByText(
|
||||
/新受理 Run 正在执行/,
|
||||
),
|
||||
).not.toBeNull();
|
||||
},
|
||||
{ timeout: 2500 },
|
||||
);
|
||||
harness.setProjectRevision(4);
|
||||
await act(async () => {
|
||||
harness.emitAgentRuntime(
|
||||
|
||||
Reference in New Issue
Block a user