Skip to content

Commit

Permalink
Update 2023-08-22-BDD中的step可复用性调研.md
Browse files Browse the repository at this point in the history
  • Loading branch information
shihai1991 committed Aug 22, 2023
1 parent 6ef3492 commit 0ac3d11
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion _posts/2023-08-22-BDD中的step可复用性调研.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,30 @@ time: '2023.08.22 17:21:00'
# 二、可行性分析
## 2.1 given\when\then复用
### 2.1.1 [Chorus BDD](https://www.chorus-bdd.org/)
Chrous在[Step Macro](https://www.chorus-bdd.org/pages/GherkinExtensions/StepMacro/)中描述了一种行为复用的逻辑,这种逻辑能让行为和实现继续分层管理,从而不让技术来破坏行为描述的完整性。
Chrous在[Step Macro](https://www.chorus-bdd.org/pages/GherkinExtensions/StepMacro/)中描述了一种行为复用的逻辑,这种逻辑能让行为和实现继续分层管理,从而不让技术来破坏行为描述的完整性。具体的示例如下所示:
```yaml
#file: login.stepmacro
Step-Macro: I log in as user <user> with password <password>
Given I click the login button
And the login dialog is shown
When I type <user> into the field username
And I type <password> into the field password
And I click the OK button

#file: login.feature
Feature: Log In

Scenario: I can log in using the login form
Given I log in as user Nick with password myPassword
Then I am logged in as the user Nick

#file: accountSummary.feature
Feature: Account Summary

Scenario: Account summary link is shown when logged in
Given I log in as user Nick with password myPassword
Then the account summary link is visible on homepage
```
## step实现函数复用
Expand Down

0 comments on commit 0ac3d11

Please sign in to comment.