수색…


소개

QTP와 Selenium에서 오이를 플러그인으로 사용할 수 있습니다. 오이 시나리오의 단계는 전역 변수입니다. 한 번 구현하고 여러 번 호출 할 수 있습니다. 따라서 코드 유지 관리가 줄어들며 필요한 경우 동일한 코드를 재사용 할 수 있습니다.

비고

오이 특징은 Gherkin 언어로 쓰여지고 접미사 .feature 있는 파일에 저장됩니다. 이 항목에서는 작은 오이의 각 기능에 대한 예제를 제공합니다.

최소 오이 특징

기능 / documentation.feature에서 :

Feature: Documentation

  Scenario: User views documentation
    When I go to the "Cucumber" documentation
    Then I should see the "Cucumber" documentation

최소 기능에는 Feature Line과 When , Then 또는 다른 Gherkin 키워드로 시작되는 하나 이상의 단계가있는 Scenario 가 있습니다.

합리적인 시나리오는 아마도 한 단계 이상을 가질 것입니다.

시나리오 개요

아래의 템플릿

Scenario Outline: As a homemaker i want to buy and pay for the below product
  Given I purchase <a product>
    And I require a carry bag to take things to home
  When I pay bill using <payment method> to successfully checkout
  Then I should have a receipt

Examples:
| a product     | payment method |
|  Cake         | Visa           |
|  Coke         | Paypal         |

구문 사용법

Feature: Some terse yet descriptive text of what is desired
     Textual description of the business value of this feature
     Business rules that govern the scope of the feature
     Any additional information that will make the feature easier to understand

Background:
    Given some precondition needed for all scenarios in this file
        And another precondition

Scenario: Some determinable business situation
  Textual description of the business value of this scenario
  Business rules that govern the scope of the scenario
  Any additional information that will make the scenario easier to understand
    Given some precondition
      And some other precondition
    When some action by the actor
      And some other action
      And yet another action
    Then some testable outcome is achieved
      And something else we can check happens too
      But something else we can check does not happen

Scenario Outline: Some determinable business situation
    Given I am <precondition>
        And some other precondition
    When some action by the actor
    Then I have <outcome> rights

Examples:
    | precondition | outcome  |
    | username1    | customer |
    | username2    | admin    |

다음 키워드는 상호 교환 가능하지만 컨텍스트에 따라 사용하는 것이 더 좋습니다.

  • Feature: | Ability: | Business Need:
  • Scenario Outline: | Scenario Template:
  • Examples: | Scenarios:
  • Given | When | Then | And | But | * |


Modified text is an extract of the original Stack Overflow Documentation
아래 라이선스 CC BY-SA 3.0
와 제휴하지 않음 Stack Overflow