Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-47944

Testability: Allow data- attributes to be added to RadioButtonGroup

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Minor Minor
    • blueocean-plugin
    • None
    • Blue Ocean - Candidates

      Summary:
      Having data- attributes available for the RadioButtonGroup control in the JDL would provide more robust selectors for automated tests.

      Reasoning:
      While working on my first Blue Ocean Acceptance Test, I've learned that it's a best practice to try and avoid the use of text-based XPATH selectors, such as the one on line 98 of EditorPage.java:

      wait.click(By.xpath("//*[text()='Commit to new branch']"));
      

      It would be great to have a data attribute attached to the RadioButtons in the RadioButtonGroup. That would provide for easier targeting in the tests, and changing the label next to the radio button itself wouldn't needlessly cause the test to fail.

      As it stands, the test passes, but it's clicking on the label for the radio button, not the button itself. It's sort of a happy accident that this works.

            Unassigned Unassigned
            kshultz Karl Shultz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: