PromptsVault AI is thinking...
Searching the best prompts from our community
Searching the best prompts from our community
Prompts matching the #testing tag
Design reusable Cypress E2E testing framework. components: 1. Page Object Model (POM) pattern. 2. Custom commands for common actions. 3. API interception for mocking backend. 4. Visual regression testing (percy/applitools). 5. Dynamic data generation (faker.js). 6. Environment configuration (staging/prod). 7. CI/CD integration using GitHub Actions. 8. Flaky test retry logic. Include HTML report generation.
Visualize CI/CD test results. Layout: 1. Summary cards: Passed, Failed, Flaky, Total Time. 2. Searchable list of test cases with status icons. 3. Modal to view trace logs or screenshots of failed steps. 4. Performance over time chart. 5. Dark/Light mode support. Use DaisyUI's alert and progress components.
Write effective unit tests with TDD approach. TDD cycle: 1. Red (write failing test). 2. Green (write minimal code to pass). 3. Refactor (improve code while keeping tests green). Best practices: Test one thing per test. Use AAA pattern (Arrange, Act, Assert). Descriptive test names (should_returnTrue_when_inputIsValid). Mock external dependencies. Aim for 80%+ code coverage. Fast tests (<1 sec). Independent tests (no order dependency). Use test fixtures for setup. Frameworks: Jest, Pytest, JUnit. Benefits: confidence in changes, living documentation, better design.
Compare visual outputs from multiple SD models. Layout: 1. One prompt input that sends to SDXL, SD1.5, and Playground v2. 2. 3-column grid showing generated images. 3. Metadata overlay showing seed, sampler, and CFG scale. 4. 'Download All' button. 5. History sidebar of previous generations.
Write a set of unit tests for the following JavaScript function, which takes an array of numbers and returns the sum. Use a testing framework like Jest. Cover edge cases like an empty array, an array with non-numeric values, and a very large array.
Debug efficiently with systematic approach. Process: 1. Reproduce the bug consistently. 2. Isolate the problem (binary search through code). 3. Form hypothesis about cause. 4. Test hypothesis (add logging, use debugger). 5. Fix the root cause, not symptoms. 6. Verify fix doesn't break other functionality. 7. Add test to prevent regression. Techniques: rubber duck debugging, print statements, breakpoints, stack traces. Read error messages carefully. Check recent changes (git blame). Search Stack Overflow. Take breaks if stuck. Document solution. Prevention: write tests first, code reviews, static analysis.
Practice test-driven development. Workflow: 1. Write failing test first (Red). 2. Write minimal code to pass (Green). 3. Refactor while keeping tests green. 4. Repeat cycle. Benefits: Better design, confidence, documentation. Write tests for: edge cases, error handling, happy path. Use describe/it structure. Keep tests fast and isolated. Mock external dependencies.