別の資格情報でログインしようとするテスト ケースを実行し、エラー メッセージを確認したいと考えています。これはCucumberでどのように行うことができますか?
Feature: Login
Login Test Suite
Background:
Given I'm on the login page
Scenario: 01. Should not be able to login with invalid cred
When I log in with "username" and "password"
| username | password | ExpectedError |
| asdasd | anything | Invalid credentials specified |
| | anything | Please specify a username |
| asdasd | | Please specify a password |
| | | No username or password specified |
Then An error msg should appear
ここで、ユーザー名とパスワードの 2 つの引数を渡します。
When('I log in with (string) and (string)', (username,password) => {
p.loginWith(username, password)
})