반응형 전체 글82 Playwright 설치 및 수행 Playwright는 Microsoft에서 개발한 오픈소스 엔드투엔드(E2E) 테스트 자동화 도구1. Playwright와 TypeScript란?Playwright:웹 애플리케이션을 테스트하고 브라우저 동작을 자동화할 수 있는 강력한 도구.TypeScript:JavaScript의 상위 집합으로, 정적 타입 검사와 더불어 코드 품질을 높여줌.장점:TypeScript와 Playwright를 함께 사용하면 타입 안정성과 자동 완성을 통해 더 효율적으로 테스트 코드를 작성할 수 있음. 2. Playwright 설치npm init playwright@latestChoose between TypeScript or JavaScript (default is TypeScript) > //언어 선택Name of your .. 2025. 1. 21. ghghghghghg prod, gov의 UI만 약간 다를 경우 page object나 components에서 추가로 구현후 test에서 불러서 사용하기 ui-playwright/├── tests/ # Main folder for all test cases│ ├── mysql.spec.ts # component test│ ├── end-to-end/ # End-to-end tests covering full workflows│ └── ... (other components) # Specific tests for validating different components├── pages/ .. 2024. 11. 29. Playwright와 Await Playwright에서, JavaScript와 TypeScript에서 사용되는 것처럼 await는 비동기 작업을 처리하기 위해 사용됩니다. Playwright의 API 함수는 종종 비동기 작업의 완료(또는 실패)를 나타내는 Promise 객체를 반환합니다. await를 사용하면 코드 실행이 해당 Promise가 해결될 때까지 기다리게 되어, 비동기 코드를 동기 코드처럼 쉽게 읽고 작성할 수 있습니다. 비동기 작업:페이지로 이동하기 (page.goto()), 요소를 클릭하기 (locator.click()), 텍스트 필드를 채우기 (locator.fill())와 같은 Playwright 작업은 모두 비동기입니다. 이러한 작업은 네트워크 요청, DOM 상호작용, 또는 브라우저 이벤트를 기다리는 동안 즉시 완.. 2024. 11. 28. Playwright Assertion 파해치기 - Typescript Playwright에서 TypeScript를 사용할 때, Playwright의 내장 expect 라이브러리가 제공하는 다양한 assertion이 있습니다 기본 assertion기본 값이나 조건을 확인 import { expect } from '@playwright/test';// 기본 값에 대한 어설션expect(5).toBe(5);expect('Hello').toEqual('Hello');expect(true).toBeTruthy();expect(null).toBeNull();expect([1, 2, 3]).toContain(2); 페이지 및 로케이터 assertionPlaywright는 웹 요소에 대한 특화 (ex. 페이지내용, 가시성, 요소속성)import { test, expect } from .. 2024. 11. 28. 이전 1 2 3 4 ··· 21 다음 반응형