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
60 changes: 0 additions & 60 deletions src/test/resources/features/Sample.feature

This file was deleted.

55 changes: 55 additions & 0 deletions src/test/resources/features/addProject.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
@addProject
Feature: addProject

Background:
Given header Content-Type = application/json
And header Accept = */*
And header x-api-key = NTZhNWVmN2UtNjI1OS00OGU2LTg1ZDEtYmZkOWM1NzZjNDFk
* define nombreProyecto12 = crow2

@ListWorkspace123
Scenario:
Given base url env.base_url_clockify
And endpoint /v1/workspaces
When execute method GET
Then the status code should be 200
* define idWorkspace = $[0].id

@CreateProjectAddProject
Scenario: Create project
Given call addProject.feature@ListWorkspace123
And base url env.base_url_clockify
And endpoint /v1/workspaces/{{idWorkspace}}/projects
And set value "{{nombreProyecto12}}" of key name in body addProject.json
When execute method POST
Then the status code should be 201


@CreateProject400
Scenario: Create project Bad Request
Given call addProject.feature@ListWorkspace123
Given base url env.base_url_clockify
And endpoint /v1/workspaces/{{idWorkspace}}/projects
And set value "{{nombreProyecto12}}" of key name in body addProject214.json
When execute method POST
Then the status code should be 400

@CreateProject401
Scenario: Create project Unauthorized
Given call addProject.feature@ListWorkspace123
Given header x-api-key = gfgfssfssfsfhhjjjj
And base url env.base_url_clockify
And endpoint /v1/workspaces/{{idWorkspace}}/projects
And set value "{{nombreProyecto12}}" of key name in body addProject.json
When execute method POST
Then the status code should be 401

@CreateProject404
Scenario: Create project Not Found
Given call addProject.feature@ListWorkspace123
Given base url env.base_url_clockify
And endpoint /v1/workspaces/{{idWorkspace}}/4356465
And set value "{{nombreProyecto12}}" of key name in body addProject.json
When execute method POST
Then the status code should be 404

63 changes: 63 additions & 0 deletions src/test/resources/features/delete.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
Feature: Delete

Background:
Given header Content-Type = application/json
And header Accept = */*
And header x-api-key = NTZhNWVmN2UtNjI1OS00OGU2LTg1ZDEtYmZkOWM1NzZjNDFk
And base url env.base_url_clockify
* define nombreProyecto = Crowdar2023

@ListWorkspaceDelete
Scenario:
Given base url env.base_url_clockify
Given endpoint /v1/workspaces
When execute method GET
Then the status code should be 200
* define idWorkspace = $[0].id


@CreateProjectDelete
Scenario: Crear un proyecto
Given call delete.feature@ListWorkspaceDelete
And endpoint /v1/workspaces/{{idWorkspace}}/projects
And set value "{{nombreProyecto}}" of key name in body addProject.json
When execute method POST
Then the status code should be 201
* define idProject = $.id

@UpdateProjectDelete
Scenario: Update Project
Given call delete.feature@CreateProject
And endpoint /v1/workspaces/{{idWorkspace}}/projects/{{idProject}}
And set value "true" of key archived in body updateProjectToArchive.json
When execute method PUT
Then the status code should be 200

@DeleteProject
Scenario: Delete Project
Given call delete.feature@UpdateProject
And endpoint /v1/workspaces/{{idWorkspace}}/projects/{{idProject}}
When execute method DELETE
Then the status code should be 200

@DeleteProject400
Scenario: Delete Project Bad Request
Given base url env.base_url_clockify
And endpoint /v1/workspaces/{{idWorkspace}}/projects/cuaqluiera
When execute method DELETE
Then the status code should be 400

@DeleteProject401
Scenario: Delete Project Unauthorized
Given header x-api-key = 32423423423fgdfgaefad
And endpoint /v1/workspaces/{{idWorkspace}}/projects/653568cff202ee63efd5493b
When execute method DELETE
Then the status code should be 401

@DeleteProject404
Scenario: Delete Project Not Found
Given base url env.base_url_clockify
And endpoint /v1/workspaces/{{idWorkspace}}/project51s/653568cff202ee63efd5493b
When execute method DELETE
Then the status code should be 404

51 changes: 51 additions & 0 deletions src/test/resources/features/findById.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
Feature: Find by id

