<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Normia Pop</title>
    <description>The latest articles on Forem by Normia Pop (@normia).</description>
    <link>https://forem.com/normia</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2848771%2Ff4ee2cfa-5f06-4012-a4e5-e70a82061c9b.png</url>
      <title>Forem: Normia Pop</title>
      <link>https://forem.com/normia</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/normia"/>
    <language>en</language>
    <item>
      <title>Cypress Meets Cursor: A Smarter Way to Write Tests</title>
      <dc:creator>Normia Pop</dc:creator>
      <pubDate>Fri, 25 Apr 2025 18:52:10 +0000</pubDate>
      <link>https://forem.com/cypress/cypress-meets-cursor-a-smarter-way-to-write-tests-jaj</link>
      <guid>https://forem.com/cypress/cypress-meets-cursor-a-smarter-way-to-write-tests-jaj</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is Cursor?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Cursor is an AI-powered code editor released in 2023, built on top of Visual Studio Code. It was created by a team of students at MIT and quickly gained traction due to its familiar interface and seamless import of VS Code themes and settings.&lt;/p&gt;

&lt;p&gt;The standout feature? AI integration. Cursor brings advanced AI capabilities like code completion and an incredibly fast, responsive chat assistant. These tools don’t replace your programming skills, but they significantly speed up your workflow, especially for tasks like writing repetitive test code.&lt;/p&gt;

&lt;p&gt;I personally used Cursor this year while building Cypress automation tests, and among the many tools I tried, this one fit my workflow the best.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Using Cursor to Write Cypress Tests&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let’s break down Cursor’s features and how to best use them to improve the quality of our tests and get amazing results.&lt;/p&gt;

&lt;p&gt;It’s worth mentioning that I’ve been using the Pro plan, but they also offer a free version which is more than enough if you want to test its capabilities or don’t use it that often.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Code Autocompletion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;As soon as you start writing a test, Cursor begins predicting your next steps. For example, let’s say you’re writing a simple homepage test. You’ve written your describe block and the initial steps like visit() and checking page visibility. Cursor instantly suggests the next assertion in the correct Cypress format:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj62gx4lz7ddb5t1vtvg8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj62gx4lz7ddb5t1vtvg8.png" alt="Image description" width="800" height="396"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You just press Tab and it autocompletes the suggestion. You can adjust it if needed, but it usually follows the same pattern you’ve already established.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff1qrhqxind0plz42vrcq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff1qrhqxind0plz42vrcq.png" alt="Image description" width="800" height="520"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This applies across the board—Cursor understands your use of Cypress, recognizes the structure, and even autocompletes methods, custom commands, or API calls.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fztgl2nxj3a0mtvazai9y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fztgl2nxj3a0mtvazai9y.png" alt="Image description" width="800" height="371"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Honestly, this is one of my favorite parts of using Cursor (especially over other Copilot implementations). Test code is often repetitive, and this helps you move fast without compromising on consistency.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;The Chat Assistant&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Cursor’s chat is powerful. You can ask questions, give instructions in natural language, and get precise code edits in return. There are three main modes:&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;1. Agent&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;Agent&lt;/strong&gt; mode is the most powerful one. It has access to your entire codebase, documentation, terminal, and file system. It can edit files, run commands, and even browse the web.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyqnqqu05zyeqt7hsujxd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyqnqqu05zyeqt7hsujxd.png" alt="Image description" width="800" height="319"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For example, I typed:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;“Add a custom command for a login method in the commands.js file”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff1t6agyw2y6cts2t1ppr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff1t6agyw2y6cts2t1ppr.png" alt="Image description" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And it delivered a complete, reusable custom command using getByTestId and parameterized login values—without me needing to explain anything about my codebase. That’s the magic of having full context awareness.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;2. Ask&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;Ask&lt;/strong&gt; mode is a “read-only” chat designed for exploration and learning. You can ask about specific parts of the codebase, and it’ll respond intelligently. However, it won’t modify files for you.&lt;/p&gt;

