Skip to content

Commit

Permalink
Merge pull request #1057 from creative-commoners/pulls/5.8/i-click-el…
Browse files Browse the repository at this point in the history
…ements

MNT Use behat-extension function for clicking elements
  • Loading branch information
bergice authored Apr 22, 2021
2 parents 2bd2ee9 + d178652 commit d8ab742
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
8 changes: 4 additions & 4 deletions tests/behat/features/next-form-step.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ Feature: Next form step for userforms
When I go to "/my-userform"
And I wait for 2 seconds
And the ".progress-title" element should contain "EditableFormStep_01"
When I click the ".step-button-next" element
When I click on the ".step-button-next" element
Then the ".progress-title" element should contain "EditableFormStep_03"
When I click the ".step-button-prev" element
When I click on the ".step-button-prev" element
And I fill in "abc" for "EditableTextField_01"
And I click the ".step-button-next" element
And I click on the ".step-button-next" element
Then the ".progress-title" element should contain "EditableFormStep_02"
# prevent the 'form has unsaved changes' alrt
When I click the ".step-button-prev" element
When I click on the ".step-button-prev" element
And I fill in "" for "EditableTextField_01"
12 changes: 0 additions & 12 deletions tests/behat/src/FixtureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,6 @@
*/
class FixtureContext extends BaseFixtureContext
{
/**
* @When /^I click the "([^"]+)" element$/
* @param $selector
*/
public function iClickTheElement(string $selector): void
{
$page = $this->getMainContext()->getSession()->getPage();
$element = $page->find('css', $selector);
assertNotNull($element, sprintf('Element %s not found', $selector));
$element->click();
}

/**
* Example: Given a userform with a hidden form step "My userform"
*
Expand Down

0 comments on commit d8ab742

Please sign in to comment.