Background:
Given header Content-Type = application/json
And header Accept = */*
And header x-api-key = NTZhNWVmN2UtNjI1OS00OGU2LTg1ZDEtYmZkOWM1NzZjNDFk
And base url env.base_url_clockify

@ListWorkspaceFindId
Scenario: Get all workspaces
Given endpoint /v1/workspaces
When execute method GET
Then the status code should be 200
* define idWorkspace = $[0].id

@ListProjectsFindById
Scenario: get all projects
Given call findById.feature@ListWorkspaceFindId
Given endpoint /v1/workspaces/{{idWorkspace}}/projects
When execute method GET
Then the status code should be 200
* define idProject = $[0].id

@FindId
Scenario: get project by id
Given call findById.feature@ListProjectsFindById
And endpoint /v1/workspaces/{{idWorkspace}}/projects/{{idProject}}
When execute method GET
Then the status code should be 200

@FindId400
Scenario: get project Bad Request
Given call findById.feature@ListWorkspaceFindId
And endpoint /v1/workspaces/{{idWorkspace}}/projects/013ty9p1
When execute method GET
Then the status code should be 400

@FindId401
Scenario: get project Unauthorised
Given header x-api-key = ÑTZhNWVmN2UtNjI1OS00OGU2LTg1ZDEtYmZkOWM1NzZjNDFk
And call findById.feature@ListProjectsFindById
And endpoint /v1/workspaces/{{idWorkspace}}/projects/{{idProject}}
When execute method GET
Then the status code should be 401

@FindId404
Scenario: get project by id Not Found
Given call findById.feature@ListWorkspaceFindId
And endpoint /v1/workspaces/{{idWorkspace}}/projectsgfkghl/6535738fc64c131fb4e8f984
When execute method GET
Then the status code should be 404
48 changes: 48 additions & 0 deletions src/test/resources/features/getProject.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
@Workspaces
Feature: getProjects

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

@getWorkspacesGetProjetc
Scenario: Get all workspaces
Given base url env.base_url_clockify
Given endpoint /v1/workspaces
When execute method GET
Then the status code should be 200
* define idWorkspace = $[0].id

@ListProjectsGetProjetc
Scenario: get all projects
Given call getProject.feature@getWorkspacesGetProjetc
And base url env.base_url_clockify
Given endpoint /v1/workspaces/{{idWorkspace}}/projects
When execute method GET
Then the status code should be 200

@ListProjectsGetProjetc400
Scenario: get all projects Bad request
Given call getProject.feature@getWorkspacesGetProjetc
And base url env.base_url_clockify
Given endpoint /v1/workspaces/{{idWorkspace}}/projects/xdd
When execute method GET
Then the status code should be 400

@ListProjectsGetProjetc401
Scenario: get all projects Unauthorised
Given call getProject.feature@getWorkspacesGetProjetc
And header x-api-key = 32423423423fgdfgaefad
And base url env.base_url_clockify
Given endpoint /v1/workspaces/{{idWorkspace}}/projects
When execute method GET
Then the status code should be 401

@ListProjectsGetProjetc404
Scenario: get all projects Not found
Given call getProject.feature@getWorkspacesGetProjetc
And base url env.base_url_clockify
Given endpoint /v1/workspaces/{{idWorkspace}}/projects514
When execute method GET
Then the status code should be 404
57 changes: 57 additions & 0 deletions src/test/resources/features/updateProjectEstimate.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
Feature: updateProjectEstimate

Background:
Given header Content-Type = application/json
And header Accept = */*
And header x-api-key = NTZhNWVmN2UtNjI1OS00OGU2LTg1ZDEtYmZkOWM1NzZjNDFk
And base url env.base_url_clockify
* define nombreProyecto = Crowdar2023Estimate

@ListWorkspaceEstimate
Scenario:
Given base url env.base_url_clockify
Given endpoint /v1/workspaces
When execute method GET
Then the status code should be 200
* define idWorkspace = $[0].id


@CreateProjectEstimate
Scenario: Crear un proyecto
Given call updateProjectEstimate.feature@ListWorkspaceEstimate
And endpoint /v1/workspaces/{{idWorkspace}}/projects
And set value "{{nombreProyecto}}" of key name in body addProjectUpdate.json
When execute method POST
Then the status code should be 201
* define idProject = $.id

@UpdateEstimate
Scenario: Update estimate project
Given call updateProjectEstimate.feature@CreateProjectEstimate
And endpoint /v1/workspaces/{{idWorkspace}}/projects/{{idProject}}/estimate
And set value "MANUAL" of key type in body updateEstimate.json
When execute method PATCH
Then the status code should be 200

@UpdateEstimate400
Scenario: Estimate Project Bad Request
Given call updateProjectEstimate.feature@ListWorkspaceEstimate
And endpoint /v1/workspaces/{{idWorkspace}}/projects/$$$$/estimate
And set value "MANUAL" of key type in body updateEstimate.json
When execute method PATCH
Then the status code should be 400

@UpdateEstimate401
Scenario: Estimate Project Unauthorized
Given header x-api-key = 32423423423fgdfgaefad
And call updateProjectEstimate.feature@ListWorkspaceEstimate
And endpoint /v1/workspaces/{{idWorkspace}}/projects/mandinga
When execute method PATCH
Then the status code should be 401

@UpdateEstimate404
Scenario: Estimate Project Not Found
Given call updateProjectEstimate.feature@ListWorkspaceEstimate
And endpoint /v1/workspaces/{{idWorkspace}}/project51s/mandinga
When execute method PATCH
Then the status code should be 404
Loading