&lt;p&gt;For instance, using the same prompt as above, it still offered a login command, but this time it required manual copy-pasting.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe0qf9wla59bfolho4z8m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe0qf9wla59bfolho4z8m.png" alt="Image description" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;3. Edit&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt; allows you to highlight code and describe what you want changed. Cursor will then suggest and apply changes based on your instructions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2keh1ob0gqozsy5xz6ed.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2keh1ob0gqozsy5xz6ed.png" alt="Image description" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While each mode has its strengths, &lt;strong&gt;Agent&lt;/strong&gt; combines the capabilities of both Ask and Edit, making it the fastest and most efficient option in most cases.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Choosing Your LLM Model&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Cursor also lets you choose which large language model to use—or you can set it to &lt;strong&gt;Auto&lt;/strong&gt;, which selects the best model dynamically based on your prompt. This gives you flexibility while still optimizing for speed and accuracy.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5f2kjl5uymufcyzwaicq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5f2kjl5uymufcyzwaicq.png" alt="Image description" width="800" height="494"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Integrated Terminal&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Another killer feature: Cursor’s chat has terminal access. You can run commands directly from the chat interface without switching windows. For example, if you’ve just generated a test, you can run it immediately by clicking a button:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8y406z0wv2tn36c2j0va.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8y406z0wv2tn36c2j0va.png" alt="Image description" width="724" height="1600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Super helpful when debugging or running quick verifications.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqs18yv0uknovmjkyzhmv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqs18yv0uknovmjkyzhmv.png" alt="Image description" width="800" height="166"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Handling Errors and Debugging&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let’s say a test fails. Instead of pasting logs or searching Stack Overflow, you can:&lt;/p&gt;

&lt;p&gt;• Paste the error&lt;/p&gt;

&lt;p&gt;• Or even just send a screenshot&lt;/p&gt;

&lt;p&gt;In one case, I simply uploaded a screenshot with the prompt: &lt;strong&gt;“I have this error”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyakmfv7bzz6uuvctcc1s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyakmfv7bzz6uuvctcc1s.png" alt="Image description" width="800" height="399"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Without any additional context, Cursor identified the issue and provided a fix. This is a serious time-saver when debugging tricky problems:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmopt9nbyfsecc2o30czp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmopt9nbyfsecc2o30czp.png" alt="Image description" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;🔧 Improving Test Code&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Cursor also helps with optimizing existing tests. If you have flaky or outdated test cases, you can ask:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;“How can I improve this test?”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7aflntck4dmzmwa1rdkd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7aflntck4dmzmwa1rdkd.png" alt="Image description" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It will return a list of suggestions—some useful, some less so. But even when it’s not perfect, it sparks ideas and highlights areas for refactoring. Just remember: human judgment is still essential.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;✨ Bonus: Generate ReadMe Files and Scripts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Cursor can also generate project assets like ReadMe files or test scripts. For instance:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prompt:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;“Based on the codebase, generate a ReadMe file.”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Result:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0a5yum57lper0ye6alzh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0a5yum57lper0ye6alzh.png" alt="Image description" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A fully structured ReadMe with descriptions, setup steps, and test instructions. Same goes for custom scripts, like running only the homepage tests:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvvvbyynxxpa2zpvdttyy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvvvbyynxxpa2zpvdttyy.png" alt="Image description" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Just prompt it and run directly from chat. Pretty wild.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Final Thoughts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Cursor combines the familiarity of VS Code with the speed of AI. For writing Cypress tests, it’s one of the best tools I’ve used—boosting productivity, improving code quality, and even making debugging more intuitive.&lt;/p&gt;

&lt;p&gt;That said, not every AI suggestion will be perfect. You’ll still need to review and use your best judgment. But that’s part of the process—and honestly, part of the fun.&lt;/p&gt;

