diff --git a/src/test/resources/features/Clockify.feature b/src/test/resources/features/Clockify.feature new file mode 100644 index 0000000..ee4724b --- /dev/null +++ b/src/test/resources/features/Clockify.feature @@ -0,0 +1,52 @@ +@Clockify +Feature: Clockify + + Background: + And header Content-Type = application/json + And header Accept = */* + And header x-api-key = NGY2NGQ1N2ItZWY0NC00OWFiLWIzNjktY2ZmMzE3MmU0ZTU0 + + @WorkSpace @200 + Scenario: Traer Workspaces + Given base url env.base_url_clockify + And endpoint /v1/workspaces + When execute method GET + Then the status code should be 200 + * define workspaceId = $.[0].id + + @CrearProyecto @201 + Scenario: Crear un proyecto + Given call Clockify.feature@WorkSpace + And base url env.base_url_clockify + And endpoint /v1/workspaces/{{workspaceId}}/projects + And set value "Proyecto" of key name in body agregarProyecto.json + When execute method POST + Then the status code should be 201 + + @TraerProyecto @Exitoso @200 + Scenario: Traer proyecto + Given call Clockify.feature@WorkSpace + And base url env.base_url_clockify + And endpoint /v1/workspaces/{{workspaceId}}/projects/ + When execute method GET + Then the status code should be 200 + * define projectId = $.[0].id + + @BuscarporID @200 + Scenario: Buscar proyecto por ID + Given call Clockify.feature@TraerProyecto + And base url env.base_url_clockify + And endpoint /v1/workspaces/{{workspaceId}}/projects/{{projectId}} + When execute method GET + Then the status code should be 200 + + @RenombrarProyecto @200 + Scenario: Renombrar un proyecto + Given call Clockify.feature@TraerProyecto + And base url env.base_url_clockify + And endpoint /v1/workspaces/{{workspaceId}}/projects/{{projectId}} + And set value "ProyectoRenombrado" of key name in body agregarProyecto.json + When execute method PUT + Then the status code should be 200 + And response should be name = ProyectoRenombrado + diff --git a/src/test/resources/features/Sample.feature b/src/test/resources/features/Sample.feature deleted file mode 100644 index 46b64f9..0000000 --- a/src/test/resources/features/Sample.feature +++ /dev/null @@ -1,60 +0,0 @@ -@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/ - When execute method GET - Then the status code should be 200 - And response should be $.name = - And response should be $.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 = - 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 = - And validate schema pet.json - - Examples: - | name | - | doggie | - - - - diff --git a/src/test/resources/jsons/bodies/agregarProyecto.json b/src/test/resources/jsons/bodies/agregarProyecto.json new file mode 100644 index 0000000..4a60b89 --- /dev/null +++ b/src/test/resources/jsons/bodies/agregarProyecto.json @@ -0,0 +1,3 @@ +{ + "name": "string" +} \ No newline at end of file diff --git a/src/test/resources/lippia.conf b/src/test/resources/lippia.conf index f072a11..26c2e2d 100644 --- a/src/test/resources/lippia.conf +++ b/src/test/resources/lippia.conf @@ -1,17 +1,14 @@ environments { default { - "base_url_rickAndMorty" = "https://rickandmortyapi.com/api/" - "base_url_petstore" = "https://petstore.swagger.io/v2/" + "base_url_clockify" = "https://api.clockify.me/api" } test { - "base_url_rickAndMorty" = "https://rickandmortyapi.com/api/" - "base_url_petstore" = "https://petstore.swagger.io/v2/" + "base_url_clockify" = "https://api.clockify.me/api" } dev { - "base_url_rickAndMorty" = "https://rickandmortyapi.com/api/" - "base_url_petstore" = "https://petstore.swagger.io/v2/" + "base_url_clockify" = "https://api.clockify.me/api" } } \ No newline at end of file