mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
MNT Use behat-extension function for clicking elements
This commit is contained in:
parent
2bd2ee9780
commit
d178652cf8
@ -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"
|
||||
|
@ -15,18 +15,6 @@ use SilverStripe\Versioned\Versioned;
|
||||
*/
|
||||
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"
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user