mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
Merge pull request #1057 from creative-commoners/pulls/5.8/i-click-elements
MNT Use behat-extension function for clicking elements
This commit is contained in:
commit
d8ab74247c
@ -10,12 +10,12 @@ Feature: Next form step for userforms
|
|||||||
When I go to "/my-userform"
|
When I go to "/my-userform"
|
||||||
And I wait for 2 seconds
|
And I wait for 2 seconds
|
||||||
And the ".progress-title" element should contain "EditableFormStep_01"
|
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"
|
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 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"
|
Then the ".progress-title" element should contain "EditableFormStep_02"
|
||||||
# prevent the 'form has unsaved changes' alrt
|
# 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"
|
And I fill in "" for "EditableTextField_01"
|
||||||
|
@ -15,18 +15,6 @@ use SilverStripe\Versioned\Versioned;
|
|||||||
*/
|
*/
|
||||||
class FixtureContext extends BaseFixtureContext
|
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"
|
* Example: Given a userform with a hidden form step "My userform"
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user