You can automate end-to-end testing workflows (UI, API, and Database) by defining custom Cursor Rules (.mdc files). By combining the Playwright MCP Server with other MCP servers like the SQLite MCP Server, you can instruct AI agents to perform complex sequences such as navigating to a URL, interacting with UI elements, and verifying data persistence in a database without writing manual test scripts.
To implement this, create a Cursor Rule file that defines a trigger command (e.g., /test) and provides the agent with the necessary context, such as URLs, element IDs, and schema locations.
When I say /test, then perform following
Navigate to http://localhost:8000/Product/List.
Create product by clicking Create link .
Then create a product with some realistic data for Name, Price and Select ProductType as CPU and click create input type with id as Create.
Check the Database for the created record
Use the Schema: http://localhost:8001/swagger/v1/swagger.json
Here is the baseURL of API Base URL: http://localhost:8001/
Also check the API which performs the GET operation if the values are correctly retreived for the created product from the above schema