Implement parameterization to the Test Scenario using outline / example keyword BDD Library
Scenario outline
과 examples
키워드를 이용하여 하나의 scenario에 대해 몇몇 변수에 대해 반복적으로 실행해볼 수도 있습니다.
Scenario outline and Examples
Scenario Outline: Verify AddBook API functionality
# Enter steps here
Given the Book details with <isbn> and <aisle>
When We execute the AddBook PostAPI method
Then book is successfully added
Examples:
|isbn | aisle |
|dfdf | 23219 |
|isbn1 | 234212 |
Scenario outline
을 사용하면 , 본문 안에서 <>
를 사용하여 example의 맨 첫번째 row (column name)을 지정해주고, 이것을 parameter화 해줄 수 있게됩니다.
Module
@given("the Book details with {isbn} and {aisle}")
def step_impl(context, isbn, aisle):
"""
:type context: behave.runner.Context
:type isbn: str
:type aisle: str
"""
print("start Scenario Outline")
context.add_book_url = getConfig()['API']['endpoint'] + APIResourses.add_book
query = "select * from books"
context.payload = addBookPayLoad(isbn, aisle)
위 시나리오의 given
라인은, 위와 같이 isbn
, aisle
을 파라미터로 넘겨받는 모듈을 작성하여 구현할 수 있습니다.
Author And Source
이 문제에 관하여(Implement parameterization to the Test Scenario using outline / example keyword BDD Library), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://velog.io/@dahunyoo/Implement-parameterization-to-the-Test-Scenario-using-outline-example-keyword-BDD-Library저자 귀속: 원작자 정보가 원작자 URL에 포함되어 있으며 저작권은 원작자 소유입니다.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)