&lt;p&gt;If you give Cursor a try, I’d love to hear how it works for you. Hope these tips help on your automation journey.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Happy Testing! 🚀&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>cypress</category>
      <category>cursor</category>
      <category>ai</category>
      <category>programming</category>
    </item>
    <item>
      <title>A Guide for Efficient Prompting in QA Automation</title>
      <dc:creator>Normia Pop</dc:creator>
      <pubDate>Wed, 12 Feb 2025 19:01:39 +0000</pubDate>
      <link>https://forem.com/cypress/guide-for-efficient-prompting-in-qa-automation-1hlf</link>
      <guid>https://forem.com/cypress/guide-for-efficient-prompting-in-qa-automation-1hlf</guid>
      <description>&lt;p&gt;In today’s fast-paced development environment, AI is transforming automation testing by saving valuable time and reducing manual effort, especially when it comes to repetitive tasks. In this guide, I’ll walk you through what’s worked for me in my own testing journey with AI, including how to effectively prompt AI to generate precise test scripts, debug issues, and optimize your QA processes. By using the right techniques, I’ve found that AI can be a powerful tool to get the most accurate results with minimal effort.&lt;/p&gt;

&lt;p&gt;Let’s dive in!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Choose the Right Tool or Model&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The first step in leveraging AI for QA automation is selecting the right tool or model that best suits my needs. It’s important for me to do some research before diving in. For example, &lt;strong&gt;ChatGPT (GPT-4)&lt;/strong&gt; and &lt;strong&gt;GitHub Copilot&lt;/strong&gt; are excellent choices for generating and debugging code. ChatGPT excels at natural language processing, which allows for more conversational prompts, while GitHub Copilot is a code-specific assistant, perfect for generating boilerplate code and refactoring.&lt;/p&gt;

&lt;p&gt;Other models I might consider include &lt;strong&gt;Claude 3 Sonnet&lt;/strong&gt; by Anthropic, which excels at generating high-quality code for complex scenarios and edge cases, and &lt;strong&gt;Gemini&lt;/strong&gt; by Google DeepMind, which combines reasoning and creativity to tackle advanced automation tasks. &lt;strong&gt;DeepSeek&lt;/strong&gt;, on the other hand, is known for providing context-aware coding suggestions, making it particularly effective for deeper codebase integration.&lt;/p&gt;

&lt;p&gt;By carefully selecting the right model, we want to ensure that we are using the best tool suited to the task at hand.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Provide Context About Your Project’s Structure&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When requesting test generation, especially if the AI doesn’t have direct access to our codebase, it’s essential to offer context about the structure and patterns of my testing project. This could include naming conventions, folder structures, or specific elements to test. If possible, we could provide the HTML or components we want to test to help AI tailor the test script to our project’s unique structure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bad Prompt&lt;/strong&gt;: “Generate automation tests”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Good Prompt&lt;/strong&gt;: “Generate a UI automation test for a React application using Cypress and TypeScript. The project follows a functional design pattern, utilizes fixtures for reusable data, and includes custom commands for common interactions. Please focus on testing the user login flow, ensuring that both the login form and the error messages are validated”&lt;/p&gt;

&lt;p&gt;This level of detail helps ensure that AI-generated tests are well-suited for my project.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Be Specific in Your Prompts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Vague or general prompts won’t give us the detailed results I need for QA automation. Automated tests require specificity—whether it’s the functionality, type of app, testing environment, or the tools we are using. I personally always aim to be clear about the framework and programming language I’m working with.&lt;/p&gt;

&lt;p&gt;Additionally, providing context through system prompts can significantly improve the quality of the output. A &lt;strong&gt;context/system prompt&lt;/strong&gt; helps the AI understand the broader environment or the specific task I’m asking it to perform. For example, I can tell the model what type of tests I’m running, the state of the application, or any constraints I’m working within.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bad Prompt&lt;/strong&gt;: “Generate a test for the navbar”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Good Prompt&lt;/strong&gt;: “Generate a UI automation test for the navigation bar of a React app using Cypress and TypeScript. The app uses a BEM naming convention for CSS classes, and all test selectors should be located in the ‘Test IDs’ folder. Text constants like button labels should be stored in fixture files. The test should follow a functional design pattern and include custom commands for any repetitive steps, such as clicking navigation links. Please use the following HTML structure for the navbar: [Insert HTML]. Ensure the test validates that each menu item is clickable and visible.”&lt;/p&gt;

