I want to perform a test case where I'm trying to login with different credentials and check the error message. How this can be done in 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
Here's where I want to pass the two args, username and password:
When('I log in with (string) and (string)', (username,password) => {
p.loginWith(username, password)
})