오이와 극작가/JUnit 5 - 기능 파일
기능 파일
Cucumber steps are actions that a user can be imagined to take. Given is what actions are used to set up the test. When is what actions are taken to do the testing. Then is what result you want to see. For the 3rd example, we are intentionally filling out the form with the wrong result and expecting a certain error message to show up.
Cucumber allows annotations to tag what grouping you want your tests to belong to. This allows easier searching when you generate your reports later on.
Scenario outlines allow the same scenario to be run multiple times using the Examples section as a dataset.
In the below example we are testing a happy path. The user starts off navigating to the page using the Given step. The user then fills in the form with the When step. The site requires the user to make a calculation to prove they are not a robot so we calculate it, fill in the sum and hit submit. These are implemented with When steps. The Then step is to verify the submission was successful.
Feature: Register for Demo Request
@HappyPath
Scenario Outline: User is able to request a Demo
Given User navigates to PHPTRAVELS Demo Page
When User fills in Demo Request Form <firstName>, <lastName>, <businessName>, <email>
When User calculates and fills result
When User clicks submit
Then Verify thank you text
Examples:
| firstName | lastName | businessName | email |
| "ABC" | "DEF" | "Main Inc." | "[email protected]" |
Now for the below step, it's almost the exact same except we are intentionally not filling out the calculation. In this case we are testing the page's validation. The Then step in this case is verifying the correct alert is displayed to the user.
@Validation
Scenario Outline: User is able to request a Demo but does not fill out result
Given User navigates to PHPTRAVELS Demo Page
When User fills in Demo Request Form <firstName>, <lastName>, <businessName>, <email>
When User clicks submit
Then Verify alert "Please input result number"
Examples:
| firstName | lastName | businessName | email |
| "ABC" | "DEF" | "Main Inc." | "[email protected]" |
Reference
이 문제에 관하여(오이와 극작가/JUnit 5 - 기능 파일), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://dev.to/terencepan/playwright-with-cucumberjunit-5-feature-file-3dmn텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)