Skip to content

Commit

Permalink
Merge branch 'MDL-73631' of https://github.com/paulholden/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Feb 8, 2022
2 parents 939cb7a + 108feb6 commit 68ae89c
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 21 deletions.
13 changes: 7 additions & 6 deletions reportbuilder/tests/behat/columneditor.feature
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ Feature: Manage custom report columns
And I should see "Full name" in the "reportbuilder-table" "table"

Scenario: Rename column in report
Given the following "core_reportbuilder > Reports" exist:
| name | source | default |
| My report | core_user\reportbuilder\datasource\users | 0 |
And the following "core_reportbuilder > Columns" exist:
| report | uniqueidentifier |
| My report | user:fullname |
Given the following "core_reportbuilder > Report" exists:
| name | My report |
| source | core_user\reportbuilder\datasource\users |
| default | 0 |
And the following "core_reportbuilder > Column" exists:
| report | My report |
| uniqueidentifier | user:fullname |
And I am on the "My report" "reportbuilder > Editor" page logged in as "admin"
When I set the field "Rename column 'Full name'" to "My renamed column"
And I reload the page
Expand Down
12 changes: 6 additions & 6 deletions reportbuilder/tests/behat/filtereditor.feature
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,12 @@ Feature: Manage custom report filters
| report | uniqueidentifier |
| My report | user:fullname |
| My report | user:email |
And the following "core_reportbuilder > Conditions" exist:
| report | uniqueidentifier |
| My report | user:email |
And the following "core_reportbuilder > Filters" exist:
| report | uniqueidentifier |
| My report | user:email |
And the following "core_reportbuilder > Condition" exists:
| report | My report |
| uniqueidentifier | user:email |
And the following "core_reportbuilder > Filter" exists:
| report | My report |
| uniqueidentifier | user:email |
And I am on the "My report" "reportbuilder > Editor" page logged in as "admin"
And I change window size to "large"
And I should see "user1@example.com" in the ".reportbuilder-table" "css_element"
Expand Down
20 changes: 11 additions & 9 deletions reportbuilder/tests/behat/schedules.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ Feature: Manage custom report schedules
| user1 | User | One |
| user2 | User | Two |
| user3 | User | Three |
And the following "core_reportbuilder > Reports" exist:
| name | source | default |
| My report | core_user\reportbuilder\datasource\users | 1 |
And the following "core_reportbuilder > Audiences" exist:
| report | classname | configdata |
| My report | core_reportbuilder\reportbuilder\audience\allusers | |
And the following "core_reportbuilder > Report" exists:
| name | My report |
| source | core_user\reportbuilder\datasource\users |
| default | 1 |
And the following "core_reportbuilder > Audience" exists:
| report | My report |
| classname | core_reportbuilder\reportbuilder\audience\allusers |
| configdata | |

Scenario: Create report schedule
Given I am on the "My report" "reportbuilder > Editor" page logged in as "admin"
Expand Down Expand Up @@ -43,9 +45,9 @@ Feature: Manage custom report schedules
| My schedule | ##tomorrow 11:00##%A, %d %B %Y, %H:%M## | Never | Admin User |

Scenario: Rename report schedule
Given the following "core_reportbuilder > Schedules" exist:
| report | name |
| My report | My schedule |
Given the following "core_reportbuilder > Schedule" exists:
| report | My report |
| name | My schedule |
And I am on the "My report" "reportbuilder > Editor" page logged in as "admin"
And I click on the "Schedules" dynamic tab
When I set the field "Edit schedule name" in the "My schedule" "table_row" to "My renamed schedule"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@ class behat_core_reportbuilder_generator extends behat_generator_base {
protected function get_creatable_entities(): array {
return [
'Reports' => [
'singular' => 'Report',
'datagenerator' => 'report',
'required' => [
'name',
'source',
],
],
'Columns' => [
'singular' => 'Column',
'datagenerator' => 'column',
'required' => [
'report',
Expand All @@ -52,6 +54,7 @@ protected function get_creatable_entities(): array {
],
],
'Conditions' => [
'singular' => 'Condition',
'datagenerator' => 'condition',
'required' => [
'report',
Expand All @@ -62,6 +65,7 @@ protected function get_creatable_entities(): array {
],
],
'Filters' => [
'singular' => 'Filter',
'datagenerator' => 'filter',
'required' => [
'report',
Expand All @@ -72,6 +76,7 @@ protected function get_creatable_entities(): array {
],
],
'Audiences' => [
'singular' => 'Audience',
'datagenerator' => 'audience',
'required' => [
'report',
Expand All @@ -82,6 +87,7 @@ protected function get_creatable_entities(): array {
],
],
'Schedules' => [
'singular' => 'Schedule',
'datagenerator' => 'schedule',
'required' => [
'report',
Expand Down

0 comments on commit 68ae89c

Please sign in to comment.