Skip to content

Commit

Permalink
Merge branch 'MDL-77092-master' of https://github.com/sammarshallou/m…
Browse files Browse the repository at this point in the history
  • Loading branch information
junpataleta committed Feb 2, 2023
2 parents 929e5b4 + b639c14 commit de4a2a1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/tests/behat/behat_forms.php
Expand Up @@ -152,7 +152,7 @@ protected function expand_all_fields() {
$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,
Expand Down
17 changes: 17 additions & 0 deletions lib/tests/behat/expand_single_fieldset.feature
@@ -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"

0 comments on commit de4a2a1

Please sign in to comment.