Skip to content
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

test: Failing cypress tests due to removal of empty canvas prompts #34037

Merged

Conversation

rahulbarwal
Copy link
Contributor

@rahulbarwal rahulbarwal commented Jun 6, 2024

Description

This PR fixes impact of #33993

Refactors visual regression tests to use PageList for page generation; remove obsolete empty canvas spec and related selectors.

  • Removed unncessary: cypress/e2e/Regression/ClientSide/OtherUIFeatures/EmptyCanvas_spec.js
  • Fixes cypress/e2e/Regression/ClientSide/VisualTests/AppPageLayout_spec.js

RCA:
The original PR catered to removal of empty canvas prompts and visual tests were not run leading to subsequent failures in the CI for EmptyCanvas_spec & AppPageLayout_spec.

This PR caters to failing visual tests, while running @tag.Visual we noticed that other (unrelated) visual specs started failing. These new failures fail in local as well.
Whereas they were not failing in TBP or @tag.All runs and @tag.All succeeded for this PR as well.

Fixes #33874
or
Fixes Issue URL

Warning

If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.

Automation

/ok-to-test tags="@tag.All"

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/9413838227
Commit: b6d7f60
Cypress dashboard url: Click here!

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

  • Refactor

    • Updated method call for adding a new page in visual regression tests to improve code clarity and maintainability.
  • Chores

    • Removed unused locators and declarations to clean up the codebase.

… remove obsolete empty canvas spec and related selectors.
@rahulbarwal rahulbarwal added Templates Product Issues related to Templates Templates labels Jun 6, 2024
@rahulbarwal rahulbarwal self-assigned this Jun 6, 2024
@rahulbarwal rahulbarwal requested a review from jacquesikot June 6, 2024 11:42
Copy link
Contributor

coderabbitai bot commented Jun 6, 2024

Walkthrough

The recent changes focus on updating the Cypress visual regression tests for the AppPageLayout by importing additional modules and constants, and modifying the method used to add a new page. Additionally, the locators and methods related to generating CRUD pages have been removed, aligning with the objective to eliminate certain prompts from the first page of new apps.

Changes

Files Change Summary
app/client/cypress/e2e/Regression/ClientSide/VisualTests/AppPageLayout_spec.js Imported constants and modules, updated method call for adding a new page in the visual regression test script.
app/client/cypress/locators/GeneratePage.json Removed the generateCRUDPageActionCard locator.
app/client/cypress/support/Pages/HomePage.ts Removed _buildFromDataTableActionCard declaration from the HomePage class.

Assessment against linked issues

