You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"IMPORTANT: DO NOT SKIP ANY STEP. All the setup steps described below MUST be executed regardless of any existing configuration or setup. This ensures proper BrowserStack SDK setup.";
3
3
4
4
exportconstSETUP_PERCY_DESCRIPTION=
5
-
"Set up Percy visual testing for your project. This supports both Percy Web Standalone and Percy Automate.";
5
+
"Set up or expand Percy visual testing configuration with comprehensive coverage for existing projects that might have Percy integrated. This supports both Percy Web Standalone and Percy Automate. Example prompts: Expand percy coverage for this project {project_name}";
6
6
7
7
exportconstLIST_TEST_FILES_DESCRIPTION=
8
8
"Lists all test files for a given set of directories.";
"Set up and run automated web-based tests on BrowserStack using the BrowserStack SDK. Use this tool for functional or integration test setup on BrowserStack only. For any visual testing or Percy integration, use the dedicated Percy setup tool. Example prompts: run this test on browserstack; set up this project for browserstack.";
15
15
16
-
exportconstSIMULATE_PERCY_CHANGE_DESCRIPTION=
17
-
"This tool helps new users simulate a Percy visual change by guiding them to make a visible UI modification, rerun Percy, and verify that the change is detected. Only Percy web is supported";
16
+
exportconstSIMULATE_PERCY_CHANGE_DESCRIPTION=`Integrate Percy visual testing into new projects and demonstrate visual change detection through a step-by-step simulation. This tool handles initial Percy integration, setup, and creates a working demonstration for new users. Primary tool for prompts like: "Integrate percy for this project", "Integrate percy in this project {project_name}"`;
@@ -35,7 +34,7 @@ Process files in STRICT sequential order using tool addPercySnapshotCommands() w
35
34
exportconstPERCY_SIMULATE_INSTRUCTION=`
36
35
MANDATORY: Aggressive, Accurate Percy Snapshots Integration
37
36
38
-
Prerequisite: Before making any code changes in the user's repo, switch to a branch named temp-percy (run git init first if the repo is not yet initialized).
37
+
Prerequisite: Before making any code changes in the user's repository, create and switch to a new branch named browserstack-simulation. Stage all changes but do not commit them. If the repository has not been initialized yet, run git init first.
39
38
40
39
You MUST follow these steps with NO EXCEPTIONS:
41
40
1. Identify 4-5 key test files in the project that are critical for visual testing.
@@ -53,7 +52,7 @@ STEP 1: At this case we have added Percy snapshot commands to the test files at
53
52
- Do NOT add any popup injection or visual changes yet.
54
53
- Do NOT run any Percy builds at this stage.
55
54
56
-
STEP 2: Run ONE comprehensive baseline Percy build that executes ALL tests containing Percy snapshots in a SINGLE build. This creates one baseline build with all snapshots for comparison. Use a command like: npx percy exec -- python -m pytest tests/ -k 'test_name1 or test_name2 or test_name3' -v to run multiple specific tests in one build."
55
+
STEP 2: Run ONE comprehensive baseline Percy build that executes ALL tests containing Percy snapshots in a SINGLE build. This creates one baseline build with all snapshots for comparison. Use a command like: npx percy exec --label=mcp -- python -m pytest tests/ -k 'test_name1 or test_name2 or test_name3' -v to run multiple specific tests in one build."
57
56
58
57
STEP 3: Modify your test to inject a visible UI change (such as a popup) IMMEDIATELY BEFORE an EXISTING snapshot command (e.g., before percy_snapshot(self.driver, "screenshot name")).
percy_snapshot(self.driver, "Before Adding to Cart") # (Do NOT change the snapshot name, keep existing one)
78
77
\`\`\`
79
78
80
-
STEP 4: Run a second Percy build.
79
+
STEP 4: Run a second Percy build with same label and same test command as the baseline.
81
80
- The snapshot names must remain the same as in the baseline.
82
81
- The visual change should now appear in the same snapshot as before.
83
82
- Use the same build command you ran for the baseline.
84
83
85
84
STEP 5: Compare the two Percy builds to see the detected visual difference.
86
85
87
-
STEP 6: Now ask user if they want to setup percy for full project coverage? If yes, call the "setupPercyVisualTesting" tool to enable complete coverage for the entire project.
86
+
STEP 6: Now ask user if they want to expand percy for other testcases? If yes, call the "expandPercyVisualTesting" tool to enable complete coverage for the entire project.
88
87
89
88
CONSTRAINTS:
90
89
- Do NOT run any builds until explicitly instructed in the steps.
@@ -100,3 +99,6 @@ VALIDATION CHECKPOINTS (before proceeding to the next step):
100
99
CRITICAL:
101
100
Do NOT run tests separately or create multiple builds during baseline establishment. The goal is to have exactly TWO builds total: (1) baseline build with all original snapshots, (2) modified build with the same tests but visual changes injected.
0 commit comments