Scenario Outline

Seunghoon Yoo·2024년 3월 31일
post-thumbnail

개요

  • behave 프레임워크에는 테스트 케이스를 효율적으로 관리할 수 있는 Scenario Outline 기법이 있음
  • 동일한 테스트 시나리오에 다른 데이터 세트를 이용하여 여러번 실행하는 것으로, 테스트 커버리지를 높여주는 장점

기존의 시나리오 문법

  • Gherkin 으로 작성
Scenario: 로그인 시나리오
	Given launch the NAVER homepage with chrome browser
	When input the "id" and "password"
	And click the login button
	Then ...

시나리오 아웃라인 문법

  • Gherkin 으로 작성
Scenario Outline: 로그인 시나리오
	Given launch the NAVER homepage with chrome browser
	When input the "<id>" and "<password>"
	And click the login button
	Then ...
	Examples:
		|id|password|
		|id1|pw1|
		|id2|pw2|
		|id3|pw3|
		...
  • 기존 시나리오는 스텝을 1회 수행하지만, 시나리오 아웃라인은 데이터 개수만큼 실행
  • 물론 Examples 에 명시된 각각 다른 데이터 세트로 수행
profile
QA Engineer

0개의 댓글