3
약 1 년 전 오이를 사용했기 때문에 시나리오 작성에 익숙해졌습니다. 오이 시나리오에 특정 UI 단계가 포함되어야합니까?
Scenario: user tries to vote on a comment
Given I have a post
And I have a comment on that post
And I am logged in as a different user
And I am on the post page
When I click on "upvote" within the "comment"
Then the comment score should raise
And the comment author should get points
그러나 최근에 나는 그들이 나쁜 관행으로 간주하고 있기 때문에 같은
When I click on "upvote" within the "comment"
같은 기본 단계 정의는 더 이상 사용할 수없는 오이 1.1 이후, 그것을 발견했다. 어떻게 의미가 있는지 알 수 있지만 지금은 필자의 기능을 어떻게 추상화해야하는지 잘 모르겠습니다.
예를 들어 생각해보십시오.
When I upvote on a comment
Then the comment should get points
이하 추상적
Given I have a post with a comment
And I'm not the author
When I upvote on the comment
Then the comment author should get points
또는 덜 추상적 인
Given I have a post with a comment
And I'm not the author
When I upvote on the comment
Then the comment score should increase
And the comment author should get 1 point
또는 Given
부분 내가 아는
Given I have a post with a comment
And I'm not the author
And I am on the page for that post
When I upvote on the comment
Then the comment score should increase
And the comment author should get 1 point
에서 매우 구체적인이 preferrence의 문제입니다 ,하지만 난 여기에 모범 사례를 찾기 위해 경쟁하고 있습니다. 시나리오를 지정하는 가장 좋은 방법은 무엇입니까?