Playwright Test Automation Framework Developed With The Help Of AI Search Agent.
In this article, we will discuss to generate a frontend test automation framework with Playwright and JavaScript on saucedemo website using AI-powered web agent Bolt.
Here is the website link: https://bolt.new/
What is Bolt?
Bolt.new developed by the StackBlitz team, is an amazing and powerful AI tool designed to streamline web development by automating code generation.
This AI-powered web development agent helps you to generate, test, and deploy web apps that use modern frameworks. You have to Prompt first and then run, edit and can deploy full-stack web and mobile apps directly from your browser and do not need an additional local set up.
Basically, first signup to Bolt. I have signed in using my GitHub credentials. After signing into bolt, First thing, Type in the prompt provided with the keywords you want.
You will see all the work done by the AI tool to generate your test automation framework within seconds. It's too fast!
If, it throws error like 'Tests are configured but cannot run in WebContainer. Please run locally.'
when running your tests here on the browser, just download the project to your local desktop on your computer to run the tests locally.
Click on the Download button as shown below.
Open this project on your VS Code locally on your computer.
Change your package.json as shown below.
Change From :
Change TO:
This AI Agent also creates an awesome README.md file.
Open the playwright.config.js file and modify it as headless as false to run the test in Headed mode as shown below.
Run the test with the command "npm run test:one" on your terminal
Voila.......! The test ran successfully!
I also pushed the code generated by this amazing AI Agent on to my GitHub. Please check the GitHub repo here: Playwright-with-AI.
You can also deploy your code using this wonderful AI-powered tool.
I'm really blown away with this AI-powered agent.
It is so amazing writing and generating code within seconds. It is too fast.
It also generates code for developers on creating mobile and web apps. AI is definitely rocking and soon or later it dominates and competes the market over Google users for sure.
Happy AI Automation Testing Guys :) !