I am creating a behat scenario that is supposed to click a horizontal tab on a paragraph with unlimited cardinality.

My behat setup is using selenium and chromedriver.

I have a content type that contains a paragraph reference with cardinality -1 (unlimited).

That paragraph has 2 horizontal tabs (tab 1 and tab 2).

When my scenario creates a node with 2 paragraphs, i can only click on tab 2 for the first paragraph. When I try to click tab 2 for paragraph 2, it fails with the following message

WebDriver\Exception\UnknownError: unknown error: Element ... is not clickable at point (224, 13). Other element would receive the click:
It states that other element would receive the click on #edit-group-answer (which is the element i am trying to click).

When I inspect the html that Drupal 8 is rendering, this makes sense... Since Drupal rendered the tag with id #edit-group-answer TWICE :-( Once for paragraph 1, tab 2 and once for paragraph 2, tab 2.

Anybody experienced a similar problem?

I could throw away my horizontal tabs, but that hardly feels right to sacrifice the UI in favor of the test?!

All suggestions welcomed!

Comments

guardian87 created an issue. See original summary.

  • zuuperman committed 5c655a2 on 8.x-3.x
    Issue #2904577: Duplicate CSS ID confuses behat
    
nils.destoop’s picture

Status: Active » Fixed

All identifiers now use the Html::getUniqueId method instead of the getId. This will result in unique ids if a group is rendered 2 times on a page..

  • zuuperman committed 6fcb12c on 8.x-3.x
    Revert "Issue #2904577: Duplicate CSS ID confuses behat"
    
    This reverts...
nils.destoop’s picture

Status: Fixed » Closed (duplicate)