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

Cuprite finding elements inside closed detail tags #184

Open
brenogazzola opened this issue Jan 13, 2022 · 0 comments
Open

Cuprite finding elements inside closed detail tags #184

brenogazzola opened this issue Jan 13, 2022 · 0 comments

Comments

@brenogazzola
Copy link

brenogazzola commented Jan 13, 2022

I'm in the process of replacing selenium with cuprite for my Rails system tests. I have a green CI with selenium, but when I switch to cuprite I start getting a lot of errors like this:

Test:

within ".modal-body-confirmation" do
  click_button "Yes, delete"
end

Message

Capybara::Ambiguous: Ambiguous match, found 3 elements matching visible css ".modal-body-confirmation"

After checking, I discovered that I had 3 .modal-body-confirmation elements inside 3 different detail tags, but only 1 of those tags was open. So it seems that this file used for the specs needs to be updated to include a test for closed detail tags.

This is an extraction of what the HTML looked like at the failure. You can see 2 modal-body-confirmation but only whose parent detail element is open.

<details open="">
  <summary class="modal-trigger">
    <button class="" title="Recomeçar lista de presentes"><span>Recomeçar lista de presentes</span></button>
  </summary>
  <div class="modal-content pos-1001">
    <div class="modal-body modal-body-confirmation">
      <!-- Redacted -->
    </div>
  </div>
</details>

<details>
  <summary class="modal-trigger">
    <div class="" title="Remover loja"><span>Remover loja</span></div>
  </summary>
  <div class="modal-content pos-1001">
    <div class="modal-body modal-body-confirmation">
      <!-- Redacted -->
    </div>    
  </div>
</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant