In order to run these automated test cases, simply copy and paste them into the TF
Automate (https://automate.testfirst.com/) and run them locally or remotely.
Browser
Scenario: Step 1 - Visit testfirst.com and check for "Forgot password?" link
Given browser "Chrome"
When I visit "https://www.testfirst.com/"
And I click "Sign In"
And I wait for 2 seconds
Then "Sign In" page is displayed
Scenario: Step 2 - User tries login with a wrong username and password
When I wait for 2 seconds
And I visit "https://www.testfirst.com/"
And I click "Sign In"
And I type "test_user" in "Username"
And I type "Password" in "Password"
And I click "SIGN IN"
Then "Invalid username/email or password" is displayed
Scenario: Step 3 - User hovers on RESOURCES and checks that "Product Guide" is visible
When I wait for 2 seconds
And I visit "https://www.testfirst.com/"
And I click "Resources"
And I wait for 1 second
Then "Quick Start Guide" is displayed
API/HTTP
Scenario: Step 1 - Send POST request with JSON body
Given POST HTTP request
When I set request body to JSON of
"""
{
"Number": 10,
"String": "Some text"
}
"""
And I add "Cookie" header "MyCookie1=123;"
And I send request to "https://bit.ly/SampleEndpointUrl"
Then request should complete successfully
And response status should be 200
Scenario: Step 2 - Verify response
When I save response body to "response" variable
And I extract value from "response" variable with jsonpath "$.success" to "isSuccess" variable
Then "{{isSuccess}}" should be equal to "true"
Console/Shell
For security reasons, the endpoint given in below is a dummy environment, therefore, if you try running the test as below, it would fail. Please replace host, port, username and password to an environment of your own choosing and try that way! |
Scenario: Step 1 - Establish shell session and create a file
Given shell session to
"""
{
"type": "ssh",
"host": "127.0.0.1",
"port": 22,
"basicAuth": {
"username": "bugra",
"password": "123456"
}
}
"""
When I run command "touch my.file"
Then command should complete successfully
Scenario: Step 2 - Run ls command and see that the file is indeed created
When I run command "ls"
Then command should complete successfully
And command output should contain "my.file"
And command output should not contain "other.file"
Comments
0 comments
Article is closed for comments.