diff --git a/src/utils/PilotPromptCreator.ts b/src/utils/PilotPromptCreator.ts index 754ff75..b222b58 100644 --- a/src/utils/PilotPromptCreator.ts +++ b/src/utils/PilotPromptCreator.ts @@ -33,6 +33,7 @@ export class PilotPromptCreator { ` Please generate a one-line string that precisely describes the next action the user should take to move closer to their goal,`, ` and another string (which can be greater than one line) which describes your thoughts while creating the step.`, ` If you think that the goal has been reached return a one word action 'success'`, + ` If there are any active loaders, spinners, animations, or partially rendered content in the screen, return "wait 3000" as the action.`, "2. Creating comprehensive UX, Accessibility, and Internationalization reports that include a review, findings, and a score.", "", "Please adhere to the instructions below to provide detailed and helpful responses.", @@ -329,6 +330,7 @@ The 'Profile' icon may not be properly adapted for different locales. ): string[] { const steps = [ "Analyze the provided goal, view hierarchy, and previous steps to understand the user's progress and available actions.", + "Check if there are any active loaders, spinners, animations, or partially rendered content in the view hierarchy - if so, the next action should be to wait for 3 seconds ('wait 3000').", `Consider the elements present in the view hierarchy${isSnapshotImageAttached ? " and the snapshot image" : ""} to determine possible next actions.`, "Determine the optimal next action the user should take to move closer to their goal.", "Ensure the action is directly related to available elements in the view hierarchy.", diff --git a/src/utils/__snapshots__/PilotPromptCreator.test.ts.snap b/src/utils/__snapshots__/PilotPromptCreator.test.ts.snap index 8debba4..5fa7a8d 100644 --- a/src/utils/__snapshots__/PilotPromptCreator.test.ts.snap +++ b/src/utils/__snapshots__/PilotPromptCreator.test.ts.snap @@ -9,6 +9,7 @@ You are an AI assistant tasked with: Please generate a one-line string that precisely describes the next action the user should take to move closer to their goal, and another string (which can be greater than one line) which describes your thoughts while creating the step. If you think that the goal has been reached return a one word action 'success' + If there are any active loaders, spinners, animations, or partially rendered content in the screen, return "wait 3000" as the action. 2. Creating comprehensive UX, Accessibility, and Internationalization reports that include a review, findings, and a score. Please adhere to the instructions below to provide detailed and helpful responses. @@ -40,16 +41,17 @@ Your tasks are as follows: ### Please follow these steps carefully: 1. Analyze the provided goal, view hierarchy, and previous steps to understand the user's progress and available actions. -2. Consider the elements present in the view hierarchy and the snapshot image to determine possible next actions. -3. Determine the optimal next action the user should take to move closer to their goal. -4. Ensure the action is directly related to available elements in the view hierarchy. -5. Make sure to create a unique screen name enclosed with blocks according to the snapshot and view. -6. Generate a one-line string that precisely describes this next action, enclosed within \`\` tags. -7. Provide a detailed description of your thought process enclosed within \`\` tags. -8. If the goal is achieved, add a \`\` block inside the \`\` section, summarizing the overall flow and findings. Also, provide comprehensive overall UX, Accessibility, and Internationalization reviews with total scores, given all the screens seen in previous steps, inside the respective review sections. -9. For each applicable review section (\`UX\`, \`Accessibility\`, \`Internationalization\`), create a comprehensive report enclosed within corresponding tags (e.g., \`\`, \`\`, \`\`), including a summary, findings, and a score out of 10. -10. Ensure each section is clearly labeled and formatted as shown in the examples. -11. If you cannot determine the next action due to ambiguity or missing information, throw an informative error explaining the problem in one sentence. +2. Check if there are any active loaders, spinners, animations, or partially rendered content in the view hierarchy - if so, the next action should be to wait for 3 seconds ('wait 3000'). +3. Consider the elements present in the view hierarchy and the snapshot image to determine possible next actions. +4. Determine the optimal next action the user should take to move closer to their goal. +5. Ensure the action is directly related to available elements in the view hierarchy. +6. Make sure to create a unique screen name enclosed with blocks according to the snapshot and view. +7. Generate a one-line string that precisely describes this next action, enclosed within \`\` tags. +8. Provide a detailed description of your thought process enclosed within \`\` tags. +9. If the goal is achieved, add a \`\` block inside the \`\` section, summarizing the overall flow and findings. Also, provide comprehensive overall UX, Accessibility, and Internationalization reviews with total scores, given all the screens seen in previous steps, inside the respective review sections. +10. For each applicable review section (\`UX\`, \`Accessibility\`, \`Internationalization\`), create a comprehensive report enclosed within corresponding tags (e.g., \`\`, \`\`, \`\`), including a summary, findings, and a score out of 10. +11. Ensure each section is clearly labeled and formatted as shown in the examples. +12. If you cannot determine the next action due to ambiguity or missing information, throw an informative error explaining the problem in one sentence. ### Verify the Prompt @@ -225,6 +227,7 @@ You are an AI assistant tasked with: Please generate a one-line string that precisely describes the next action the user should take to move closer to their goal, and another string (which can be greater than one line) which describes your thoughts while creating the step. If you think that the goal has been reached return a one word action 'success' + If there are any active loaders, spinners, animations, or partially rendered content in the screen, return "wait 3000" as the action. 2. Creating comprehensive UX, Accessibility, and Internationalization reports that include a review, findings, and a score. Please adhere to the instructions below to provide detailed and helpful responses. @@ -256,16 +259,17 @@ Your tasks are as follows: ### Please follow these steps carefully: 1. Analyze the provided goal, view hierarchy, and previous steps to understand the user's progress and available actions. -2. Consider the elements present in the view hierarchy to determine possible next actions. -3. Determine the optimal next action the user should take to move closer to their goal. -4. Ensure the action is directly related to available elements in the view hierarchy. -5. Make sure to create a unique screen name enclosed with blocks according to the snapshot and view. -6. Generate a one-line string that precisely describes this next action, enclosed within \`\` tags. -7. Provide a detailed description of your thought process enclosed within \`\` tags. -8. If the goal is achieved, add a \`\` block inside the \`\` section, summarizing the overall flow and findings. Also, provide comprehensive overall UX, Accessibility, and Internationalization reviews with total scores, given all the screens seen in previous steps, inside the respective review sections. -9. For each applicable review section (\`UX\`, \`Accessibility\`, \`Internationalization\`), create a comprehensive report enclosed within corresponding tags (e.g., \`\`, \`\`, \`\`), including a summary, findings, and a score out of 10. -10. Ensure each section is clearly labeled and formatted as shown in the examples. -11. If you cannot determine the next action due to ambiguity or missing information, throw an informative error explaining the problem in one sentence. +2. Check if there are any active loaders, spinners, animations, or partially rendered content in the view hierarchy - if so, the next action should be to wait for 3 seconds ('wait 3000'). +3. Consider the elements present in the view hierarchy to determine possible next actions. +4. Determine the optimal next action the user should take to move closer to their goal. +5. Ensure the action is directly related to available elements in the view hierarchy. +6. Make sure to create a unique screen name enclosed with blocks according to the snapshot and view. +7. Generate a one-line string that precisely describes this next action, enclosed within \`\` tags. +8. Provide a detailed description of your thought process enclosed within \`\` tags. +9. If the goal is achieved, add a \`\` block inside the \`\` section, summarizing the overall flow and findings. Also, provide comprehensive overall UX, Accessibility, and Internationalization reviews with total scores, given all the screens seen in previous steps, inside the respective review sections. +10. For each applicable review section (\`UX\`, \`Accessibility\`, \`Internationalization\`), create a comprehensive report enclosed within corresponding tags (e.g., \`\`, \`\`, \`\`), including a summary, findings, and a score out of 10. +11. Ensure each section is clearly labeled and formatted as shown in the examples. +12. If you cannot determine the next action due to ambiguity or missing information, throw an informative error explaining the problem in one sentence. ### Verify the Prompt @@ -441,6 +445,7 @@ You are an AI assistant tasked with: Please generate a one-line string that precisely describes the next action the user should take to move closer to their goal, and another string (which can be greater than one line) which describes your thoughts while creating the step. If you think that the goal has been reached return a one word action 'success' + If there are any active loaders, spinners, animations, or partially rendered content in the screen, return "wait 3000" as the action. 2. Creating comprehensive UX, Accessibility, and Internationalization reports that include a review, findings, and a score. Please adhere to the instructions below to provide detailed and helpful responses. @@ -483,16 +488,17 @@ Your tasks are as follows: ### Please follow these steps carefully: 1. Analyze the provided goal, view hierarchy, and previous steps to understand the user's progress and available actions. -2. Consider the elements present in the view hierarchy to determine possible next actions. -3. Determine the optimal next action the user should take to move closer to their goal. -4. Ensure the action is directly related to available elements in the view hierarchy. -5. Make sure to create a unique screen name enclosed with blocks according to the snapshot and view. -6. Generate a one-line string that precisely describes this next action, enclosed within \`\` tags. -7. Provide a detailed description of your thought process enclosed within \`\` tags. -8. If the goal is achieved, add a \`\` block inside the \`\` section, summarizing the overall flow and findings. Also, provide comprehensive overall UX, Accessibility, and Internationalization reviews with total scores, given all the screens seen in previous steps, inside the respective review sections. -9. For each applicable review section (\`UX\`, \`Accessibility\`, \`Internationalization\`), create a comprehensive report enclosed within corresponding tags (e.g., \`\`, \`\`, \`\`), including a summary, findings, and a score out of 10. -10. Ensure each section is clearly labeled and formatted as shown in the examples. -11. If you cannot determine the next action due to ambiguity or missing information, throw an informative error explaining the problem in one sentence. +2. Check if there are any active loaders, spinners, animations, or partially rendered content in the view hierarchy - if so, the next action should be to wait for 3 seconds ('wait 3000'). +3. Consider the elements present in the view hierarchy to determine possible next actions. +4. Determine the optimal next action the user should take to move closer to their goal. +5. Ensure the action is directly related to available elements in the view hierarchy. +6. Make sure to create a unique screen name enclosed with blocks according to the snapshot and view. +7. Generate a one-line string that precisely describes this next action, enclosed within \`\` tags. +8. Provide a detailed description of your thought process enclosed within \`\` tags. +9. If the goal is achieved, add a \`\` block inside the \`\` section, summarizing the overall flow and findings. Also, provide comprehensive overall UX, Accessibility, and Internationalization reviews with total scores, given all the screens seen in previous steps, inside the respective review sections. +10. For each applicable review section (\`UX\`, \`Accessibility\`, \`Internationalization\`), create a comprehensive report enclosed within corresponding tags (e.g., \`\`, \`\`, \`\`), including a summary, findings, and a score out of 10. +11. Ensure each section is clearly labeled and formatted as shown in the examples. +12. If you cannot determine the next action due to ambiguity or missing information, throw an informative error explaining the problem in one sentence. ### Verify the Prompt