Commit 707fcbda authored by Robert Lyon's avatar Robert Lyon
Browse files

Adjusting behat test that set field to "1"



But really they are actually clicking a checkbox or selecting a radio
button - so we should use the actual steps for that

Change-Id: I1152d0fa7b867720a7aa1452bc71d24771f35eae
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent ec666d1f
......@@ -653,6 +653,7 @@ class BehatForms extends BehatBase {
$page = $this->getSession()->getPage();
foreach ($page->findAll('css', 'label') as $label) {
if ($textliteral === "'" . $label->getText() . "'" ||
$textliteral === '"' . $label->getText() . '"' ||
$textliteral === $this->escaper->escapeLiteral(preg_replace('/"/', '\"', $label->getHtml()))) {
$radioButton = $page->find('css', '#' . $label->getAttribute('for'));
$radioButton->click();
......
......@@ -25,7 +25,7 @@ Scenario: Create Image block
And I follow "Image"
And I attach the file "Image1.jpg" to "File"
Then I should see "Image - Image1.jpg"
And I set the field "Show description" to "1"
And I enable the switch "Show description"
And I press "Save"
And I scroll to the top
And I follow "Display page"
......
......@@ -31,7 +31,7 @@ Scenario: Add Journal block to the page
Given I follow "Journal" in the "blocktype sidebar" property
And I press "Add"
And I set the field "Mars journal" to "1"
And I select the radio "Mars journal"
And I press "Save"
And I display the page
Then I should see "Spacefood is kind of gross"
......@@ -40,7 +40,7 @@ Scenario: Add specific Journal entry to the page
Given I follow "Journal entry" in the "blocktype sidebar" property
And I press "Add"
And I wait "1" seconds
And I set the field "I'm going to Mars!" to "1"
And I select the radio "I'm going to Mars! (Mars journal)"
And I press "Save"
And I display the page
Then I should see "I just passed my exam"
......@@ -49,7 +49,7 @@ Scenario: Add specific Journal entry to the page
Scenario: Add a recent journal entries block to the page
Given I follow "Recent journal entries" in the "blocktype sidebar" property
And I press "Add"
And I set the field "Mars journal" to "1"
And I select the radio "Mars journal"
And I press "Save"
And I display the page
Then I should see "Spacefood"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment