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

ElementClickInterceptedError using Selenium in 5.1.0 #4762

Closed
damian opened this issue Feb 12, 2024 · 2 comments · Fixed by #4768
Closed

ElementClickInterceptedError using Selenium in 5.1.0 #4762

damian opened this issue Feb 12, 2024 · 2 comments · Fixed by #4768
Labels
🐛 bug Something isn't working the way it should (including incorrect wording in documentation) checkboxes radios

Comments

@damian
Copy link

damian commented Feb 12, 2024

Description of the issue

5.1.0 contains some refactoring to the CSS for radio buttons and checkboxes resulting in these form controls no longer able to be selected / checked by ID using Selenium. This really should have been a breaking change in my opinion, as it will break a lot of acceptance test suites(including ours).

Steps to reproduce the issue

const { Builder, By } = require('selenium-webdriver');

(async function helloSelenium() {
  try {
    let driver = await new Builder().forBrowser('chrome').build();

    await driver.get('https://design-system.service.gov.uk/components/radios/default/');

    const wales = await driver.findElement(By.id('whereDoYouLive-3'));
    wales.click();
  } catch (e) {
    console.log(e);
  }
})();
ElementClickInterceptedError: element click intercepted: Element <input class="govuk-radios__input" id="whereDoYouLive-3" name="whereDoYouLive" type="radio" value="wales"> is not clickable at point (52, 215). Other element would receive the click: <label class="govuk-label govuk-radios__label" for="whereDoYouLive-3">...</label>

Actual vs expected behaviour

  • Actual: Selenium throws the above error as the pseudo elements are positioned over the top of the input
  • Expected: The radio to be selected
@damian damian added awaiting triage Needs triaging by team 🐛 bug Something isn't working the way it should (including incorrect wording in documentation) labels Feb 12, 2024
@owenatgov owenatgov added checkboxes radios and removed awaiting triage Needs triaging by team labels Feb 12, 2024
@romaricpascal
Copy link
Member

Hi @damian,

Thanks for reporting this and providing an example to quickly reproduce the issue. Looks like we missed the disappearance of the z-index that was putting the input above its label, which introduced this unexpected breaking change.

We're working on a long-term way to test for this so it doesn't disappear again without us noticing after we add it back and will ship as soon as we get it ready.

Apologies for the unexpected breakage and thanks for your patience.

@damian
Copy link
Author

damian commented Feb 16, 2024

No worries - thanks for acknowledging this and putting in a fix just as quickly, its very much appreciated 🙌

MartinJJones added a commit to alphagov/smart-answers that referenced this issue Jun 28, 2024
Version 5.1.0 of govuk-frontend contains refactoring to the CSS for radio buttons and checkboxes, this change resulted in tests throwing an `ElementClickInterceptedError`.

This was logged as a GitHub issue in govuk-frontend
 - alphagov/govuk-frontend#4762

This issue was fixed in version 5.2.0 - alphagov/govuk-frontend#4768
MartinJJones added a commit to alphagov/smart-answers that referenced this issue Jul 2, 2024
Version 5.1.0 of govuk-frontend contains refactoring to the CSS for radio buttons and checkboxes, this change resulted in tests throwing an `ElementClickInterceptedError`.

This was logged as a GitHub issue in govuk-frontend
 - alphagov/govuk-frontend#4762

This issue was fixed in version 5.2.0 - alphagov/govuk-frontend#4768
MartinJJones added a commit to alphagov/smart-answers that referenced this issue Jul 5, 2024
Version 5.1.0 of govuk-frontend contains refactoring to the CSS for radio buttons and checkboxes, this change resulted in tests throwing an `ElementClickInterceptedError`.

This was logged as a GitHub issue in govuk-frontend
 - alphagov/govuk-frontend#4762

This issue was fixed in version 5.2.0 - alphagov/govuk-frontend#4768
MartinJJones added a commit to alphagov/smart-answers that referenced this issue Jul 10, 2024
Version 5.1.0 of govuk-frontend contains refactoring to the CSS for radio buttons and checkboxes, this change resulted in tests throwing an `ElementClickInterceptedError`.

This was logged as a GitHub issue in govuk-frontend
 - alphagov/govuk-frontend#4762

This issue was fixed in version 5.2.0 - alphagov/govuk-frontend#4768
MartinJJones added a commit to alphagov/smart-answers that referenced this issue Jul 12, 2024
Version 5.1.0 of govuk-frontend contains refactoring to the CSS for radio buttons and checkboxes, this change resulted in tests throwing an `ElementClickInterceptedError`.

This was logged as a GitHub issue in govuk-frontend
 - alphagov/govuk-frontend#4762

This issue was fixed in version 5.2.0 - alphagov/govuk-frontend#4768
andysellick pushed a commit to alphagov/smart-answers that referenced this issue Jul 15, 2024
Version 5.1.0 of govuk-frontend contains refactoring to the CSS for radio buttons and checkboxes, this change resulted in tests throwing an `ElementClickInterceptedError`.

This was logged as a GitHub issue in govuk-frontend
 - alphagov/govuk-frontend#4762

This issue was fixed in version 5.2.0 - alphagov/govuk-frontend#4768
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working the way it should (including incorrect wording in documentation) checkboxes radios
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants