fix :: try to error log with try-catch
This commit is contained in:
parent
1473584f8a
commit
d48ddeee0e
|
|
@ -1261,10 +1261,11 @@ test('test with custom location', async ({ runInlineTest }) => {
|
||||||
};
|
};
|
||||||
`,
|
`,
|
||||||
'a.test.ts': `
|
'a.test.ts': `
|
||||||
import { test } from '@playwright/test';
|
import { test, expect } from '@playwright/test';
|
||||||
import { customStep } from './helper';
|
import { customStep } from './helper';
|
||||||
|
|
||||||
test('test with custom location', async ({ page }) => {
|
test('test with custom location', async ({ page }) => {
|
||||||
|
try {
|
||||||
await customStep(test, 'User logs in', async () => {
|
await customStep(test, 'User logs in', async () => {
|
||||||
await page.goto('http://localhost:1234/login');
|
await page.goto('http://localhost:1234/login');
|
||||||
await page.fill('input#username', 'testuser');
|
await page.fill('input#username', 'testuser');
|
||||||
|
|
@ -1274,6 +1275,10 @@ test('test with custom location', async ({ runInlineTest }) => {
|
||||||
const profileVisible = await page.isVisible('.profile');
|
const profileVisible = await page.isVisible('.profile');
|
||||||
expect(profileVisible).toBeTruthy();
|
expect(profileVisible).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
} catch (e) {
|
||||||
|
console.error('Login test failed:', e);
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
`
|
`
|
||||||
}, { reporter: '', workers: 1 });
|
}, { reporter: '', workers: 1 });
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue