P
đź’»DeveloppementIntermediateAll AIs

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

Create E2E Tests

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 Optimizer

Comments

  • 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

đź’»DeveloppementAdvancedAll AIs

Implement CSP with nonces

Prevent XSS with strict CSP

0233
đź’»DeveloppementIntermediateAll AIs

Mistral Prompt for Creating a Prototype

Mistral, the leading French AI model, stands out as a powerful tool for accelerating prototype creation. Whether you're developing a web application, an API, or a digital product, Mistral can generate functional code, structure your architecture, and produce a testable prototype in minutes. Unlike a traditional approach where prototyping requires several days of development, using Mistral allows you to quickly validate an idea by obtaining a complete functional skeleton. The model particularly excels at generating structured code, proposing coherent architectures, and creating basic but functional user interfaces. By crafting a precise prompt that describes your product vision, key features, and technical constraints, you get a prototype that serves as a solid foundation for iteration. This approach is especially popular with startups, product managers, and independent developers looking to test a market hypothesis without investing weeks of development. Here's how to leverage Mistral to turn your idea into a concrete prototype.

0195
đź’»DeveloppementAdvancedAll AIs

PCI-DSS or SOC2 Compliance

Preparing for regulatory compliance

0258
đź’»DeveloppementIntermediateAll AIs

DALL-E Prompt to Generate JavaScript Code

DALL-E, the image generation model developed by OpenAI, is not designed to produce executable JavaScript code. However, it can play a valuable complementary role in a JavaScript developer's workflow. DALL-E excels at creating visuals related to development: user interface mockups, architecture diagrams, data flow schemas, or illustrations to document your code. By crafting precise prompts, you can obtain visual representations of complex JavaScript concepts like closures, the event loop, or design patterns. These visuals then serve as references for implementing your code, creating attractive technical documentation, or designing educational materials. The approach is to use DALL-E as a rapid visual prototyping tool: generate a UI mockup, then translate it into JavaScript components. This method accelerates the design phase and reduces back-and-forth between designers and developers. In this guide, we offer optimized prompts to get the most out of DALL-E in your JavaScript development process, from UI prototyping to visual documentation of your code.

0496