&lt;p&gt;The more context we provide, the more tailored and accurate the output will be. What I found helpful is to always review AI-generated output for accuracy—sometimes AI models will misinterpret instructions, and a human check could ensure the test is solid.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Use Consistent Templates&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When I started using AI, I was often surprised by how different the outputs were, depending on the level of detail in the prompt. By creating templates and sticking to a consistent structure, I found that my tests became more standardized and integrated smoothly into the broader test framework, making it easier to scale and manage in CI/CD pipelines.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bad Prompt&lt;/strong&gt;: “Generate API tests”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Good Prompt&lt;/strong&gt;: “Generate an integration test template for testing API endpoints in a Node.js app using Jest. The test should cover POST requests with JSON data.”&lt;/p&gt;

&lt;p&gt;This structured approach enables AI to generate reusable, well-organized test cases that fit seamlessly into our broader testing strategy. We can also use the same principle for generating edge cases by providing examples for more targeted results.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Leverage AI for Edge Case Generation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AI can be a valuable tool for generating edge cases—scenarios that I might not immediately think of when writing tests manually. To prompt AI effectively for edge cases, we need to be specific about the conditions we want to test.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bad Prompt&lt;/strong&gt;: “Generate edge cases”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Good Prompt&lt;/strong&gt;: “Generate edge cases for a form that validates email input. Consider variations of valid and invalid emails, including special characters, spaces, and different top-level domains.”&lt;/p&gt;

&lt;p&gt;This helps ensure that the AI tests a variety of edge cases and unexpected conditions, which could uncover hidden bugs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Request Optimizations and Refactoring&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Over time, tests can become large and difficult to manage, especially in complex projects. AI can assist us in refactoring test scripts to make them more efficient. I can ask AI for suggestions to improve the performance, readability, and maintainability of my test scripts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bad Prompt&lt;/strong&gt;: “Refactor this Cypress test”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Good Prompt&lt;/strong&gt;: “Refactor this Cypress test to reduce redundancy and improve performance when testing dynamic content on a page. Remove unnecessary waits and optimize the test for speed.”&lt;/p&gt;

&lt;p&gt;AI can make my tests cleaner and more efficient, allowing us to focus on more critical tasks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Use Iterative Refinement for Continuous Improvement&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AI might not get everything right on the first try, but it’s highly effective in refining outputs based on feedback. We can start with a basic test case and ask AI to improve it iteratively.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Initial Prompt&lt;/strong&gt;: “Can you improve this test case to handle when the user is redirected to a ‘welcome’ page after login instead of staying on the dashboard page? Feel free to ask any follow-up questions if something is not clear”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Follow-up Prompt&lt;/strong&gt;: “Now, can you modify the test to check if the welcome message is personalized based on the user’s first name?”&lt;/p&gt;

&lt;p&gt;This iterative feedback loop can refine test scripts continuously, improving accuracy and effectiveness.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8. Use AI for Debugging and Troubleshooting&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AI can assist with debugging by analyzing failed test cases and suggesting potential causes for failure. We should provide AI with logs, error messages, or failed test details to help pinpoint the issue.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bad Prompt&lt;/strong&gt;: “Why is this test failing?”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Good Prompt&lt;/strong&gt;: “Explain why this Cypress test is failing when checking if an element with class ‘submit-button’ is visible after clicking a dropdown. The error message I’m receiving is: Element not found: submit-button. Additionally, the test is failing at line 15 of the test file, where I’m using cy.get(’.submit-button’).should(‘be.visible’). Please include suggestions for fixing this issue, such as possible reasons for the element not being found or suggestions for more stable selectors”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Another Example with Specific Code&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;“I’m getting an error when running this Cypress test. The test checks if the ‘submit-button’ is visible after a dropdown is clicked. The error message is: Element not found: submit-button. Here’s the code for the failing part:&lt;/p&gt;

&lt;p&gt;[Code block]&lt;/p&gt;

&lt;p&gt;Can you explain why this might be failing, and suggest any improvements? I suspect it could be an issue with timing or waiting for the dropdown to load fully before checking the button’s visibility.”&lt;/p&gt;

