Skip to content

Latest commit

 

History

History
59 lines (42 loc) · 1.8 KB

README.md

File metadata and controls

59 lines (42 loc) · 1.8 KB

SpecFlow-RestSharp Demo

Feature File

A Scenario Outline with Examples table is used for data-driven testing.

@users
Feature: Users

	@get @listUsers
	Scenario Outline: ListUsers_FindByName_ReturnUser
		Given The list of users is requested
		When The name '<firstName>' '<lastName>' is searched
		Then The user exists

		Examples:
			| firstName | lastName |
			| Janet     | Weaver   |
			| Rachel    | Howell   |

Environment Variables

Create an env.json file under the ReqRes.Specs project.

env

{
  "BASE_URL": "https://reqres.in",
  "EMAIL": "youremail@domain.com",
  "PASSWORD": "yoursecret"
}

The file only creates runtime env vars. It is automatically ignored by Git and no sensitive data is committed to the repository.

GitHub Actions

Configuration variables and secrets are now managed at CI-level.

vars

secrets

github-actions.yml:

env:
  BASE_URL: ${{ vars.BASE_URL }}
  EMAIL: ${{ vars.EMAIL }}
  PASSWORD: ${{ secrets.PASSWORD }}

The secret PASSWORD is never exposed.

Note:

The same feature is present in all major devops products like Azure Pipelines, GitLab CI/CD, and Bitbucket Pipelines.