mirror of
https://github.com/web-infra-dev/midscene.git
synced 2025-07-08 01:21:19 +00:00
21 lines
550 B
TypeScript
21 lines
550 B
TypeScript
import { sleep } from '@midscene/core/utils';
|
|
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);
|
|
}
|
|
await ai(
|
|
'type "midscene github" in search box, hit Enter, sleep 5s, and open the github page in result list',
|
|
);
|
|
|
|
await sleep(5000);
|
|
await aiAssert('the page is "midscene github"');
|
|
});
|