Skip to content

Commit

Permalink
mod_pcast: Behat fixes for Moodle 4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Bourget committed Oct 3, 2024
1 parent 658915b commit a56d7f2
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 20 deletions.
8 changes: 4 additions & 4 deletions lang/en/pcast.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@
$string['createdesc'] = 'Oldest episode first';
$string['current'] = 'current sort {$a}';
$string['dateview'] = 'Browse by date';
$string['deleteallepisodetags'] = 'Delete episode tags';
$string['deleteallviews'] = 'Delete episode view history';
$string['deletenotenrolled'] = 'Delete episodes by users not enrolled';
$string['deleteallepisodetags'] = 'Episode tags';
$string['deleteallviews'] = 'Episode view history';
$string['deletenotenrolled'] = 'Episodes by users not enrolled';
$string['deletethisepisode'] = 'Delete this episode';
$string['descending'] = 'Descending';
$string['disapprove'] = 'Disapprove';
Expand Down Expand Up @@ -189,7 +189,7 @@
$string['podcastepisodes'] = 'Podcast episodes';
$string['requireapproval_help'] = 'Require episodes to be approved before posting';
$string['requireapproval'] = 'Require approval for episodes';
$string['resetpcastsall'] = 'Delete episodes from all podcasts';
$string['resetpcastsall'] = 'All episodes from all podcasts';
$string['rssepisodes_help'] = 'This option limits the number of episodes displayed on the RSS feed';
$string['rssepisodes'] = 'Number of episodes';
$string['rsslink'] = 'RSS feed for this activity';
Expand Down
4 changes: 2 additions & 2 deletions tests/behat/pcast_activity_completion.feature
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Feature: Teachers can use activity completion to track student progress

@javascript
Scenario: Automatic completion view
Given I add a "Podcast" to section "1" and I fill the form with:
Given I add a pcast activity to course "Course 1" section "1" and I fill the form with:
| Podcast name | Test podcast name |
| ID number | Test podcast name |
| Description | Test podcast description |
Expand All @@ -46,7 +46,7 @@ Feature: Teachers can use activity completion to track student progress

@javascript
Scenario: Automatic completion upload 1 episodes
Given I add a "Podcast" to section "1" and I fill the form with:
Given I add a pcast activity to course "Course 1" section "1" and I fill the form with:
| Podcast name | Test podcast name |
| ID number | Test podcast name |
| Description | Test podcast description |
Expand Down
40 changes: 26 additions & 14 deletions tests/behat/pcast_reset.feature
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@ Feature: Pcast reset

And I log in as "teacher1"
When I am on the "Course 1" "reset" page
And I press "Deselect all"
And I set the following fields to these values:
| id_reset_pcast_comments | 1 |
And I press "Reset course"
And I click on "Reset course" "button" in the "Reset course?" "dialogue"
And I should see "Delete all comments"
Then I should see "OK"
Then I should see "Done"
And I press "Continue"
And I am on the "Test podcast name" Activity page
And I should see "Test episode name"
Expand All @@ -65,11 +67,13 @@ Feature: Pcast reset
And I upload "mod/pcast/tests/fixtures/sample.mp3" file to "Media file" filemanager
And I press "Save changes"
When I am on the "Course 1" "reset" page
And I press "Deselect all"
And I set the following fields to these values:
| Delete episodes from all podcasts | 1 |
| All episodes from all podcasts | 1 |
And I press "Reset course"
And I should see "Delete episodes from all podcasts"
Then I should see "OK"
And I click on "Reset course" "button" in the "Reset course?" "dialogue"
And I should see "All episodes from all podcasts"
Then I should see "Done"
And I press "Continue"
And I am on the "Test podcast name" Activity page
And I should not see "Test episode name"
Expand All @@ -92,11 +96,13 @@ Feature: Pcast reset
And I upload "mod/pcast/tests/fixtures/sample.mp3" file to "Media file" filemanager
And I press "Save changes"
When I am on the "Course 1" "reset" page
And I press "Deselect all"
And I set the following fields to these values:
| Delete episodes by users not enrolled | 1 |
| Episodes by users not enrolled | 1 |
And I press "Reset course"
And I should see "Delete episodes by users not enrolled"
Then I should see "OK"
And I click on "Reset course" "button" in the "Reset course?" "dialogue"
And I should see "Episodes by users not enrolled"
Then I should see "Done"
And I press "Continue"
And I am on the "Test podcast name" Activity page
And I should see "Test episode name"
Expand All @@ -121,12 +127,14 @@ Feature: Pcast reset
And I follow "View"
And I should see "2" in the "Total views" "table_row"
When I am on the "Course 1" "reset" page
And I press "Deselect all"
And I expand all fieldsets
And I set the following fields to these values:
| Delete episode view history | 1 |
| Episode view history | 1 |
And I press "Reset course"
And I should see "Delete episode view history"
Then I should see "OK"
And I click on "Reset course" "button" in the "Reset course?" "dialogue"
And I should see "Episode view history"
Then I should see "Done"
And I press "Continue"
And I am on the "Test podcast name" Activity page
And I should see "Test episode name"
Expand Down Expand Up @@ -163,12 +171,14 @@ Feature: Pcast reset
And I select "View Episode" from the "Browse the podcast using this index" singleselect
And I should see "1" in the "Total ratings" "table_row"
When I am on the "Course 1" "reset" page
And I press "Deselect all"
And I expand all fieldsets
And I set the following fields to these values:
| id_reset_pcast_ratings | 1 |
And I press "Reset course"
And I should see "Delete all ratings"
Then I should see "OK"
And I click on "Reset course" "button" in the "Reset course?" "dialogue"
And I should see "All ratings"
Then I should see "Done"
And I press "Continue"
And I am on the "Test podcast name" Activity page
And I should see "Test episode name"
Expand All @@ -188,12 +198,14 @@ Feature: Pcast reset
Then I should see "Test episode name"
And I should see "Example" in the ".pcast-tags" "css_element"
When I am on the "Course 1" "reset" page
And I press "Deselect all"
And I expand all fieldsets
And I set the following fields to these values:
| id_reset_pcast_tags | 1 |
And I press "Reset course"
And I should see "Delete episode tags"
Then I should see "OK"
And I click on "Reset course" "button" in the "Reset course?" "dialogue"
And I should see "Episode tags"
Then I should see "Done"
And I press "Continue"
And I am on the "Test podcast name" Activity page
And I should see "Test episode name"
Expand Down

0 comments on commit a56d7f2

Please sign in to comment.