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
Answer 3 questions and Léa tailors the prompt to your situation.
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.
Learn more
Check the full skill on Prompt Guide to master this technique from A to Z.
View on Prompt Guide📬 Get new prompts every week
Join our newsletter and never miss a prompt.
Similar Prompts
Generate Mocks and Fixtures for Your Automated Tests
A prompt to automatically generate realistic mocks, stubs and data fixtures adapted to your test framework and use cases.
Automatically Generate Unit Tests with AI
Automatically generate an exhaustive unit test suite covering nominal cases, edge cases, and error cases for any source code.
Create a Python Automation Script
Create a professional Python automation script with CLI configuration, structured logging, error handling, and tests.
Analyze and Optimize Algorithmic Complexity
Analyze the Big O complexity of your algorithms and optimize them with appropriate data structures and more efficient algorithms.