Here, we introduce effective prompts for creating specific test cases with MagicPod Autopilot or MagicPod MCP server.
We are also continuously looking for examples of how you use MagicPod Autopilot and effective prompts. Please feel free to share via the MagicPod Slack community or by contacting us directly.
Table of contents
Autopilot prompt examples
Test to get the subject of the latest email with MailSlurp
Related page: Email tests with MailSlurp
Prerequisite: Following the instructions in the help page above, obtain both the API access key and Inbox ID, and set their values in MagicPod’s secret shared variables.
Prompt:
Please create a test to retrieve the subject of the latest email with MailSlurp. The API key and InboxID have already been registered as shared variables.
Test to extract information from the email body with MailSlurp
Related page: Email tests with MailSlurp
Prerequisite: Following the instructions in the help page above, obtain both the API access key and Inbox ID, and set their values in MagicPod’s secret shared variables.
Prompt:
Please create a test to retrieve the 6-digit verification code from the body of the latest email with MailSlurp. The API key and Inbox ID have already been registered as shared variables.
Test to get the subject of the latest email with Gmail
Related page: Email tests with Gmail Web API
Prerequisite: Following the instructions in the help page above, obtain the Client ID, Client Secret, and Refresh Token, and set their values in MagicPod’s secret shared variables.
Prompt:
Please create a test that retrieves the subject of the latest Gmail using the Web API Call command.
Test to extract information from the email body with Gmail
Related page: Email tests with Gmail Web API
Prerequisite: Following the instructions in the help page above, obtain the Client ID, Client Secret, and Refresh Token, and set their values in MagicPod’s secret shared variables.
Prompt:
Please create test steps using the Web API Call command according to the following instructions:
1.Retrieve the Access Token
In the Web API Call, set as follows:
Method: POST
URL: https://accounts.google.com/o/oauth2/token
Header: Key = Content-Type, Value = application/x-www-form-urlencoded
Body: raw data, client_id=${CLIENT_ID}&client_secret=${CLIENT_SECRET}&refresh_token=${REFRESH_TOKEN}&grant_type=refresh_token
Result: Variable = ACCESS_TOKEN, JavaScript = jsonResponse["access_token"]
2. Retrieve the Mail ID
Method: GET
URL: https://www.googleapis.com/gmail/v1/users/me/messages/
Header: Key = Authorization, Value = Bearer ${ACCESS_TOKEN}
Result: Variable = MAIL_ID, JavaScript = jsonResponse["messages"][0]["id"]
3. Retrieve the Mail Body
Method: GET
URL: https://www.googleapis.com/gmail/v1/users/me/messages/${MAIL_ID}
Header: Key = Authorization, Value = Bearer ${ACCESS_TOKEN}
Result: Variable = MAIL_CONTENTS, JavaScript =
const inlineMessagePart = function(messagePart) {
let messagePartBodies = [{"mimeType": messagePart.mimeType, "body": messagePart.body}];
if ("parts" in messagePart) {
for (const subMsgPart of messagePart["parts"]) {
messagePartBodies = messagePartBodies.concat(inlineMessagePart(subMsgPart));
}
}
return messagePartBodies;
};
atob([jsonResponse['payload']].map(inlineMessagePart).flat().filter(function(item) { return item.mimeType === "text/plain"; })[0]['body']['data']);
After the above steps, add a step to search MAIL_CONTENTS for the specified number of digits in the integer string, and store it in the variable “AUTHENTICATION INFORMATION”.
MCP Server Prompt Examples
Create a test case
Create a new test case with the following details: - Target project URL: https://app.magicpod.com/<organization_name>/<project_name>/ - Test setting number: 1 - Test steps: 1. Open <URL>. 2. Enter `test@example.com` in the email address field. 3. Enter `password` in the password field. 4. Perform the necessary steps to complete user registration.
Edit a test case
Edit the existing test case as follows: - Test case URL: https://app.magicpod.com/<organization_name>/<project_name>/<testcase_number>/ - Update: 1. Change the value entered in the email address field to `magicpod@example.com`.
Run tests
Single run:
Run the following test case: - Test case URL: https://app.magicpod.com/<organization_name>/<project_name>/<testcase_number>/
Batch run:
Run a batch test with the following settings: - Target project URL: https://app.magicpod.com/<organization_name>/<project_name>/ - Batch run settings number: 2
Run specific test cases:
In the following project, rerun only the test cases that failed in the previous batch run: - Target project URL: https://app.magicpod.com/<organization_name>/<project_name>/
Run test cases with the following conditions: - Target project URL: https://app.magicpod.com/<organization_name>/<project_name>/ - Tests to run: Only test cases related to file operations - Browser: Chrome
Investigate test run results
Analyze the causes of failures in the latest batch run:
For each test case that failed in the latest batch run in the following project, identify the failed step and explain the cause of the failure: - Target project URL: https://app.magicpod.com/<organization_name>/<project_name>/
Investigate test failure reasons based on GitHub commit logs (requires GitHub MCP server installation):
Investigate the cause of failure for the following test run. Also, identify the code change that may have caused the failure by reviewing the commit history from ◯/◯ in the <GitHub organization name>/<GitHub project name> repository. - Target test result URL: https://app.magicpod.com/<organization_name>/<project_name>/batch-run/XXX/pattern-index/X/XXX/
Test execution result analysis:
Summarize the batch run results according to the following requirements: - Target project URL: https://app.magicpod.com/<organization_name>/<project_name>/ - Period: Batch runs executed within the past 7 days - Group by: Test setting - Output format: CSV
Identifying unstable locators
Check the following test case for any unstable locators. If any unstable locators are found, provide the step number where each locator is used and recommend a more stable locator to use instead. - Target test case URL: https://app.magicpod.com/<organization_name>/<project_name>/<testcase_number>/
Usage confirmation & troubleshooting
Please explain how to handle click command failures in MagicPod.
Please explain how to exclude specific areas from the visual diff check in MagicPod.
Other
Please provide the health score of the following project: - Target project URL: https://app.magicpod.com/<organization_name>/<project_name>/