runner
runner copied to clipboard
Discussion for a new feature - add tags filtering on tests groups
Current State of Group Tagging in Japa
Overview
As of the current implementation, the Japa testing framework does not support applying tags directly to test groups via a group.tags() method. This limitation requires developers to individually tag each test within a group, which can be repetitive and error-prone for large test suites.
Current Workaround
Currently, developers must apply tags to each individual test:
test.group('Push Token Model Unit Tests', (group) => {
// Setup hooks...
test('should create a push token with valid data', async ({ assert }) => {
// Test implementation...
}).tags(['push_tokens'])
test('should allow null deviceId', async ({ assert }) => {
// Test implementation...
}).tags(['push_tokens'])
// Must repeat .tags(['push_tokens']) on every test...
})
Missing Feature: Group-Level Tagging
Desired Functionality
The community would benefit from a feature that allows applying tags at the group level:
// DESIRED: This doesn't currently work
test.group('Push Token Model Unit Tests', (group) => {
group.tags(['push_tokens']) // ❌ Not supported
test('should create a push token', async ({ assert }) => {
// Would inherit 'push_tokens' tag automatically
})
test('should allow null deviceId', async ({ assert }) => {
// Would inherit 'push_tokens' tag automatically
})
})
Benefits of Group Tags
- DRY Principle: Avoid repeating tags on every test in a group
- Maintainability: Single place to manage tags for related tests
- Consistency: Ensure all tests in a group have the same tags
- Scalability: Easier to manage large test suites with many groups
Research Findings
GitHub Repository Status
- japa/runner repository: No open issues related to group tags functionality
- japa/core repository: No discussions about group-level tagging features
- Official documentation: No mentions of group tags in current docs
Current Tag Support
Japa does support:
- Individual test tagging with
.tags(['tag_name']) - Tag filtering via CLI:
node ace test --tags="tag_name" - Manual filter configuration in test setup
You can apply by tapping into the tests.
group.tap((t) => t.tags(['tag_name']))
Hi, thank you for your reply. I tested it, and it works just as expected! 💯