You can use the following Steps separated in Given, When and Then Steps.
Example:
Given The host "localhost"
Example:
Given The port "5432"
Example:
Given The database "pgcumber"
Example:
When I use username "admin"
Example:
When I use username from environment variable "PSQL_USERNAME"
Example:
When I use username from file "psql_username"
Example:
When I use password "admin"
Example:
When I use password from environment variable "PSQL_PASSWORD"
Example:
When I use password from file "psql_password"
Example:
When I connect to the server
Example:
Then the connection is successful
Example:
Then I am a database superuser
Example:
Then I am not a database superuser
Example:
Then the schema "public" exists
Example:
Then the user has "USAGE" privilege on schema "public"
Example:
Then the table "user" exists in schema "public"
Example:
Then the current user has "SELECT" privilege on table "public.user"