2025-02-21 16:15:51 +08:00
|
|
|
import { sleep } from '@midscene/core/utils';
|
2025-02-14 21:54:47 +08:00
|
|
|
import { test } from './fixture';
|
|
|
|
|
|
|
|
test.beforeEach(async ({ page }) => {
|
|
|
|
await page.goto('https://cn.bing.com');
|
|
|
|
});
|
|
|
|
|
|
|
|
const CACHE_TIME_OUT = process.env.MIDSCENE_CACHE;
|
|
|
|
|
|
|
|
test('test open new tab', async ({ page, ai, aiAssert, aiQuery }) => {
|
|
|
|
if (CACHE_TIME_OUT) {
|
|
|
|
test.setTimeout(200 * 1000);
|
|
|
|
}
|
2025-02-21 16:15:51 +08:00
|
|
|
await ai(
|
|
|
|
'type "midscene github" in search box, hit Enter, sleep 5s, and open the github page in result list',
|
|
|
|
);
|
|
|
|
|
|
|
|
await sleep(5000);
|
2025-02-14 21:54:47 +08:00
|
|
|
await aiAssert('the page is "midscene github"');
|
|
|
|
});
|