mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
MDL-77092 Behat: Expand all fieldsets fails with single fieldset
The Behat step to expand all fieldsets did not work if the page contains only one fieldset.
This commit is contained in:
parent
880462a168
commit
b639c1455a
@ -152,7 +152,7 @@ class behat_forms extends behat_base {
|
||||
$expandsectionold = "//legend[@class='ftoggler']" .
|
||||
"//a[contains(concat(' ', @class, ' '), ' icons-collapse-expand ') and @aria-expanded = 'false']";
|
||||
// Else, look for the first expand fieldset link (current theme structure).
|
||||
$expandsectioncurrent = "//legend/div[contains(concat(' ', @class, ' '), ' ftoggler ')]" .
|
||||
$expandsectioncurrent = "//fieldset//div[contains(concat(' ', @class, ' '), ' ftoggler ')]" .
|
||||
"//a[contains(concat(' ', @class, ' '), ' icons-collapse-expand ') and @aria-expanded = 'false']";
|
||||
|
||||
$collapseexpandlink = $this->find('xpath', $expandallxpath . '|' . $expandsectionold . '|' . $expandsectioncurrent,
|
||||
|
17
lib/tests/behat/expand_single_fieldset.feature
Normal file
17
lib/tests/behat/expand_single_fieldset.feature
Normal file
@ -0,0 +1,17 @@
|
||||
@core
|
||||
Feature: Expand single fieldset in Behat tests
|
||||
In order to expand all fieldsets when there is only one
|
||||
As a developer
|
||||
I need Behat to successfully expand that fieldset
|
||||
|
||||
@javascript
|
||||
Scenario: Test expand all fieldsets when there is only one fieldset
|
||||
Given I log in as "admin"
|
||||
# This page was selected because it only has one fieldset.
|
||||
When I navigate to "Users > Accounts > Upload users" in site administration
|
||||
# Close the fieldset manually...
|
||||
And I click on "//a[@data-toggle='collapse']" "xpath_element"
|
||||
And I should not see "Example text file"
|
||||
# Expand using 'expand all' step.
|
||||
And I expand all fieldsets
|
||||
Then I should see "Example text file"
|
Loading…
x
Reference in New Issue
Block a user