-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
local_test.ts
22 lines (13 loc) · 711 Bytes
/
local_test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// @ts-check
import { test, expect } from'@playwright/test';
test('Local Testing', async ({ page },testInfo) => {
try{
await page.evaluate(_ => {},`browserstack_executor: ${JSON.stringify({action: "setSessionName", arguments: {name:testInfo.project.name}})}`);
await page.waitForTimeout(5000);
await page.goto('https://www.example.com/');
await page.evaluate(_ => {}, `browserstack_executor: ${JSON.stringify({action: 'setSessionStatus',arguments: {status: 'passed',reason: 'Local success'}})}`);
} catch (e) {
console.log(e);
await page.evaluate(_ => {}, `browserstack_executor: ${JSON.stringify({action: 'setSessionStatus',arguments: {status: 'failed',reason: 'Local fail'}})}`);
}
});