1

レタス テスト (django) で背景を作成するにはどうすればよいですか。バックグラウンドは各シナリオの前に実行されます。

Feature: Multiple site support
  As a Mephisto site owner
  I want to host blogs for different people
  In order to make gigantic piles of money

  Background:
    Given a global administrator named "Greg"
    And a blog named "Greg's anti-tax rants"
    And a customer named "Dr. Bill"
    And a blog named "Expensive Therapy" owned by "Dr. Bill"

  Scenario: Dr. Bill posts to his own blog
    Given I am logged in as Dr. Bill
    When I try to post to "Expensive Therapy"
    Then I should see "Your article was published."

  Scenario: Dr. Bill tries to post to somebody else's blog, and fails
    Given I am logged in as Dr. Bill
    When I try to post to "Greg's anti-tax rants"
    Then I should see "Hey! That's not your blog!"
4

1 に答える 1

1

たとえばBackgroundレタスで使用できます(ここから取得):

Feature: Simple and successful
  As the Lettuce maintainer
  In order to make sure the output is pretty
  I want to automate its test

  Background:
    Given the variable "X" holds 2

  Scenario: multiplication changing the value
    Given the variable "X" is equal to 2
于 2013-08-30T04:39:19.960 に答える