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

Testability: Allow data- attributes to be added to RadioButtonGroup

    XMLWordPrintable

    Details

    • Similar Issues:
    • Sprint:
      Blue Ocean - Candidates

      Description

      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.

        Attachments

          Activity

          There are no comments yet on this issue.

            People

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

              Dates

              Created:
              Updated: