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: Updating the locator for upgrade button on admin settings #33872

Merged
merged 3 commits into from
May 31, 2024

Conversation

ankitakinger
Copy link
Contributor

@ankitakinger ankitakinger commented May 31, 2024

Description

Updating the locator for upgrade button on admin settings

Fixes #Issue Number
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.Settings"

🔍 Cypress test results

Tip

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

Communication

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

  • Yes
  • No

@ankitakinger ankitakinger added the ok-to-test Required label for CI label May 31, 2024
@github-actions github-actions bot added skip-changelog Adding this label to a PR prevents it from being listed in the changelog Test labels May 31, 2024
Copy link
Contributor

coderabbitai bot commented May 31, 2024

Walkthrough

Walkthrough

The recent changes involve updating the locators for the "upgrade" button in various test files within the Cypress E2E testing suite. The primary modification is switching from XPath expressions or older data-testid attributes to a unified data-testid attribute. Additionally, the method for triggering clicks on the upgrade button has been updated in some test scripts to use a helper function for better consistency and reliability.

Changes

File Path Change Summary
app/client/cypress/locators/AdminsSettings.js Updated locator for "upgrade" button from XPath to data-testid attribute.
app/client/cypress/e2e/Regression/ClientSide/Branding/Branding_spec.js Changed CSS selector for upgradeButton to use a unified data-testid attribute.
app/client/cypress/e2e/Regression/Enterprise/AdminSettings/Admin_settings_spec.js Replaced cy.xpath(adminsSettings.upgrade).click(); with agHelper.GetNClick(adminsSettings.upgrade);
app/client/src/ce/pages/AdminSettings/Branding/UpgradeBanner.tsx Modified Button component's data-testid attribute to a unified value.

Sequence Diagram(s) (Beta)

No sequence diagrams generated as the changes are primarily updates to locators and method calls in test scripts.

Possibly related issues

  • appsmithorg/appsmith#33588: This task involves replacing class/id selectors with data-testid attributes, aligning with the changes made in this PR to use data-testid for the "upgrade" button.

Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between f1137ad and 34d8a38.

Files selected for processing (3)
  • app/client/cypress/e2e/Regression/ClientSide/Branding/Branding_spec.js (1 hunks)
  • app/client/cypress/e2e/Regression/Enterprise/AdminSettings/Admin_settings_spec.js (4 hunks)
  • app/client/src/ce/pages/AdminSettings/Branding/UpgradeBanner.tsx (1 hunks)
Files skipped from review due to trivial changes (1)
  • app/client/src/ce/pages/AdminSettings/Branding/UpgradeBanner.tsx
Additional context used
Biome
app/client/cypress/e2e/Regression/Enterprise/AdminSettings/Admin_settings_spec.js

[error] 9-159: This function expression can be turned into an arrow function.

app/client/cypress/e2e/Regression/ClientSide/Branding/Branding_spec.js

[error] 41-41: This let declares a variable that is only assigned once.

Additional comments not posted (3)
app/client/cypress/e2e/Regression/Enterprise/AdminSettings/Admin_settings_spec.js (2)

102-102: LGTM! Ensure that agHelper.GetNClick correctly handles the click event as expected.

Verification successful

The search results show multiple instances of agHelper.GetNClick being used across various test files, including the Admin_settings_spec.js file. This indicates that the method is widely adopted and likely functions as intended.

  • app/client/cypress/e2e/Regression/Enterprise/AdminSettings/Admin_settings_spec.js: agHelper.GetNClick(adminsSettings.upgrade);

Given the widespread usage and the specific instance in the Admin_settings_spec.js file, it appears that the method agHelper.GetNClick is correctly integrated and should handle the click event as expected.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that `agHelper.GetNClick` correctly triggers the expected behavior when clicking the upgrade button.

# Test: Search for the function usage. Expect: Only occurances of the new signature.
rg --type python $'agHelper.GetNClick'

Length of output: 68



Script:

#!/bin/bash
# Description: Verify that `agHelper.GetNClick` correctly triggers the expected behavior when clicking the upgrade button.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type js 'agHelper.GetNClick'

Length of output: 25656


123-123: LGTM! Ensure that agHelper.GetNClick correctly handles the click event as expected across all instances.

Also applies to: 138-138, 153-153

app/client/cypress/e2e/Regression/ClientSide/Branding/Branding_spec.js (1)

35-35: LGTM! Ensure that the new data-testid is consistently used across all relevant test cases.


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.

@ankitakinger ankitakinger added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels May 31, 2024
@ankitakinger ankitakinger added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels May 31, 2024
@NandanAnantharamu
Copy link
Collaborator

LGTM

@NandanAnantharamu NandanAnantharamu self-requested a review May 31, 2024 15:34
Copy link
Collaborator

@NandanAnantharamu NandanAnantharamu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ankitakinger ankitakinger merged commit 6d8c38f into release May 31, 2024
43 checks passed
@ankitakinger ankitakinger deleted the fix/cypress-locators branch May 31, 2024 15:37
@coderabbitai coderabbitai bot mentioned this pull request Dec 23, 2024
2 tasks
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 Test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants