Skip to content

806 adding data testid attribute#822

Merged
johbaxter merged 9 commits intodevfrom
806-adding-data-testid-attribute
Apr 24, 2025
Merged

806 adding data testid attribute#822
johbaxter merged 9 commits intodevfrom
806-adding-data-testid-attribute

Conversation

@memisrose
Copy link
Copy Markdown
Contributor

Description

Testing team noticed issues grabbing certain elements during automated testing.

Changes Made

Adding data-id's to elements that were hard to pinpoint during testing. Also adding Testing section to ReadMe.

How to Test

data-testid is now available on certain elements while inspecting.

@memisrose memisrose requested a review from a team as a code owner April 10, 2025 19:16
@memisrose memisrose linked an issue Apr 10, 2025 that may be closed by this pull request
4 tasks
@github-actions
Copy link
Copy Markdown

@CodiumAI-Agent /describe

@QodoAI-Agent
Copy link
Copy Markdown

Title

806 adding data testid attribute


User description

Description

Testing team noticed issues grabbing certain elements during automated testing.

Changes Made

Adding data-id's to elements that were hard to pinpoint during testing. Also adding Testing section to ReadMe.

How to Test

data-testid is now available on certain elements while inspecting.


PR Type

  • Tests

Description

  • Add data-testid to new app name input

  • Add dynamic data-testid to copy buttons


Changes walkthrough 📝

Relevant files
Tests
NewAppModal.tsx
Add data-testid to new app modal input                                     

packages/client/src/components/app/NewAppModal.tsx

  • Inserted inputProps with data-testid "new-app-name"
  • Enhances test element identification
  • +3/-0     
    EngineUsagePage.tsx
    Add dynamic data-testid to copy button                                     

    packages/client/src/pages/engine/EngineUsagePage.tsx

  • Added data-testid attribute on copy button
  • Utilizes label for dynamic id creation
  • +1/-0     

    Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • @github-actions
    Copy link
    Copy Markdown

    @CodiumAI-Agent /review

    @QodoAI-Agent
    Copy link
    Copy Markdown

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Consistency Check

    Verify that the addition of the testing identifier in inputProps aligns with the overall testing strategy and naming conventions used throughout similar components.

    inputProps={{
        'data-testid': 'new-app-name',
    }}
    Value Validation

    Confirm that the concatenated value for data-testid using the label variable reliably produces a valid identifier, especially when label might have unexpected content.

    data-testid={label + '-copy'}

    @github-actions
    Copy link
    Copy Markdown

    @CodiumAI-Agent /improve

    @QodoAI-Agent
    Copy link
    Copy Markdown

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Impact
    Possible issue
    Ensure fallback for label

    Verify that label is always defined to avoid unintended "undefined" values in the
    test-id; consider adding a fallback value.

    packages/client/src/pages/engine/EngineUsagePage.tsx [95]

    -+                                data-testid={label + '-copy'}
    ++                                data-testid={(label || 'default') + '-copy'}
    Suggestion importance[1-10]: 5

    __

    Why: The suggestion proposes a fallback for the 'label' variable to prevent potential "undefined" values in the test-id, which is a useful quality improvement though not critical.

    Low

    @memisrose memisrose self-assigned this Apr 14, 2025
    @memisrose memisrose added the Test Used for tickets related to FE testing label Apr 14, 2025
    @memisrose memisrose marked this pull request as draft April 14, 2025 13:38
    @memisrose memisrose marked this pull request as ready for review April 15, 2025 17:37
    @johbaxter johbaxter marked this pull request as draft April 15, 2025 17:55
    @memisrose memisrose marked this pull request as ready for review April 16, 2025 15:32
    @memisrose memisrose marked this pull request as draft April 21, 2025 18:00
    @memisrose memisrose marked this pull request as ready for review April 22, 2025 14:37
    @johbaxter johbaxter merged commit 1050748 into dev Apr 24, 2025
    3 checks passed
    @johbaxter johbaxter deleted the 806-adding-data-testid-attribute branch April 24, 2025 16:08
    @github-actions
    Copy link
    Copy Markdown

    @CodiumAI-Agent /update_changelog

    @QodoAI-Agent
    Copy link
    Copy Markdown

    Changelog updates: 🔄

    2025-04-24 [*][https://github.com//pull/822]

    Added

    • data-testids across various components for improved automated testing
    • “Testing” section in README with guidelines for test identifiers

    to commit the new content to the CHANGELOG.md file, please type:
    '/update_changelog --pr_update_changelog.push_changelog_changes=true'

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Labels

    Test Used for tickets related to FE testing

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    Adding data-testId attribute

    3 participants