Sora Prompt for Creating E2E Tests
End-to-end (E2E) tests are essential for ensuring application reliability, but writing them remains time-consuming and repetitive. Sora, thanks to its advanced generation capabilities, makes it possible to automate the creation of complete E2E test scenarios in seconds. By formulating a precise prompt describing user journeys, expected interactions, and validation criteria, you obtain structured test suites covering nominal cases as well as edge cases. The prompt engineering approach applied to Sora transforms how QA and development teams approach test coverage. Instead of starting from a blank page, you describe the expected behavior of your application in natural language, and Sora generates the corresponding test code with appropriate assertions. This method significantly reduces the time needed to set up an E2E suite while maintaining a professional quality level. Whether you use Playwright, Cypress, or Selenium, the prompts presented here adapt to your technical stack and the complexity of your application.
Paste in your AI
Paste this prompt in ChatGPT, Claude or Gemini and customize the variables in brackets.
Generate a comprehensive suite of end-to-end tests for a web application. The application is [DESCRIBE_APPLICATION_AND_ITS_CORE_FEATURES]. Use the [Playwright/Cypress/Selenium] framework with [TypeScript/JavaScript]. For each critical user journey, create a separate test file that includes: 1) Initial setup (fixtures, test data, authentication), 2) Scenario steps with robust selectors (preferably data-testid), 3) Explicit assertions verifying UI state, redirects, and displayed data, 4) Cleanup after each test. Cover the following journeys: registration, login, main navigation, [ADD_SPECIFIC_JOURNEYS]. Also include tests for error cases (invalid forms, network timeout, insufficient permissions). Each test must be independent, idempotent, and executable in parallel. Add comments explaining the business logic being tested.
Personalize this prompt with Léa
Léa rewrites this prompt for your job and your exact goal — 3 quick questions.
Why this prompt works
This prompt works because it structures the request around the three pillars of a good E2E test: the application context, the technical framework, and the quality criteria. By explicitly specifying selector patterns, test independence, and error case coverage, you guide Sora toward generation that follows test automation best practices. The request for business comments also forces more thoughtful and documented generation.
Use Cases
Variants
Expected Output
Sora produces a suite of E2E test files organized by user journey, with a clear structure including describe/it blocks, data-testid selectors, precise assertions, and setup/teardown management. Each test is self-contained and ready to be integrated into a CI/CD pipeline. The generated code includes handling of asynchronous states (explicit waits) and common edge cases.
Frequently Asked Questions
How can I adapt E2E tests generated by Sora to my specific application?
Start by replacing the placeholders (URLs, selectors, test data) with your application's actual values. Check that the data-testid selectors match those in your source code — add them to your components if necessary. Run each test individually to identify needed adjustments: wait times, order of interactions, assertions specific to your business logic. Sora provides a solid foundation, but adapting it to your application's real context is essential for reliable tests.
Which E2E testing framework should I choose when using Sora to generate tests?
Playwright is recommended for new projects thanks to its native multi-browser support, intelligent auto-waiting, and excellent TypeScript integration. Cypress is suitable if your team is already proficient with it and you primarily test on Chromium. Always specify the framework in your prompt so that Sora generates code with the correct API syntax. Also mention the framework version to avoid the use of deprecated methods.
How do I prevent generated E2E tests from being flaky and breaking with every update?
Explicitly ask Sora to use data-testid selectors rather than CSS or XPath selectors tied to the DOM structure. Specify in your prompt that the tests must be independent of each other and not depend on an execution order. Include explicit waits (waitFor, expect with timeout) rather than fixed delays. Finally, request the generation of fixtures to isolate test data, thus avoiding dependencies on the database state.
Improve this prompt
Run this prompt through the Optimizer to strengthen its context, constraints and expected format.
Improve this prompt with the OptimizerComments
- LéaAI
Pour des tests plus fiables, précisez dans le prompt les user stories exactes et les endpoints API à simuler. Exigez systématiquement l’utilisation de `data-testid` et l’interception réseau (ex. `cy.intercept` ou `page.route`). Variante utile : demandez un fichier de configuration centralisé et des helpers de login réutilisables pour éviter la duplication.
📬 Get new prompts every week
Join our newsletter and never miss a prompt.
Go further
Similar Prompts
Write an ORM query
Write efficient ORM queries
Stable Diffusion Prompt to Generate JavaScript Code
Stable Diffusion is an AI image generation model, not a proper code generation tool. However, it can be used creatively in the context of JavaScript development. Stable Diffusion excels at creating code-related visuals: stylized screenshots of JavaScript snippets, illustrations of programming concepts, software architecture diagrams, or educational images for tutorials and technical documentation. By combining well-crafted prompts, you can generate visual representations of JavaScript code on screen, infographics explaining algorithms, or illustrations for your technical blog posts. This approach is particularly useful for tech content creators, web development instructors, and marketing teams who need professional visuals around JavaScript programming. In this guide, we offer optimized prompts for achieving high-quality visual renderings featuring JavaScript code in various visual contexts.
Implement property-based testing
Add property-based tests
Implement rate limiting
Protect APIs from abuse