-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: cypress snapshot types #34561
fix: cypress snapshot types #34561
Conversation
WalkthroughThe updates involve adding the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Commits
Files that changed from the base of the PR and between e72be34 and 38fc1133bafeeb0d7b2e5d74fefa28c565039f64.
Files ignored due to path filters (1)
app/client/yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
Files selected for processing (2)
- app/client/cypress/support/Pages/Anvil/AnvilSnapshot.ts (3 hunks)
- app/client/package.json (1 hunks)
Files skipped from review due to trivial changes (1)
- app/client/package.json
Additional comments not posted (3)
app/client/cypress/support/Pages/Anvil/AnvilSnapshot.ts (3)
19-21
: Approved changes to image comparison method.The addition of
{ comparisonMethod: "ssim" }
to thematchImageSnapshot
calls is consistent with the PR objectives to reduce false positives in snapshot comparisons. Ensure existing tests are updated to accommodate this change.Also applies to: 27-29
68-68
: Approved enhanced snapshot comparison for device-specific settings.The inclusion of
{ comparisonMethod: "ssim", capture: "fullPage" }
in device-specific snapshot comparisons is a well-considered enhancement. Ensure the integration of these settings does not disrupt existing device-specific tests.
41-43
: Approved update to snapshot comparison in preview mode.The update to include
{ comparisonMethod: "ssim" }
in thematchImageSnapshot
call aligns with the goal of enhancing image comparison accuracy. Verify that this change does not affect the overall functionality of preview mode.Verification successful
Let's refine the shell script to correctly identify the impact of the new comparison method on the
verifyPreviewMode
function by using the correct file type and focusing on the relevant method.
To ensure the new comparison method does not affect the overall functionality, we need to verify where
verifyPreviewMode
is invoked.
Approved update to snapshot comparison in preview mode.
The update to include
{ comparisonMethod: "ssim" }
in thematchImageSnapshot
call aligns with the goal of enhancing image comparison accuracy. The functionverifyPreviewMode
is invoked in multiple test files, ensuring that any potential issues with the updated comparison method would be detected.
app/client/cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilButtonWidgetSnapshot_spec.ts
app/client/cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilIconButtonWidgetSnapshot_spec.ts
app/client/cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilToolbarButtonWidgetSnapshot_spec.ts
app/client/cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInlineButtonWidgetSnapshot_spec.ts
app/client/cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCurrencyInputWidgetSnapshot_spec.ts
app/client/cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInputWidgetSnapshot_spec.ts
app/client/cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilPhoneInputWidgetSnapshot_spec.ts
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the impact of the new comparison method on preview mode functionality. rg --type typescript --files-with-matches 'verifyPreviewMode' | xargs rg 'matchImageSnapshot'Length of output: 13968
Script:
#!/bin/bash # Description: Verify the impact of the new comparison method on preview mode functionality. rg --type ts --files-with-matches 'verifyPreviewMode' | xargs rg 'matchImageSnapshot'Length of output: 547
Script:
#!/bin/bash # Description: Search for instances where the `verifyPreviewMode` method is invoked. rg 'verifyPreviewMode' --type tsLength of output: 1233
38fc113
to
47fa265
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Commits
Files that changed from the base of the PR and between 38fc1133bafeeb0d7b2e5d74fefa28c565039f64 and 47fa2658cd563eec2da0cbb8b8cda437d6b820f0.
Files ignored due to path filters (1)
app/client/yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
Files selected for processing (2)
- app/client/cypress/support/Pages/Anvil/AnvilSnapshot.ts (3 hunks)
- app/client/package.json (1 hunks)
Files skipped from review as they are similar to previous changes (2)
- app/client/cypress/support/Pages/Anvil/AnvilSnapshot.ts
- app/client/package.json
47fa265
to
d32cf9c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Commits
Files that changed from the base of the PR and between 47fa2658cd563eec2da0cbb8b8cda437d6b820f0 and d32cf9c3701c8947dfd8399b08e477ce867400f3.
Files ignored due to path filters (1)
app/client/yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
Files selected for processing (2)
- app/client/cypress/support/Pages/Anvil/AnvilSnapshot.ts (3 hunks)
- app/client/package.json (1 hunks)
Files skipped from review as they are similar to previous changes (2)
- app/client/cypress/support/Pages/Anvil/AnvilSnapshot.ts
- app/client/package.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Commits
Files that changed from the base of the PR and between d32cf9c3701c8947dfd8399b08e477ce867400f3 and 4e6013a8111ee9996732153bc5385c68feccf581.
Files selected for processing (1)
- app/client/cypress/support/Pages/Anvil/AnvilSnapshot.ts (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- app/client/cypress/support/Pages/Anvil/AnvilSnapshot.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Commits
Files that changed from the base of the PR and between 4e6013a8111ee9996732153bc5385c68feccf581 and 0e8e75c991b6215a3436ca8203818cbb52a95d21.
Files ignored due to path filters (36)
app/client/cypress/snapshots/AnvilButtonWidgetSnapshot_spec.ts/anvilButtonWidgetCanvas.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilButtonWidgetSnapshot_spec.ts/anvilButtonWidgetCanvasDark.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilButtonWidgetSnapshot_spec.ts/anvilButtonWidgetDeployipad-2.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilButtonWidgetSnapshot_spec.ts/anvilButtonWidgetDeployiphone-6.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilButtonWidgetSnapshot_spec.ts/anvilButtonWidgetDeploymacbook-13.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilButtonWidgetSnapshot_spec.ts/anvilButtonWidgetPreview.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilCurrencyInputWidgetSnapshot_spec.ts/anvilCurrencyInputWidgetDeployipad-2.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilCurrencyInputWidgetSnapshot_spec.ts/anvilCurrencyInputWidgetDeployiphone-6.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilCurrencyInputWidgetSnapshot_spec.ts/anvilCurrencyInputWidgetDeploymacbook-13.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilIconButtonWidgetSnapshot_spec.ts/anvilIconButtonWidgetCanvas.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilIconButtonWidgetSnapshot_spec.ts/anvilIconButtonWidgetCanvasDark.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilIconButtonWidgetSnapshot_spec.ts/anvilIconButtonWidgetDeployipad-2.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilIconButtonWidgetSnapshot_spec.ts/anvilIconButtonWidgetDeployiphone-6.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilIconButtonWidgetSnapshot_spec.ts/anvilIconButtonWidgetDeploymacbook-13.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilIconButtonWidgetSnapshot_spec.ts/anvilIconButtonWidgetPreview.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilInlineButtonWidgetSnapshot_spec.ts/anvilInlineButtonWidgetCanvas.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilInlineButtonWidgetSnapshot_spec.ts/anvilInlineButtonWidgetCanvasDark.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilInlineButtonWidgetSnapshot_spec.ts/anvilInlineButtonWidgetDeployipad-2.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilInlineButtonWidgetSnapshot_spec.ts/anvilInlineButtonWidgetDeployiphone-6.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilInlineButtonWidgetSnapshot_spec.ts/anvilInlineButtonWidgetDeploymacbook-13.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilInlineButtonWidgetSnapshot_spec.ts/anvilInlineButtonWidgetPreview.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilInputWidgetSnapshot_spec.ts/anvilInputWidgetDeployipad-2.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilInputWidgetSnapshot_spec.ts/anvilInputWidgetDeployiphone-6.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilInputWidgetSnapshot_spec.ts/anvilInputWidgetDeploymacbook-13.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilModel_spec.ts/anvilModalLargeSize.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilModel_spec.ts/anvilModalMediumSize.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilModel_spec.ts/anvilModalSmallSize.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilPhoneInputWidgetSnapshot_spec.ts/anvilPhoneInputWidgetDeployipad-2.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilPhoneInputWidgetSnapshot_spec.ts/anvilPhoneInputWidgetDeployiphone-6.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilPhoneInputWidgetSnapshot_spec.ts/anvilPhoneInputWidgetDeploymacbook-13.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilToolbarButtonWidgetSnapshot_spec.ts/anvilToolbarButtonWidgetCanvas.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilToolbarButtonWidgetSnapshot_spec.ts/anvilToolbarButtonWidgetCanvasDark.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilToolbarButtonWidgetSnapshot_spec.ts/anvilToolbarButtonWidgetDeployipad-2.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilToolbarButtonWidgetSnapshot_spec.ts/anvilToolbarButtonWidgetDeployiphone-6.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilToolbarButtonWidgetSnapshot_spec.ts/anvilToolbarButtonWidgetDeploymacbook-13.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilToolbarButtonWidgetSnapshot_spec.ts/anvilToolbarButtonWidgetPreview.snap.png
is excluded by!**/*.png
Files selected for processing (1)
- app/client/package.json (3 hunks)
Additional comments not posted (1)
app/client/package.json (1)
86-86
: Review of added dependency@types/cypress-image-snapshot
.Adding this dependency supports the new typing for
matchImageSnapshot
method in Cypress, aligning with the PR objectives to enhance typing support. This change is appropriate and should help ensure that TypeScript can correctly type-check the usage of this Cypress plugin.
app/client/package.json
Outdated
@@ -42,7 +42,8 @@ | |||
"prettier:ci": "yarn workspaces foreach -ptv run prettier", | |||
"check-types": "yarn tsc --noEmit", | |||
"init-husky": "cd ../.. && husky install app/client/.husky", | |||
"clean:workspaces": "yarn workspaces foreach -pAv exec rm -rf node_modules" | |||
"clean:workspaces": "yarn workspaces foreach -pAv exec rm -rf node_modules", | |||
"generate:anvil-snapshots": "rm -rf cypress/snapshots/Anvil* && npx cypress run --spec cypress/e2e/Regression/ClientSide/Anvil/Widgets/** --browser chrome" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review of the script generate:anvil-snapshots
.
The script is designed to remove existing Anvil snapshots and generate new ones using Cypress in the Chrome browser. This aligns with the PR objectives to update snapshot comparison methods. However, consider adding error handling to manage potential failures in snapshot generation.
- "generate:anvil-snapshots": "rm -rf cypress/snapshots/Anvil* && npx cypress run --spec cypress/e2e/Regression/ClientSide/Anvil/Widgets/** --browser chrome"
+ "generate:anvil-snapshots": "rm -rf cypress/snapshots/Anvil* && npx cypress run --spec cypress/e2e/Regression/ClientSide/Anvil/Widgets/** --browser chrome || echo 'Snapshot generation failed. Check the Cypress logs for more details.'"
This addition ensures that any failure in the snapshot generation process is clearly communicated, improving maintainability and operability.
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
"generate:anvil-snapshots": "rm -rf cypress/snapshots/Anvil* && npx cypress run --spec cypress/e2e/Regression/ClientSide/Anvil/Widgets/** --browser chrome" | |
"generate:anvil-snapshots": "rm -rf cypress/snapshots/Anvil* && npx cypress run --spec cypress/e2e/Regression/ClientSide/Anvil/Widgets/** --browser chrome || echo 'Snapshot generation failed. Check the Cypress logs for more details.'" |
0e8e75c
to
d32cf9c
Compare
76936b5
to
47ab88e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Commits
Files that changed from the base of the PR and between 76936b5e8652c6211f373b499529b86f105c86e7 and 47ab88ec8de79bbf60d15296e1300f3191f4105c.
Files ignored due to path filters (23)
app/client/cypress/snapshots/AnvilButtonWidgetSnapshot_spec.ts/anvilButtonWidgetDeployipad-2.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilButtonWidgetSnapshot_spec.ts/anvilButtonWidgetDeployiphone-6.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilButtonWidgetSnapshot_spec.ts/anvilButtonWidgetDeploymacbook-13.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilButtonWidgetSnapshot_spec.ts/anvilButtonWidgetPreview.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilCurrencyInputWidgetSnapshot_spec.ts/anvilCurrencyInputWidgetCanvas.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilCurrencyInputWidgetSnapshot_spec.ts/anvilCurrencyInputWidgetCanvasDark.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilCurrencyInputWidgetSnapshot_spec.ts/anvilCurrencyInputWidgetDeployipad-2.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilCurrencyInputWidgetSnapshot_spec.ts/anvilCurrencyInputWidgetDeployiphone-6.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilCurrencyInputWidgetSnapshot_spec.ts/anvilCurrencyInputWidgetDeploymacbook-13.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilCurrencyInputWidgetSnapshot_spec.ts/anvilCurrencyInputWidgetPreview.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilInputWidgetSnapshot_spec.ts/anvilInputWidgetCanvas.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilInputWidgetSnapshot_spec.ts/anvilInputWidgetCanvasDark.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilInputWidgetSnapshot_spec.ts/anvilInputWidgetDeployipad-2.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilInputWidgetSnapshot_spec.ts/anvilInputWidgetDeployiphone-6.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilInputWidgetSnapshot_spec.ts/anvilInputWidgetDeploymacbook-13.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilInputWidgetSnapshot_spec.ts/anvilInputWidgetPreview.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilPhoneInputWidgetSnapshot_spec.ts/anvilPhoneInputWidgetCanvas.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilPhoneInputWidgetSnapshot_spec.ts/anvilPhoneInputWidgetCanvasDark.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilPhoneInputWidgetSnapshot_spec.ts/anvilPhoneInputWidgetDeployipad-2.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilPhoneInputWidgetSnapshot_spec.ts/anvilPhoneInputWidgetDeployiphone-6.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilPhoneInputWidgetSnapshot_spec.ts/anvilPhoneInputWidgetDeploymacbook-13.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilPhoneInputWidgetSnapshot_spec.ts/anvilPhoneInputWidgetPreview.snap.png
is excluded by!**/*.png
app/client/yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
Files selected for processing (6)
- app/client/cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCurrencyInputWidgetSnapshot_spec.ts (1 hunks)
- app/client/cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilIconButtonWidgetSnapshot_spec.ts (1 hunks)
- app/client/cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInputWidgetSnapshot_spec.ts (1 hunks)
- app/client/cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilPhoneInputWidgetSnapshot_spec.ts (1 hunks)
- app/client/cypress/support/Pages/Anvil/AnvilSnapshot.ts (4 hunks)
- app/client/package.json (2 hunks)
Files skipped from review as they are similar to previous changes (6)
- app/client/cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCurrencyInputWidgetSnapshot_spec.ts
- app/client/cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilIconButtonWidgetSnapshot_spec.ts
- app/client/cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInputWidgetSnapshot_spec.ts
- app/client/cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilPhoneInputWidgetSnapshot_spec.ts
- app/client/cypress/support/Pages/Anvil/AnvilSnapshot.ts
- app/client/package.json
47ab88e
to
cfbc791
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Commits
Files that changed from the base of the PR and between 47ab88ec8de79bbf60d15296e1300f3191f4105c and cfbc791d13f4bdc41567d3719a7413774856c3c3.
Files ignored due to path filters (45)
app/client/cypress/snapshots/AnvilButtonWidgetSnapshot_spec.ts/anvilButtonWidgetCanvas.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilButtonWidgetSnapshot_spec.ts/anvilButtonWidgetCanvasDark.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilButtonWidgetSnapshot_spec.ts/anvilButtonWidgetDeployipad-2.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilButtonWidgetSnapshot_spec.ts/anvilButtonWidgetDeployiphone-6.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilButtonWidgetSnapshot_spec.ts/anvilButtonWidgetDeploymacbook-13.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilButtonWidgetSnapshot_spec.ts/anvilButtonWidgetPreview.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilCurrencyInputWidgetSnapshot_spec.ts/anvilCurrencyInputWidgetCanvas.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilCurrencyInputWidgetSnapshot_spec.ts/anvilCurrencyInputWidgetCanvasDark.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilCurrencyInputWidgetSnapshot_spec.ts/anvilCurrencyInputWidgetDeployipad-2.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilCurrencyInputWidgetSnapshot_spec.ts/anvilCurrencyInputWidgetDeployiphone-6.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilCurrencyInputWidgetSnapshot_spec.ts/anvilCurrencyInputWidgetDeploymacbook-13.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilCurrencyInputWidgetSnapshot_spec.ts/anvilCurrencyInputWidgetPreview.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilIconButtonWidgetSnapshot_spec.ts/anvilIconButtonWidgetCanvas.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilIconButtonWidgetSnapshot_spec.ts/anvilIconButtonWidgetCanvasDark.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilIconButtonWidgetSnapshot_spec.ts/anvilIconButtonWidgetDeployipad-2.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilIconButtonWidgetSnapshot_spec.ts/anvilIconButtonWidgetDeployiphone-6.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilIconButtonWidgetSnapshot_spec.ts/anvilIconButtonWidgetDeploymacbook-13.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilIconButtonWidgetSnapshot_spec.ts/anvilIconButtonWidgetPreview.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilInlineButtonWidgetSnapshot_spec.ts/anvilInlineButtonWidgetCanvas.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilInlineButtonWidgetSnapshot_spec.ts/anvilInlineButtonWidgetCanvasDark.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilInlineButtonWidgetSnapshot_spec.ts/anvilInlineButtonWidgetDeployipad-2.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilInlineButtonWidgetSnapshot_spec.ts/anvilInlineButtonWidgetDeployiphone-6.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilInlineButtonWidgetSnapshot_spec.ts/anvilInlineButtonWidgetDeploymacbook-13.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilInlineButtonWidgetSnapshot_spec.ts/anvilInlineButtonWidgetPreview.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilInputWidgetSnapshot_spec.ts/anvilInputWidgetCanvas.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilInputWidgetSnapshot_spec.ts/anvilInputWidgetCanvasDark.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilInputWidgetSnapshot_spec.ts/anvilInputWidgetDeployipad-2.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilInputWidgetSnapshot_spec.ts/anvilInputWidgetDeployiphone-6.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilInputWidgetSnapshot_spec.ts/anvilInputWidgetDeploymacbook-13.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilInputWidgetSnapshot_spec.ts/anvilInputWidgetPreview.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilModal_spec.ts/anvilModalLargeSize.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilModal_spec.ts/anvilModalMediumSize.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilModal_spec.ts/anvilModalSmallSize.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilPhoneInputWidgetSnapshot_spec.ts/anvilPhoneInputWidgetCanvas.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilPhoneInputWidgetSnapshot_spec.ts/anvilPhoneInputWidgetCanvasDark.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilPhoneInputWidgetSnapshot_spec.ts/anvilPhoneInputWidgetDeployipad-2.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilPhoneInputWidgetSnapshot_spec.ts/anvilPhoneInputWidgetDeployiphone-6.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilPhoneInputWidgetSnapshot_spec.ts/anvilPhoneInputWidgetDeploymacbook-13.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilPhoneInputWidgetSnapshot_spec.ts/anvilPhoneInputWidgetPreview.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilToolbarButtonWidgetSnapshot_spec.ts/anvilToolbarButtonWidgetCanvas.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilToolbarButtonWidgetSnapshot_spec.ts/anvilToolbarButtonWidgetCanvasDark.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilToolbarButtonWidgetSnapshot_spec.ts/anvilToolbarButtonWidgetDeployipad-2.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilToolbarButtonWidgetSnapshot_spec.ts/anvilToolbarButtonWidgetDeployiphone-6.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilToolbarButtonWidgetSnapshot_spec.ts/anvilToolbarButtonWidgetDeploymacbook-13.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilToolbarButtonWidgetSnapshot_spec.ts/anvilToolbarButtonWidgetPreview.snap.png
is excluded by!**/*.png
Files selected for processing (7)
- app/client/cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCurrencyInputWidgetSnapshot_spec.ts (1 hunks)
- app/client/cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilIconButtonWidgetSnapshot_spec.ts (1 hunks)
- app/client/cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInputWidgetSnapshot_spec.ts (1 hunks)
- app/client/cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilPhoneInputWidgetSnapshot_spec.ts (1 hunks)
- app/client/cypress/support/Pages/Anvil/AnvilSnapshot.ts (4 hunks)
- app/client/package.json (2 hunks)
- app/client/src/pages/AppViewer/index.tsx (1 hunks)
Files skipped from review due to trivial changes (1)
- app/client/src/pages/AppViewer/index.tsx
Files skipped from review as they are similar to previous changes (6)
- app/client/cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCurrencyInputWidgetSnapshot_spec.ts
- app/client/cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilIconButtonWidgetSnapshot_spec.ts
- app/client/cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInputWidgetSnapshot_spec.ts
- app/client/cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilPhoneInputWidgetSnapshot_spec.ts
- app/client/cypress/support/Pages/Anvil/AnvilSnapshot.ts
- app/client/package.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Commits
Files that changed from the base of the PR and between cfbc791d13f4bdc41567d3719a7413774856c3c3 and 99234b4fb8a05464c981cf07775687f538673052.
Files selected for processing (1)
- app/client/cypress/support/Pages/Anvil/AnvilSnapshot.ts (5 hunks)
Files skipped from review as they are similar to previous changes (1)
- app/client/cypress/support/Pages/Anvil/AnvilSnapshot.ts
99234b4
to
b997cc2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Commits
Files that changed from the base of the PR and between 99234b4fb8a05464c981cf07775687f538673052 and b997cc2.
Files ignored due to path filters (46)
app/client/cypress/snapshots/AnvilButtonWidgetSnapshot_spec.ts/anvilButtonWidgetCanvas.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilButtonWidgetSnapshot_spec.ts/anvilButtonWidgetCanvasDark.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilButtonWidgetSnapshot_spec.ts/anvilButtonWidgetDeployipad-2.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilButtonWidgetSnapshot_spec.ts/anvilButtonWidgetDeployiphone-6.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilButtonWidgetSnapshot_spec.ts/anvilButtonWidgetDeploymacbook-13.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilButtonWidgetSnapshot_spec.ts/anvilButtonWidgetPreview.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilCurrencyInputWidgetSnapshot_spec.ts/anvilCurrencyInputWidgetCanvas.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilCurrencyInputWidgetSnapshot_spec.ts/anvilCurrencyInputWidgetCanvasDark.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilCurrencyInputWidgetSnapshot_spec.ts/anvilCurrencyInputWidgetDeployipad-2.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilCurrencyInputWidgetSnapshot_spec.ts/anvilCurrencyInputWidgetDeployiphone-6.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilCurrencyInputWidgetSnapshot_spec.ts/anvilCurrencyInputWidgetDeploymacbook-13.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilCurrencyInputWidgetSnapshot_spec.ts/anvilCurrencyInputWidgetPreview.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilIconButtonWidgetSnapshot_spec.ts/anvilIconButtonWidgetCanvas.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilIconButtonWidgetSnapshot_spec.ts/anvilIconButtonWidgetCanvasDark.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilIconButtonWidgetSnapshot_spec.ts/anvilIconButtonWidgetDeployipad-2.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilIconButtonWidgetSnapshot_spec.ts/anvilIconButtonWidgetDeployiphone-6.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilIconButtonWidgetSnapshot_spec.ts/anvilIconButtonWidgetDeploymacbook-13.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilIconButtonWidgetSnapshot_spec.ts/anvilIconButtonWidgetPreview.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilInlineButtonWidgetSnapshot_spec.ts/anvilInlineButtonWidgetCanvas.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilInlineButtonWidgetSnapshot_spec.ts/anvilInlineButtonWidgetCanvasDark.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilInlineButtonWidgetSnapshot_spec.ts/anvilInlineButtonWidgetDeployipad-2.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilInlineButtonWidgetSnapshot_spec.ts/anvilInlineButtonWidgetDeployiphone-6.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilInlineButtonWidgetSnapshot_spec.ts/anvilInlineButtonWidgetDeploymacbook-13.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilInlineButtonWidgetSnapshot_spec.ts/anvilInlineButtonWidgetPreview.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilInputWidgetSnapshot_spec.ts/anvilInputWidgetCanvas.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilInputWidgetSnapshot_spec.ts/anvilInputWidgetCanvasDark.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilInputWidgetSnapshot_spec.ts/anvilInputWidgetDeployipad-2.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilInputWidgetSnapshot_spec.ts/anvilInputWidgetDeployiphone-6.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilInputWidgetSnapshot_spec.ts/anvilInputWidgetDeploymacbook-13.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilInputWidgetSnapshot_spec.ts/anvilInputWidgetPreview.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilModal_spec.ts/anvilModalLargeSize.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilModal_spec.ts/anvilModalMediumSize.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilModal_spec.ts/anvilModalSmallSize.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilPhoneInputWidgetSnapshot_spec.ts/anvilPhoneInputWidgetCanvas.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilPhoneInputWidgetSnapshot_spec.ts/anvilPhoneInputWidgetCanvasDark.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilPhoneInputWidgetSnapshot_spec.ts/anvilPhoneInputWidgetDeployipad-2.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilPhoneInputWidgetSnapshot_spec.ts/anvilPhoneInputWidgetDeployiphone-6.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilPhoneInputWidgetSnapshot_spec.ts/anvilPhoneInputWidgetDeploymacbook-13.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilPhoneInputWidgetSnapshot_spec.ts/anvilPhoneInputWidgetPreview.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilToolbarButtonWidgetSnapshot_spec.ts/anvilToolbarButtonWidgetCanvas.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilToolbarButtonWidgetSnapshot_spec.ts/anvilToolbarButtonWidgetCanvasDark.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilToolbarButtonWidgetSnapshot_spec.ts/anvilToolbarButtonWidgetDeployipad-2.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilToolbarButtonWidgetSnapshot_spec.ts/anvilToolbarButtonWidgetDeployiphone-6.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilToolbarButtonWidgetSnapshot_spec.ts/anvilToolbarButtonWidgetDeploymacbook-13.snap.png
is excluded by!**/*.png
app/client/cypress/snapshots/AnvilToolbarButtonWidgetSnapshot_spec.ts/anvilToolbarButtonWidgetPreview.snap.png
is excluded by!**/*.png
app/client/yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
Files selected for processing (7)
- app/client/cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCurrencyInputWidgetSnapshot_spec.ts (1 hunks)
- app/client/cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilIconButtonWidgetSnapshot_spec.ts (1 hunks)
- app/client/cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInputWidgetSnapshot_spec.ts (1 hunks)
- app/client/cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilPhoneInputWidgetSnapshot_spec.ts (1 hunks)
- app/client/cypress/support/Pages/Anvil/AnvilSnapshot.ts (5 hunks)
- app/client/package.json (2 hunks)
- app/client/src/pages/AppViewer/index.tsx (1 hunks)
Files skipped from review as they are similar to previous changes (6)
- app/client/cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCurrencyInputWidgetSnapshot_spec.ts
- app/client/cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInputWidgetSnapshot_spec.ts
- app/client/cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilPhoneInputWidgetSnapshot_spec.ts
- app/client/cypress/support/Pages/Anvil/AnvilSnapshot.ts
- app/client/package.json
- app/client/src/pages/AppViewer/index.tsx
Additional context used
Path-based instructions (1)
app/client/cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilIconButtonWidgetSnapshot_spec.ts (1)
Pattern
app/client/cypress/**/*.*
: Follow best practices for Cypress code and e2e automation.
Avoid using cy.wait.
Use variables for locators, not strings.
Usedata-*
attributes for selectors; avoid Xpaths and CSS attributes.
Avoid selectors like.btn.submit
orbutton[type=submit]
.
Perform logins via API withLoginFromAPI
.
Only interact with controlled sites/servers.
Ensure tests can run withit.only
and are independent.
Usebefore
,beforeEach
,after
,afterEach
correctly; clean state before tests.
Check new specs for flakiness by running them 10 times on CI.
Use multiple assertions; don't treat Cypress as unit tests.
Use constants for strings.
Include datasource operations inbefore
hooks.
@@ -13,6 +13,7 @@ describe( | |||
}); | |||
|
|||
it("1. Canvas Mode", () => { | |||
cy.wait(5000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid using hardcoded wait times in Cypress tests.
Using cy.wait(5000);
can lead to flaky tests and unnecessary delays. Instead, consider waiting for specific conditions or elements to be ready. For example, you can wait for the widget to be visible or for a specific element to appear.
- cy.wait(5000);
+ cy.get('[data-testid="IconButtonWidget"]').should('be.visible');
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
cy.wait(5000); | |
cy.get('[data-testid="IconButtonWidget"]').should('be.visible'); |
Description
Fix the typing for
matchImageSnapshot
method.Change the method of comparing screenshots to
ssim
, since there should be less false positives with this method. More info here.Automation
/ok-to-test tags="@tag.All"
🔍 Cypress test results
Caution
🔴 🔴 🔴 Some tests have failed.
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/9791539605
Commit: b997cc2
Cypress dashboard.
Tags: @tag.All
The following are new failures, please fix them before merging the PR:
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
New Features
ssim
method for more accurate image comparisons.Bug Fixes
data-testid="t--app-viewer-page-body"
attribute for better test reliability in theAppViewer
component.Style
Button
component to enhance visual spacing.Chores
@types/cypress-image-snapshot
for enhanced testing capabilities.Tests
IconButtonWidget
to ensure stable test execution.