Objective Addressed Explanation
Remove the start from templates and generate CRUD page prompts from the first page of new apps (#33874)

Poem

In the code's enchanted grove,
New pages swiftly now evolve,
No CRUD prompts to obstruct the way,
A cleaner start for apps today.
With constants fresh and methods bright,
Our tests shall run, a flawless flight. 🐇✨


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@rahulbarwal rahulbarwal added the ok-to-test Required label for CI label Jun 6, 2024
@github-actions github-actions bot added the Bug Something isn't working label Jun 6, 2024
@ApekshaBhosale
Copy link
Contributor

@rahulbarwal Please change title of PR to test:failing cypress tests due to removal of empty canvas prompts and add which spec is being fixed in title or in description

@rahulbarwal rahulbarwal changed the title fix: failing cypress tests due to removal of empty canvas prompts test:failing cypress tests due to removal of empty canvas prompts Jun 6, 2024
@github-actions github-actions bot added skip-changelog Adding this label to a PR prevents it from being listed in the changelog Test and removed Bug Something isn't working labels Jun 6, 2024
@rahulbarwal
Copy link
Contributor Author

@rahulbarwal Please change title of PR to test:failing cypress tests due to removal of empty canvas prompts and add which spec is being fixed in title or in description

@ApekshaBhosale Updated both title and body to reflect fixes. These 2 were reported as well, but should be resolved already. I have run tag.templates to make sure there is no issues with them.
cypress/e2e/Regression/ClientSide/Templates/Fork_Template_To_App_spec.ts
cypress/e2e/Regression/ClientSide/Templates/ForkTemplateToGitConnectedApp.js

@ApekshaBhosale
Copy link
Contributor

@rahulbarwal can you please add the RCA of the spec in the description as well?

@ApekshaBhosale
Copy link
Contributor

@rahulbarwal Please change title of PR to test:failing cypress tests due to removal of empty canvas prompts and add which spec is being fixed in title or in description

@ApekshaBhosale Updated both title and body to reflect fixes. These 2 were reported as well, but should be resolved already. I have run tag.templates to make sure there is no issues with them. cypress/e2e/Regression/ClientSide/Templates/Fork_Template_To_App_spec.ts cypress/e2e/Regression/ClientSide/Templates/ForkTemplateToGitConnectedApp.js

i didn't understand about mentioned two specs. There 2 were reported? can you give little more context please?

@rahulbarwal
Copy link
Contributor Author

i didn't understand about mentioned two specs. There 2 were reported? can you give little more context please?

In this message from Trisha
She mentions these 4:
cypress/e2e/Regression/ClientSide/OtherUIFeatures/EmptyCanvas_spec.js
cypress/e2e/Regression/ClientSide/Templates/Fork_Template_To_App_spec.ts
cypress/e2e/Regression/ClientSide/Templates/ForkTemplateToGitConnectedApp.js
cypress/e2e/Regression/ClientSide/VisualTests/AppPageLayout_spec.js

But my original PR: #33993 took care of templates related issues.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Outside diff range and nitpick comments (1)
app/client/cypress/support/Pages/HomePage.ts (1)

[!TIP]
Codebase Verification

The _buildFromDataTableActionCard property is still referenced in the following files, albeit commented out:

  • app/client/cypress/e2e/Regression/ServerSide/QueryPane/Mongo1_spec.ts
  • app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/Postgres1_Spec.ts
  • app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/MySQL1_Spec.ts

These commented-out references should be removed to maintain code cleanliness and avoid confusion.

Analysis chain

Line range hint 1-1: Removal of _buildFromDataTableActionCard property aligns with PR objectives.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that no other methods are using the removed property.

# Test: Search for the property usage in the HomePage class. Expect: No occurrences.
rg --type ts '_buildFromDataTableActionCard' app/client/cypress/support/Pages

Length of output: 77



Script:

#!/bin/bash
# Description: Verify that no other parts of the codebase are using the removed property.

# Test: Search for the property usage in the entire codebase. Expect: No occurrences.
rg '_buildFromDataTableActionCard'

Length of output: 520

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 1e8a962 and 48ab152.

Files selected for processing (3)
  • app/client/cypress/e2e/Regression/ClientSide/VisualTests/AppPageLayout_spec.js (2 hunks)
  • app/client/cypress/locators/GeneratePage.json (1 hunks)
  • app/client/cypress/support/Pages/HomePage.ts (1 hunks)
Additional context used
Biome
app/client/cypress/support/Pages/HomePage.ts

[error] 269-269: The computed expression can be simplified without the use of a string literal. (lint/complexity/useLiteralKeys)

Unsafe fix: Use a literal key instead.


[error] 272-272: The computed expression can be simplified without the use of a string literal. (lint/complexity/useLiteralKeys)

Unsafe fix: Use a literal key instead.


[error] 402-402: Change to an optional chain. (lint/complexity/useOptionalChain)

Unsafe fix: Change to an optional chain.

Additional comments not posted (2)
app/client/cypress/locators/GeneratePage.json (1)

1-1: Removal of generateCRUDPageActionCard locator aligns with PR objectives.

app/client/cypress/e2e/Regression/ClientSide/VisualTests/AppPageLayout_spec.js (1)

1-7: Imports and method update in AppPageLayout_spec.js are appropriate and align with PR objectives.

jacquesikot
jacquesikot previously approved these changes Jun 6, 2024
@rahulbarwal rahulbarwal added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Jun 7, 2024
…o fix/failing-specs-due-to-removal-of-empty-canvas-prompts
@rahulbarwal rahulbarwal added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Jun 7, 2024
@mohanarpit mohanarpit changed the title test:failing cypress tests due to removal of empty canvas prompts test: Failing cypress tests due to removal of empty canvas prompts Jun 7, 2024
@github-actions github-actions bot added the Task A simple Todo label Jun 7, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 48ab152 and b6d7f60.

Files selected for processing (1)
  • app/client/cypress/e2e/Regression/ClientSide/VisualTests/AppPageLayout_spec.js (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • app/client/cypress/e2e/Regression/ClientSide/VisualTests/AppPageLayout_spec.js

@rahulbarwal rahulbarwal added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Jun 7, 2024
@rahulbarwal rahulbarwal merged commit c096bb5 into release Jun 7, 2024
87 checks passed
@rahulbarwal rahulbarwal deleted the fix/failing-specs-due-to-removal-of-empty-canvas-prompts branch June 7, 2024 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test Required label for CI skip-changelog Adding this label to a PR prevents it from being listed in the changelog Task A simple Todo Templates Product Issues related to Templates Test
Projects
None yet
3 participants