Files
aperture/test-scenarios.md

2.3 KiB

Aperture Extension Test Scenarios

This document outlines the test scenarios for the Aperture VS Code extension.

Test Scenarios

1. Root Spec Validation

  • Valid: examples/openapi-3.2.yaml, examples/openapi-3.1.yaml, examples/swagger-2.0.yaml
  • Invalid: examples/invalid-missing-info.yaml
    • Should show error: "OpenAPI document must contain an 'info' section"

2. Schema Naming Validation

  • Invalid: examples/invalid-schema-naming.yaml
    • Should show warnings for schema names not in PascalCase
    • pet should be Pet

3. Operation ID Validation

  • Invalid: examples/invalid-duplicate-operation-id.yaml
    • Should show warning for duplicate operationId: listPets

4. Path Parameter Validation

  • Invalid: examples/invalid-path-parameters.yaml
    • Should show warnings for undeclared path parameters {petId} and {ownerId}

5. Version Detection

  • Test with different OpenAPI versions (3.2, 3.1, 3.0, 2.0)
  • Test with versionPreference: "auto" vs forced versions
  • Test with invalid version strings

6. Settings Configuration

  • Test openapiLsp.versionPreference setting
  • Test openapiLsp.enableTypeProfile setting
  • Test openapiLsp.enableCustomRules setting
  • Test openapiLsp.maxFileSize setting
  • Test openapiLsp.debounceDelay setting

7. Performance Testing

  • Test with large files (>5MB)
  • Test debouncing behavior
  • Test cache performance
  • Test memory usage

8. Multi-file Validation

  • Test $ref resolution across multiple files
  • Test circular reference detection
  • Test file watching and re-validation

9. Hover and IntelliSense

  • Test hover information on schema properties
  • Test completion suggestions
  • Test validation messages

10. Error Handling

  • Test with malformed JSON/YAML
  • Test with network timeouts
  • Test with missing dependencies

Running Tests

  1. Install the extension in VS Code
  2. Open the example files
  3. Verify that diagnostics appear in the Problems panel
  4. Test hover functionality
  5. Test settings changes
  6. Test with different file sizes

Expected Results

  • Valid files should show no errors
  • Invalid files should show appropriate error messages
  • Hover should provide helpful information
  • Settings should be respected
  • Performance should be smooth even with large files