&lt;p&gt;By using AI to debug, we can identify and resolve issues faster, without spending excessive time on manual troubleshooting.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;9. Automate More Complex Tasks&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AI can also help with more complex tasks such as integrating testing into our CI/CD pipeline, creating automated test schedules, or managing test environments. For instance, I can prompt AI to generate a GitHub Actions pipeline for my test suite.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bad Prompt&lt;/strong&gt;: “Help me set up GitHub Actions”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Good Prompt&lt;/strong&gt;: “Generate an example of integrating a GitHub Actions pipeline for an automation project with Cypress. The project is in the same repo as the frontend. We want the tests scheduled to run once per day and send an email notification if the test fails or passes.”&lt;/p&gt;

&lt;p&gt;By automating tasks like this, I can save time and focus on higher-priority work.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;10. Limitations and Considerations&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AI is undeniably powerful, but there are some key limitations and considerations to keep in mind when using it for QA automation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Data Quality&lt;/strong&gt;: AI is only as good as the data it’s trained on. If I provide a test case or prompt that lacks context or contains errors, the AI might provide incorrect or incomplete results. I should always validate my data before using AI to generate test scripts. One way I can validate the quality of my data is by reviewing it for completeness, accuracy, and relevance. I can also run my own tests to ensure the data aligns with expected outcomes, which helps identify potential gaps that AI might overlook.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Human Supervision&lt;/strong&gt;: While AI is an excellent tool for generating and refining test scripts, it should &lt;strong&gt;assist&lt;/strong&gt;, not &lt;strong&gt;replace&lt;/strong&gt;, human judgment. A good practice that I follow is to verify AI-generated tests, especially for complex scenarios or edge cases. AI can’t always understand the full context of a project or anticipate every possible interaction.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Confidentiality&lt;/strong&gt;: When using AI tools, especially cloud-based ones, we need to be mindful of the confidentiality of our codebase and sensitive information. AI models, especially third-party ones, may not guarantee that our code or data will remain private. We should avoid submitting proprietary code or confidential test cases unless I’m sure the platform is secure and respects privacy standards. Always check the terms of service and data.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;11. Quick Recap:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;Choose the right AI tool&lt;/strong&gt;: Conduct minimal research to select the best model, like ChatGPT or GitHub Copilot, Claude 3, Sonnet, Gemini, DeepSeek etc for your specific needs.&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;Be specific&lt;/strong&gt;: The more context you provide, the better the output.&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;Provide structure&lt;/strong&gt;: Share details about your project’s structure and patterns to help AI generate tailored test cases.&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;Use templates for consistency&lt;/strong&gt;: Leverage templates to maintain consistency across different test types.&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;Generate edge cases&lt;/strong&gt;: Be specific when asking AI to create edge cases and unpredictable test scenarios.&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;Optimize and refactor tests&lt;/strong&gt;: AI can make your tests more efficient, so ask for refactoring suggestions.&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;Iterative refinement&lt;/strong&gt;: Use iterative feedback loops to continuously improve test scripts.&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;Debug with AI&lt;/strong&gt;: Leverage AI for troubleshooting and identifying the root cause of failed tests.&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;Automate complex tasks&lt;/strong&gt;: Use AI to set up CI/CD pipelines and automate testing workflows.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Hows this:&lt;/p&gt;

&lt;p&gt;From my own experience, AI has been an absolute game-changer in my QA automation work. It’s helped me save so much time, reduced manual errors, and significantly improved my test coverage. By applying the strategies I’ve shared here, I’ve been able to fully leverage AI’s potential, making my testing process faster, more efficient, and much more effective.&lt;/p&gt;

&lt;p&gt;Looking ahead, I’m genuinely excited to see where AI goes and how it continues to evolve. But honestly, with the right approach, I’m confident that AI will be an integral part of automation testing for years to come. If you’re looking for a great way to dive deeper, I highly recommend checking out &lt;a href="https://www.youtube.com/watch?v=e4s40UBv-to&amp;amp;ab_channel=Cypress.io" rel="noopener noreferrer"&gt;Automatic Test Creation: Cypress AI + Studio on YouTube&lt;/a&gt;. It’s a great resource to see AI-powered testing in action.&lt;/p&gt;

&lt;p&gt;If you give these tips a try in your own projects, I’d love to hear how they work out for you.&lt;/p&gt;

&lt;p&gt;Happy Testing!&lt;/p&gt;

</description>
      <category>cypress</category>
      <category>ai</category>
      <category>qa</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
