반응형

playwright 8

Playwright Python: Tutorial #5 - API Testing

Playwright Python: Tutorial #5 - API Testing Tutorial #1 https://helloahram.tistory.com/221 Tutorial #2 https://helloahram.tistory.com/222Tutorial #3 https://helloahram.tistory.com/223Tutorial # 4 https://helloahram.tistory.com/224   API Testing Playwright 공식 문서 https://playwright.dev/python/docs/api-testing API Testing 으로 Server API 를 시험하고 Server Side Post Condition 을 Validate 할 수 있다  APIReques..

TIL 2025.02.28

Playwright Python: Tutorial #4 - Browser Context

Playwright Python: Tutorial #4 - Browser ContextTutorial #1 https://helloahram.tistory.com/221 Tutorial #2 https://helloahram.tistory.com/222Tutorial #3 https://helloahram.tistory.com/223  Browser Context Playwright 공식 문서 https://playwright.dev/python/docs/api/class-browsercontext  BrowserContext는 여러 개의 독립적인 브라우저 세션을 운영하는 방법을 제공한다 Browser 에 Cookie 를 넣을 수도 있고, 테스트 환경을 격리하여 성능을 최적화 할 수도 있다 # https..

TIL 2025.02.27

Playwright Python: Tutorial #3 - Test Generator

Playwright Python: Tutorial #3 - Test Generator Tutorial #1 https://helloahram.tistory.com/221 Tutorial #2 https://helloahram.tistory.com/222  Codegen 을 이용하여 Test Code 를 간단하게 생성할 수 있다 Playwright 공식 문서 https://playwright.dev/python/docs/codegen-introplaywright codegen https://www.saucedemo.com Inspector 의 Code 를 복사해서 내가 필요한 것만 사용할 수 있다 # https://youtu.be/IRTeqUXkPbA?si=ZhBPwp9c6E1mKzLjimport refr..

TIL 2025.02.24

Playwright Python: Tutorial #2 - Pytest

Playwright Python: Tutorial #2 - PytestTutorial #1 https://helloahram.tistory.com/221  Pytest Plugin 을 설치해준다 pip install playwright pytest-playwrightplaywright install # Playwright Browser 설치 파일명은 제일 앞에 test_ 또는 제일 뒤에 _test 로 만들어준다 ex. test_webpage.py or webpage_test.py  Test Code 를 작성할 때는 반.드.시!🔥 테스트 함수의 이름 제일 앞에 test_ 를 적어줘야 한다 🔥그리고 본문에는 아래와 같은 Test Code 예시를 작성해 준다 # https://youtu.be/IDrTac..

TIL 2025.02.21

Playwright Python: Tutorial #1 - async, Browser

Playwright Python: Tutorial #1 - async, BrowserPlaywright 설치는 https://helloahram.tistory.com/210 참고  Playwright 설치하고 사용하기 w/ PythonPlaywright 는 Microsoft 에서 개발한 오픈 소스 자동화 도구이다 Selenium 과 유사하지만, Chromium, Firefox, WebKit 등 여러 브라우저 엔진을 지원하며 보다 빠르고 안정적인 자동화를 제공하고, 모바일 환helloahram.tistory.com 1. ScreenShot 찍기 - Sync sync_playwright 를 사용하여 동기적으로 작동하는 Playwright API 를 호출한다각 작업은 이전 작업이 끝날 때까지 기다리면서 순차적..

TIL 2025.02.20

Assertion 개념과 사용 w/ Playwright

Assertion 이 프로그래밍에서 어떤 의미일까? 1. 주장 Claim → 이 조건이 반드시 참이어야 한다 Assert 를 사용하면 이 조건이 True 라고 단언 (assert) 한다는 의미, 프로그램이 예상대로 동작하지 않으면, "이건 틀렸다!" 라고 강하게 주장하며 실행을 중단하는 역할을 한다 assert 2 + 2 == 4 # ✅ 이건 항상 참이므로 오류 없음assert 2 + 2 == 5 # ❌ AssertionError 발생 (틀린 주장)2. 권리 행사 Exercise of a Right → 잘못된 걸 방지한다 Assertion 은 프로그램이 잘못된 상태로 실행되지 않도록 보호하는 역할을 한다 def withdraw(amount, balance): assert amount  Asser..

TIL 2025.02.19

Playwright 작성해보기 w/ Python

Playwright 로 감별마켓 홈 화면에서 도깨비 시장 제일 첫번째 컨텐츠 진입하여 상품 구매하기 버튼 선택 > 네이버쇼핑 화면으로 이동하고 상품 이름 긁어오는 것까지 진행해봤다sync 로 진행했는데 다음에는 async 로도 해봐야지 locator 가져오는 거를 좀 더 알아봐야겠다 https://playwright.dev/docs/locators Locators | PlaywrightIntroductionplaywright.dev import refrom playwright.sync_api import Playwright, sync_playwright, expectdef run(playwright: Playwright) -> None: browser = playwright.chromium.laun..

TIL 2025.02.18

Playwright 설치하고 사용하기 w/ Python

Playwright 는 Microsoft 에서 개발한 오픈 소스 자동화 도구이다 Selenium 과 유사하지만, Chromium, Firefox, WebKit 등 여러 브라우저 엔진을 지원하며 보다 빠르고 안정적인 자동화를 제공하고, 모바일 환경을 시뮬레이션할 수 있다 Cypress 는 자체 문법과 실행 환경을 제공하지만, Playwright 는 기존 언어의 문법을 지원한다 NodeJS, JavaScript, Python, Java, .NET 등 다양한 언어로 사용할 수 있다 Playwright 는 비동기 기능도 지원한다, 로컬에서 비동기 API 를 사용하는 것은 무료지만Playwright Testing 같은 클라우드 기능은 유료로 제공된다 Playwright 설치하기 Python 으로 Playwrigh..

MAC 2025.02.04
반응형