Last active
July 22, 2020 18:47
-
-
Save kevinquillen/e9cf8336b28e838964fcd596ba5488d0 to your computer and use it in GitHub Desktop.
A Behat definition that will instruct the client to press a vertical tab, useful for forms leveraging Field Group in Drupal (Shiny admin theme).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @When I press the :vertical_tab vertical tab | |
* @param $vertical_tab | |
*/ | |
public function iPressTheVerticalTab($vertical_tab) { | |
$this->getSession()->getDriver()->click('//*[contains(@class, "node-form")]/div/div[contains(@class, "vertical-tabs")]/ul/*/a/strong[text()="' . $vertical_tab . '"]'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The xpath wasn't working for me so I needed to tweak it a bit. This works in
@javascript
. Gets takes the tab name and then scrolls the tab into view to make sure it's clickable