我正在尝试学习 BDD cucumber,并且正在尝试为具有有效和无效用户名的登录场景编写功能文件。对于有效用户将被记录并注销,但是对于无效用户名,用户将被要求再次进入登录页面并要求写入正确的凭据。
我想问一下,《情景大纲》中能有正反两面吗?你能帮我为这个简单的场景编写完美的功能文件吗?看看我的功能文件代码(PS,我是初学者:))
Feature: Login Action
Description: This feature will test a LogIn and LogOut functionality
Scenario Outline: Login with valid and Invalid Credentials
Given User is on Home Page
When User navigate to Login Page
Then User enters "<username>" and "<password>"
And Keeping case as Valid
Then User should get logged in
And Message displayed Login Successfully
Then User enters "<username>" and "<password>"
And Keeping case as InValid
Then user will be asked to go back to login page
And Provide correct credentials
Examples:
|username|password|Case|
|abc@gmail.com|12345|Valid|
|abc1@gmail.com|dfsd2|InValid|
Scenario: Successful logout from application
When user logs out from application
Then Message displayed Logout successfully
And Browser quit by driver