DALL-E Prompt for Creating E2E Tests
DALL-E, OpenAI's image generation model, can play a surprising yet effective role in creating end-to-end (E2E) tests. While DALL-E doesn't directly generate test code, it excels at producing visual mockups, wireframes, and simulated screenshots that serve as visual references for your test scenarios. By generating faithful representations of expected interface states—login pages, dashboards, filled forms, error messages—you create precise visual documentation that guides the writing of your Cypress, Playwright, or Selenium tests. This visual approach allows QA teams to validate user journeys even before development is complete, identify visual edge cases, and clearly communicate acceptance criteria. The generated images become reference artifacts in your CI/CD pipeline, facilitating visual regression testing. Whether you are working on a complex web application or a mobile interface, using DALL-E to materialize the expected states of your application transforms your testing process by making it more visual, collaborative, and rigorous.
Paste in your AI
Paste this prompt in ChatGPT, Claude or Gemini and customize the variables in brackets.
Generate a realistic, detailed screenshot of a SaaS web application showing the following complete user journey: 1) Login page with email and password filled in, 'Sign In' button visible. 2) Dashboard after login with a navigation bar, KPI cards, and a data table. The interface should be modern, with a consistent design system using professional colors (blue/gray). Include clearly identifiable interactive elements: buttons with hover states, form fields with labels, validation messages in green and red. The style should be photorealistic, like a real Chrome browser screenshot with the address bar visible displaying 'app.example.com'. High definition resolution, 16:9 aspect ratio.
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 specifies concrete and testable interface elements (buttons, fields, validation messages) that directly correspond to the selectors and assertions used in E2E testing frameworks. The requirement for photographic realism with a browser bar ensures the generated image looks like a real application, facilitating communication between developers and testers. By describing a sequential user journey, the prompt produces a visual reference that naturally maps to step-by-step test scenarios.
Use Cases
Variants
Expected Output
You will obtain a high-resolution image faithfully simulating the interface of a SaaS application with all the UI elements necessary to define your test cases: forms, buttons, feedback messages, and navigation. This image will serve as a visual specification for writing E2E tests covering authentication, navigation, and data display, while also constituting a baseline for visual regression tests.
Frequently Asked Questions
How can I use DALL-E images as a reference for my E2E tests?
DALL-E-generated images serve as visual specifications for your tests. Identify each visible UI element (buttons, fields, messages) and translate them into CSS selectors or data-testid attributes in your Playwright or Cypress tests. For example, if the image shows a blue 'Sign In' button, your test should verify the presence of this button, its text, and its click behavior. These images also become baselines for visual regression testing tools like Percy, BackstopJS, or Chromatic.
Can DALL-E directly generate E2E test code?
No, DALL-E is an image generation model and does not produce code. Its role in the E2E testing process is to create realistic visual mockups that serve as documentation and reference. To generate test code, combine DALL-E images with a language model like GPT-4 or Claude: describe the generated image to the LLM and ask it to produce the corresponding Cypress or Playwright tests. This two-step approach—visualizing then codifying—produces more thorough, better-documented tests.
What types of E2E scenarios are best suited to this visual approach with DALL-E?
The most suitable scenarios are those involving complex visual interactions: e-commerce shopping journeys, multi-step forms, dashboards with charts, responsive interfaces, or onboarding flows. DALL-E excels at materializing error states that are difficult to reproduce manually (server timeouts, partially filled forms, loading states). However, for purely functional tests with no visual component (API calls, database checks), this approach provides no significant added value.
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.