这是我的第一个黄瓜测试用例,我很难弄清楚一件事。所以我已经有一个检查用户创建的测试。我想添加更多步骤,例如用户创建创建帐户和创建产品并为这些对象设置一些属性。
这是用户创建功能文件
@no-database-cleaner
Feature: Creating an user account
In order to use Recdns portal
I need to create an user account
Scenario: Successful user account creation
Given the database contains no test data
And I am on the homepage
When I attempt to create the following user account:
| email address | password | confirm password |
| abc@company1.com | password | password |
# User is automatically logged in
Then I should see "Welcome!" message on page
And an ar_id is set for the user
And
When I click "Sign Out"
Then I should see "Signed out"
When I attempt to sign in with following user account:
| email address | password |
| abc@company1.com | password |
Then I should see "Welcome!" message on page
Scenario Outline: Verify error message when user failed to sign in
Given there is a user
And I am on the homepage
And I try to login with email "<email address>", password "<password>"
Then I should see "<error message>" message on page
Examples:
| email address | password | error message |
| testuser@company1.com | abc1234 | Invalid email or password |
| testuserdoesnotexist@company1.com | password | Invalid email or password |
Scenario Outline: Verify error message when user failed to sign up
Given I am on the homepage
And I click "Sign Up"
And I try to create user with email "<email address>", password "<password>", confirm password "<confirm password>"
Then I should see "<error message>" message on page
Examples:
| email address | password | confirm password | error message |
| abc@company1.com | abc123 | abc123 | Email has already been taken |
| xyz@test | abc123 | abc123 | Email is invalid |
| | abc123 | abc123 | Email can't be blank |
| abc@company1.com | | abc123 | Password can't be blank |
| abc@company1.com | abc123 | | Password doesn't match confirmation |
| abc@company1.com | abc1 | abc1 | Password is too short |
所以我可以在哪里添加创建帐户表和产品表的步骤。谢谢