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>@ClockiFail</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
173 changes: 173 additions & 0 deletions src/test/resources/features/Clockifail.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
@ClockiFail
Feature: Caminos con errores

@GetWorkspace´sE400 #Reemplazo el GET por POST
Scenario: Trae la lista completa de workspace´s
Given base url https://api.clockify.me
And endpoint /api/v1/workspaces
And header Content-Type = application/json
And header Accept = /
And header x-api-key = YTMwNTRmZmMtM2Y3MC00OGVjLWE4OGQtZjM5OTBmY2JkNWZk
When execute method POST
Then the status code should be 400


@GetWorkspace´sE401 #Doy una api key equivocada
Scenario: Trae la lista completa de workspace´s
Given base url https://api.clockify.me
And endpoint /api/v1/workspaces
And header Content-Type = application/json
And header Accept = /
And header x-api-key = YTMwNTRmZmMtM2Y3MC00OGVjLWE44GQtZjM5OTBmY2JkNWZk
When execute method GET
Then the status code should be 401


@GetWorkspace´sE404 #Endpoint equivocado
Scenario: Trae la lista completa de workspace´s
Given base url https://api.clockify.me
And endpoint /api/v1/workspace
And header Content-Type = application/json
And header Accept = /
And header x-api-key = YTMwNTRmZmMtM2Y3MC00OGVjLWE4OGQtZjM5OTBmY2JkNWZk
When execute method GET
Then the status code should be 404


@AddProjectE400 #Proyecto ya existe
Scenario: Añade al workspace un nuevo project
Given call Clockify.feature@GetWorkspace´s
And base url https://api.clockify.me/api
And endpoint /v1/workspaces/{{workspaceId}}/projects
And header Content-Type = application/json
And header Accept = /
And header x-api-key = YTMwNTRmZmMtM2Y3MC00OGVjLWE4OGQtZjM5OTBmY2JkNWZk
And body addProjectBody.json
When execute method POST
Then the status code should be 400

@AddProjectE401 #Doy una api key equivocada
Scenario: Añade al workspace un nuevo project
Given call Clockify.feature@GetWorkspace´s
And base url https://api.clockify.me/api
And endpoint /v1/workspaces/{{workspaceId}}/projects
And header Content-Type = application/json
And header Accept = /
And header xapikey = YTMwNTRmZmMtM2Y3MC00OGVjLWE4OGQtZjM5OTBmY2JkNWZk
And body addProjectBody.json
When execute method POST
Then the status code should be 401

@AddProjectE404 #Endpoint equivocado
Scenario: Añade al workspace un nuevo project
Given call Clockify.feature@GetWorkspace´s
And base url https://api.clockify.me/api
And endpoint /v1/workspaces/{{workspaceId}}/project
And header Content-Type = application/json
And header Accept = /
And header x-api-key = YTMwNTRmZmMtM2Y3MC00OGVjLWE4OGQtZjM5OTBmY2JkNWZk
And body addProjectBody.json
When execute method POST
Then the status code should be 404

@GetProject´sE400 #Reemplazo GET por POST
Scenario: Trae todos los proyectos creados en el workspace
Given call Clockify.feature@GetWorkspace´s
And base url https://api.clockify.me/api
And endpoint /v1/workspaces/{{workspaceId}}/projects
And header Content-Type = application/json
And header Accept = /
And header x-api-key = YTMwNTRmZmMtM2Y3MC00OGVjLWE4OGQtZjM5OTBmY2JkNWZk
When execute method POST
Then the status code should be 400


@GetProject´sE401 #Doy una api key equivocada
Scenario: Trae todos los proyectos creados en el workspace
Given call Clockify.feature@GetWorkspace´s
And base url https://api.clockify.me/api
And endpoint /v1/workspaces/{{workspaceId}}/projects
And header Content-Type = application/json
And header Accept = /
And header x-api-key = YTMwNTRmZmMtM2Y3MC00OGVjLWE44GQtZjM5OTBmY2JkNWZk
When execute method GET
Then the status code should be 401


@GetProject´sE404 #Endpoint equivocado
Scenario: Trae todos los proyectos creados en el workspace
Given call Clockify.feature@GetWorkspace´s
And base url https://api.clockify.me/api
And endpoint /v1/workspaces/{{workspaceId}}/proyecto
And header Content-Type = application/json
And header Accept = /
And header x-api-key = YTMwNTRmZmMtM2Y3MC00OGVjLWE4OGQtZjM5OTBmY2JkNWZk
When execute method GET
Then the status code should be 404


