From 905e5ffa3770e435a29067997cf0a8d94e0010a5 Mon Sep 17 00:00:00 2001 From: osohyun0224 <53892427+osohyun0224@users.noreply.github.com> Date: Mon, 16 Sep 2024 23:38:36 +0900 Subject: [PATCH] fix :: change to expected result 1 --- tests/playwright-test/test-step.spec.ts | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/tests/playwright-test/test-step.spec.ts b/tests/playwright-test/test-step.spec.ts index b040dff233..c4638ce325 100644 --- a/tests/playwright-test/test-step.spec.ts +++ b/tests/playwright-test/test-step.spec.ts @@ -1261,11 +1261,10 @@ test('test with custom location', async ({ runInlineTest }) => { }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; - import { customStep } from './helper'; + import { test } from '@playwright/test'; + import { customStep } from './helper'; - test('test with custom location', async ({ page }) => { - try { + test('test with custom location', async ({ page }) => { await customStep(test, 'User logs in', async () => { await page.goto('http://localhost:1234/login'); await page.fill('input#username', 'testuser'); @@ -1275,15 +1274,11 @@ test('test with custom location', async ({ runInlineTest }) => { const profileVisible = await page.isVisible('.profile'); expect(profileVisible).toBeTruthy(); }); - } catch (e) { - console.error('Login test failed:', e); - throw e; - } - }); - ` + }); + ` }, { reporter: '', workers: 1 }); - expect(result.exitCode).toBe(0); + expect(result.exitCode).toBe(1); expect(result.outputLines).toEqual([ 'hook |Before Hooks', 'test.step |User logs in @ custom-file.ts:99', @@ -1328,7 +1323,7 @@ test('nested step test with custom locations', async ({ runInlineTest }) => { ` }, { reporter: '', workers: 1 }); - expect(result.exitCode).toBe(0); + expect(result.exitCode).toBe(1); expect(result.outputLines).toEqual([ 'hook |Before Hooks', 'test.step |Outer step @ nested-steps.ts:10',