Skip to content

65 new testcase creation/deletion - #72

Merged
Bazinator merged 24 commits into
mainfrom
65-new-testcase-creation
Apr 7, 2026
Merged

65 new testcase creation/deletion#72
Bazinator merged 24 commits into
mainfrom
65-new-testcase-creation

Conversation

@angelo-yap

Copy link
Copy Markdown
Owner

Closes #65

This pull request introduces backend and frontend support for creating and deleting test cases within a workspace. The changes include new REST API endpoints for test case creation and deletion, corresponding DTOs and exception classes, service logic for validation and persistence, and frontend integration for user interaction.

Backend: Test Case Mutation API

  • Added TestCaseMutationController to handle /api/testcases POST (create) and DELETE (delete by workKey) endpoints with appropriate authentication, authorization, and error handling.
  • Implemented WorkspaceTestCaseMutationService with validation, normalization, and persistence logic for creating and deleting test cases, including custom exceptions for error scenarios.
  • Introduced DTOs for request and response (TestCaseCreateRequest, TestCaseCreateResponse) and custom exception classes (TestCaseBadRequestException, TestCaseConflictException, TestCaseNotFoundException). [1] [2] [3] [4] [5]

Frontend: Workspace Page Integration

  • Added createTestCase and deleteTestCase API methods to workspace-page-api.js, exposing them via the workspace page API object. [1] [2] [3]
  • Integrated UI elements and event handlers in page.js for showing/hiding the new test case form, submitting new test cases, and handling user input for test case creation. [1] [2] [3]

These changes enable users to create and delete test cases directly from the workspace UI, with robust backend validation and error feedback.

image image image image

@angelo-yap
angelo-yap requested a review from Copilot April 6, 2026 08:11
@angelo-yap angelo-yap changed the title 65 new testcase creation 65 new testcase creation/deletion Apr 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds workspace-scoped test case creation and deletion, wiring new backend mutation endpoints to new workspace UI controls and adding integration tests to validate behavior.

Changes:

  • Added POST /api/testcases and DELETE /api/testcases/{workKey} endpoints with request/response DTOs and error handling.
  • Implemented service-layer validation/normalization for creating blank test cases and deleting by workKey.
  • Added workspace UI for creating a test case from the sidebar, plus “Delete selected” bulk action support and corresponding API methods.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/main/java/com/formswim/teststream/testcase/controllers/TestCaseMutationController.java New controller exposing create/delete test case REST endpoints.
src/main/java/com/formswim/teststream/testcase/services/WorkspaceTestCaseMutationService.java New service implementing validation + persistence for create/delete.
src/main/java/com/formswim/teststream/testcase/dto/TestCaseCreateRequest.java DTO for create request payload.
src/main/java/com/formswim/teststream/testcase/dto/TestCaseCreateResponse.java DTO for create response payload.
src/main/java/com/formswim/teststream/testcase/services/TestCaseBadRequestException.java Custom exception for 400s.
src/main/java/com/formswim/teststream/testcase/services/TestCaseConflictException.java Custom exception for 409s.
src/main/java/com/formswim/teststream/testcase/services/TestCaseNotFoundException.java Custom exception for 404s.
src/main/resources/static/js/workspace/api/workspace-page-api.js Added createTestCase and deleteTestCase API calls.
src/main/resources/static/js/workspace/page.js Added sidebar create form behavior + bulk delete UI flow.
src/main/resources/templates/workspace/_main.html Added “New Testcase” button and inline create form fields in sidebar.
src/main/resources/templates/workspace/_bulk-bar.html Added “Delete selected” bulk action button.
src/test/java/com/formswim/teststream/workspace/WorkspaceFolderApiIntegrationTests.java Added integration tests covering test case create/delete endpoints.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main/resources/static/js/workspace/page.js Outdated
Comment thread src/main/resources/static/js/workspace/page.js Outdated
Comment thread src/main/resources/static/js/workspace/page.js Outdated
Comment thread src/main/resources/templates/workspace/_main.html Outdated
@angelo-yap

Copy link
Copy Markdown
Owner Author
image image

This comment was marked as outdated.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main/java/com/formswim/teststream/shared/domain/TestCaseRepository.java Outdated
@angelo-yap

angelo-yap commented Apr 6, 2026

Copy link
Copy Markdown
Owner Author

also just fixed the inconsistent scrollbar theme to be consistent with the directory scroll bar
image

@kendymann

kendymann commented Apr 6, 2026

Copy link
Copy Markdown
Collaborator

Add test cases and delete but the creation is limited because there is no actual content being added or enabled.
Also cannot add or delete test case steps
What is ID?

@angelo-yap

angelo-yap commented Apr 6, 2026

Copy link
Copy Markdown
Owner Author
  • Added add/delete test step, clicking add step places a step after the clicked step. Also fixed test data/expected result to appear in seperate rows compliant with requests
image
  • Added dropdown for status and priority fields based on qmetry's default fields and allowing custom entry using "Custom" , fixed status editing
image image image

@angelo-yap

angelo-yap commented Apr 6, 2026

Copy link
Copy Markdown
Owner Author

I think this will not pass a ci test since i know at least one checks for status being not editable

@angelo-yap

Copy link
Copy Markdown
Owner Author

Oh nevermind lol

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main/resources/templates/test-case-details.html Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main/resources/templates/workspace/_main.html
Comment thread src/main/resources/templates/test-case-details.html Outdated
Comment thread src/main/resources/templates/test-case-details.html Outdated
Comment thread src/main/resources/templates/workspace/_main.html Outdated
@Bazinator
Bazinator merged commit dc0e96e into main Apr 7, 2026
1 check passed
@Bazinator
Bazinator deleted the 65-new-testcase-creation branch April 7, 2026 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New Testcase Creation/Deletion

4 participants