Created
February 7, 2023 09:14
-
-
Save dev-jonghoonpark/a7eafec1661610cca4c5719fa1394401 to your computer and use it in GitHub Desktop.
use dci (describe, context, it) pattern in playwright (playwright 에서 dci 패턴 사용하기)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { test, expect } from '@playwright/test'; | |
function describe(title, callback) { | |
return test.describe(title, callback) | |
} | |
function context(title, callback) { | |
return test.describe(title, callback) | |
} | |
function it(title, callback) { | |
return test(title, callback); | |
} | |
export { describe, context, it, test, expect } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { describe, context, it, expect } from '../../util/playwright/pattern/dci'; | |
describe('playwright 메인페이지', () => { | |
context('시작 버튼을 누르면', () => { | |
it('get started link 페이지로 이동한다.', async ({ page }) => { | |
await page.goto('https://playwright.dev/'); | |
// Click the get started link. | |
await page.getByRole('link', { name: 'Get started' }).click(); | |
// Expects the URL to contain intro. | |
await expect(page).toHaveURL(/.*intro/); | |
}) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment