Skip to content

Playwright

Playwright enables reliable end-to-end testing for modern web apps.

Features

  • Any browser • Any platform • One API
  • Cross-browser. Playwright supports all modern rendering engines, including Chromium, WebKit and Firefox.
  • Cross-platform. Test on Windows, Linux and macOS, locally or on CI, headless or headed.
  • Cross-language. Use the Playwright API in TypeScript, JavaScript, Python, .NET, Java.
  • Test Mobile Web. Native mobile emulation of Google Chrome for Android and Mobile Safari. Same rendering engine works on your Desktop and in the Cloud.

Playwright 1.22.0 이후

  • Playwright Test 로 웹 컴포넌트 테스트
    • 모든 기능(병렬화, 에뮬레이션, 디버깅 등) 사용 가능
    • React, Vue.js, Svelte 지원
    • 컴포넌트 테스트용 index.html을 자동 생성
    • 브라우저가 실제로 로딩하고, 테스트는 Node.js에서 실행
    • Vite 사용
  • .toHaveScreenshot() assert 추가
  • ARIA role/attr 등으로 선택 가능

Playwright로 액션 녹화

playwright의 최대 장점 중 하나인 record 기능을 쓰기 위해서는 아래 명령어를 입력하면 된다. 그러면 wikipedia.org 웹페이지가 열리게 되고 사용자가 입력한 액션을 python이나 javascript 등으로 알아서 작성해준다. 그 뒤 원하는 부분을 수정해주면 빠르게 코드 작성이 가능하다.

playwright codegen wikipedia.org

See also

Favorite site