Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<base.api.url>https://rickandmortyapi.com/api</base.api.url>
<cucumber.stepsDefinitions>--glue io/lippia/api/lowcode/steps --glue ar/steps</cucumber.stepsDefinitions>
<cucumber.hooks>--glue com/crowdar/bdd/cukes --glue ar/apiExampleProject/hook</cucumber.hooks>
<cucumber.tags>@petstore</cucumber.tags>
<cucumber.tags>@Clockify</cucumber.tags>
<cucumber.reporters>--plugin pretty --plugin ar.reports.CucumberReporter: </cucumber.reporters>
<crowdar.cucumber.option>src/test/resources/features ${cucumber.hooks} ${cucumber.stepsDefinitions} --tags 'not @Ignore' --tags ${cucumber.tags} ${cucumber.reporters}</crowdar.cucumber.option>
<crowdar.projectType>API</crowdar.projectType>
Expand Down
134 changes: 74 additions & 60 deletions src/test/resources/features/Sample.feature
Original file line number Diff line number Diff line change
@@ -1,60 +1,74 @@
@Sample
Feature: Sample

Background:
And header Content-Type = application/json
And header Accept = */*


@RickAndMorty
Scenario Outline: Get character
Given base url env.base_url_rickAndMorty
And endpoint character/<id_character>
When execute method GET
Then the status code should be 200
And response should be $.name = <name>
And response should be $.status = <status>
And validate schema character.json

Examples:
| id_character | name | status |
| 1 | Rick Sanchez | Alive |
| 2 | Morty Smith | Alive |

@petstore
Scenario Outline: Add a new pet to the store
Given base url env.base_url_petstore
And endpoint pet
And header accept = application/json
And header Content-Type = application/json
And body body.json
When execute method POST
Then the status code should be 200
And response should be name = <name>
And validate schema pet.json

Examples:
| name |
| doggie |

@petstore
Scenario Outline: Add a new pet to the store
Given base url env.base_url_petstore
And endpoint pet
And header accept = application/json
And header Content-Type = application/json
And delete keyValue tags[0].id in body body.json
And set value 15 of key tags[1].id in body body.json
And set value "tag2" of key tags[1].name in body body.json
When execute method POST
Then the status code should be 200
And response should be name = <name>
And validate schema pet.json

Examples:
| name |
| doggie |




@Clockify
Feature: clockify
@Listar_espacios_de_trabajos
Scenario:listar espacios de trabajos
Given base url https://api.clockify.me/api
And endpoint /v1/workspaces
And header Content-Type = application/json
And header Accept = */*
And header x-api-key = NGRhZjQ2ZTMtYTczYS00ZDk2LTk3ZGMtNDQ0MDNjZTFkNTFi
When execute method GET
Then the status code should be 200
* define workspaceId = $.[0].id

@ListarClientes
Scenario: Listar clientes
Given call Sample.feature@Listar_espacios_de_trabajos
And base url https://api.clockify.me/api
And endpoint /v1/workspaces/{{workspaceId}}/clients
And header Content-Type = application/json
And header Accept = */*
And header x-api-key = NGRhZjQ2ZTMtYTczYS00ZDk2LTk3ZGMtNDQ0MDNjZTFkNTFi
When execute method GET
Then the status code should be 200

@Agregar_clientes_a_Workspaces
Scenario: Agregar clientes
Given call Sample.feature@Listar_espacios_de_trabajos
And base url https://api.clockify.me/
And endpoint api/v1/workspaces/{{workspaceId}}/clients
And header Content-Type = application/json
And header Accept = */*
And header x-api-key = NGRhZjQ2ZTMtYTczYS00ZDk2LTk3ZGMtNDQ0MDNjZTFkNTFi
And body addClient.json
When execute method POST
Then the status code should be 201
* define idClient = $.id

@DeleteClient @Execute
Scenario:Eliminar cliente
Given call Sample.feature@Agregar_clientes_a_Workspaces
And base url https://api.clockify.me/api/
And endpoint v1/workspaces/{{workspaceId}}/clients/{{idClient}}
And header Content-Type = application/json
And header Accept = */*
And header x-api-key = NGRhZjQ2ZTMtYTczYS00ZDk2LTk3ZGMtNDQ0MDNjZTFkNTFi
When execute method DELETE
Then the status code should be 200

@CrearWorkspaces
Scenario: Crear workspaces
Given base url https://api.clockify.me/api/
And endpoint /v1/workspaces
And header Content-Type = application/json
And header Accept = */*
And header x-api-key = NGRhZjQ2ZTMtYTczYS00ZDk2LTk3ZGMtNDQ0MDNjZTFkNTFi
And set value "Work5" of key name in body addWorkspaces.json
When execute method POST
Then the status code should be 201
















6 changes: 6 additions & 0 deletions src/test/resources/jsons/bodies/addClient.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"address": "Direcion01",
"email": "[email protected]",
"name": "newClient6",
"note": "Ninguna nota"
}
3 changes: 3 additions & 0 deletions src/test/resources/jsons/bodies/addWorkspaces.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name": "string"
}