@FindProjectE400 #ProjectId incorrecto
Scenario: Busca un project por su ID
Given call Clockify.feature@GetProject´s
And base url https://api.clockify.me/api
And endpoint /v1/workspaces/{{workspaceId}}/projects/ProyectoId
And header Content-Type = application/json
And header Accept = /
And header x-api-key = YTMwNTRmZmMtM2Y3MC00OGVjLWE4OGQtZjM5OTBmY2JkNWZk
When execute method GET
Then the status code should be 400

@FindProjectE401 #Api key faltante
Scenario: Busca un project por su ID
Given call Clockify.feature@GetProject´s
And base url https://api.clockify.me/api
And endpoint /v1/workspaces/{{workspaceId}}/projects/{{projectId}}
When execute method GET
Then the status code should be 401

@FindProjectE404 #Endpoint equivocado
Scenario: Busca un project por su ID
Given call Clockify.feature@GetProject´s
And base url https://api.clockify.me/api
And endpoint /v1/workspaces/{{workspaceId}}/project/{{projectId}}
And header Content-Type = application/json
And header Accept = /
And header x-api-key = YTMwNTRmZmMtM2Y3MC00OGVjLWE4OGQtZjM5OTBmY2JkNWZk
When execute method GET
Then the status code should be 404


@UpdateProjectOnWorkspaceE400 #Endpoint erroneo por project ID
Scenario: Modifica el nombre del project
Given call Clockify.feature@GetProject´s
And base url https://api.clockify.me/api
And endpoint /v1/workspaces/{{workspaceId}}/projects/{{projectId}}
And header Content-Type = application/json
And header Accept = /
And header x-api-key = YTMwNTRmZmMtM2Y3MC00OGVjLWE4OGQtZjM5OTBmY2JkNWZk
And body updateProject.json
When execute method PUT
Then the status code should be 400

@UpdateProjectOnWorkspaceE401 #Sin Api key
Scenario: Modifica el nombre del project
Given call Clockify.feature@GetProject´s
And base url https://api.clockify.me/api
And endpoint /v1/workspaces/{{workspaceId}}/projects/{{projectId}}
And header Content-Type = application/json
And header Accept = /
And body updateProject.json
When execute method PUT
Then the status code should be 401

@UpdateProjectOnWorkspaceE404 #Endpoint erroneo por campo
Scenario: Modifica el nombre del project
Given call Clockify.feature@GetProject´s
And base url https://api.clockify.me/api
And endpoint /v1/workspaces/{{workspaceId}}/project/{{projectId}}
And header Content-Type = application/json
And header Accept = /
And header x-api-key = YTMwNTRmZmMtM2Y3MC00OGVjLWE4OGQtZjM5OTBmY2JkNWZk
And body updateProject.json
When execute method PUT
Then the status code should be 404
51 changes: 51 additions & 0 deletions src/test/resources/features/Clockify.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
@Clockify
Feature: Camino feliz

Background:
And header Content-Type = application/json
And header Accept = */*
And header x-api-key = YTMwNTRmZmMtM2Y3MC00OGVjLWE4OGQtZjM5OTBmY2JkNWZk

@GetWorkspace´s
Scenario: Trae la lista completa de workspace´s
Given base url http://api.clockify.me/api
And endpoint /v1/workspaces
When execute method GET
Then the status code should be 200
* define workspaceId = $.[0].id

@AddProject
Scenario: Añade al workspace un nuevo project
Given call Clockify.feature@GetWorkspace´s
And base url https://api.clockify.me/api
And endpoint /v1/workspaces/{{workspaceId}}/projects
And body addProjectBody.json
When execute method POST
Then the status code should be 201

@GetProject´s
Scenario: Trae todos los proyectos creados en el workspace
Given call Clockify.feature@GetWorkspace´s
And base url https://api.clockify.me/api
And endpoint /v1/workspaces/{{workspaceId}}/projects
When execute method GET
Then the status code should be 200
* define projectId = $.[0].id

@FindProjectByID
Scenario: Busca un project por su ID
Given call Clockify.feature@GetProject´s
And base url https://api.clockify.me/api
And endpoint /v1/workspaces/{{workspaceId}}/projects/{{projectId}}
When execute method GET
Then the status code should be 200

@UpdateProjectOnWorkspace
Scenario: Modifica el nombre del project
Given call Clockify.feature@GetProject´s
And base url https://api.clockify.me/api
And endpoint /v1/workspaces/{{workspaceId}}/projects/{{projectId}}
And body updateProject.json
When execute method PUT
Then the status code should be 200
And response should be name = Silve
3 changes: 3 additions & 0 deletions src/test/resources/jsons/bodies/addProjectBody.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name": "Lambda"
}
3 changes: 3 additions & 0 deletions src/test/resources/jsons/bodies/updateProject.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name": "Silve"
}
Loading