Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TECHNICAL: Author automated tests that verify CRUD operations for artifacts and materials #77

Open
stevebrownlee opened this issue Dec 19, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@stevebrownlee
Copy link

Before any functionality for artifacts and materials is merged into production, there must be an automated test module that validates the following requests.

Artifacts

Method Endpoint Status Code Coverage
GET /artifacts 200 An array should be returned. Validate that the first object in the array has all required keys that are expected in the response
GET /artifacts/{artifact.id} 200 Insert a new artifact into DB in the test method, then verify that when you GET it that all the keys and values are correct
DELETE /artifacts/{artifact.id} 204/404 Create a new artifact in the test method. Delete it and verify you get a 204 response code. Then GET it again and verify you get a 404.
PUT /artifacts/{artifact.id} 405 Create a new artifact in the test method. Perform a PUT operation to change some values. Verify you get a 405 Unsupported response.
POST /artifacts 201 Perform a POST operation with an accurate payload and verify that you get a 201 response code and that the new artifact is in the response body with the correct keys and values.

Materials

Method Endpoint Status Code Coverage
GET /materials 200 An array should be returned. Validate that the first object in the array has all required keys that are expected in the response
GET /materials/{material.id} 200 Insert a new material into DB in the test method, then verify that when you GET it that all the keys and values are correct
DELETE /materials/{material.id} 204/404 Create a new material in the test method. Delete it and verify you get a 204 response code. Then GET it again and verify you get a 404.
PUT /materials/{material.id} 204 Create a new material in the test method. Perform a PUT operation to change some values. Verify you get a 204 response. Then perform a GET and verify that the record was updated correctly
POST /materials 201 Perform a POST operation with an accurate payload and verify that you get a 201 response code and that the new material is in the response body with the correct keys and values.
@stevebrownlee stevebrownlee added the enhancement New feature or request label Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant