Skip to content

Commit

Permalink
MDL-82349 course: add frontpage behats
Browse files Browse the repository at this point in the history
  • Loading branch information
ferranrecio committed Oct 8, 2024
1 parent d2a158d commit 46a2912
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions course/tests/behat/frontpage_topic_section.feature
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,75 @@ Feature: Site home activities section
And I should see "New section description" in the "region-main" "region"
Then I turn editing mode off
And I should see "New section description" in the "region-main" "region"

@javascript
Scenario: Teacher can change the activity visibility in the frontpage
Given the following config values are set as admin:
| allowstealth | 1 |
And the following "activities" exist:
| activity | course | section | name | intro | idnumber |
| assign | Acceptance test site | 1 | Frontpage assignment | Assignment description | assign0 |
When I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I should see "Frontpage assignment" in the "region-main" "region"
Then I open "Frontpage assignment" actions menu
And I choose "Availability > Make available but don't show on course page" in the open action menu
And I should see "Available but not shown on course page" in the "Frontpage assignment" "core_courseformat > Activity visibility"
And I open "Frontpage assignment" actions menu
And I choose "Availability > Show on course page" in the open action menu
And I should not see "Available but not shown on course page" in the "Frontpage assignment" "activity"
And I should not see "Hidden from students" in the "Frontpage assignment" "activity"
And I open "Frontpage assignment" actions menu
And I choose "Availability > Hide on course page" in the open action menu
And I should not see "Available but not shown on course page" in the "Frontpage assignment" "activity"
And I should see "Hidden from students" in the "Frontpage assignment" "core_courseformat > Activity visibility"

@javascript
Scenario: Teacher can delete an activity in the frontpage
Given the following "activities" exist:
| activity | course | section | name | intro | idnumber |
| assign | Acceptance test site | 1 | Frontpage assignment | Assignment description | assign0 |
When I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I should see "Frontpage assignment" in the "region-main" "region"
Then I open "Frontpage assignment" actions menu
And I choose "Delete" in the open action menu
And I click on "Delete" "button" in the "Delete activity?" "dialogue"
And I should not see "Frontpage assignment" in the "region-main" "region"

@javascript
Scenario: Teacher can duplicate an activity in the frontpage
Given the following "activities" exist:
| activity | course | section | name | intro | idnumber |
| assign | Acceptance test site | 1 | Frontpage assignment | Assignment description | assign0 |
When I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I should see "Frontpage assignment" in the "region-main" "region"
Then I open "Frontpage assignment" actions menu
And I choose "Duplicate" in the open action menu
And I should see "Frontpage assignment (copy)" in the "region-main" "region"

@javascript
Scenario: Teacher can move an activity lefts and right in the frontpage
Given the following "activities" exist:
| activity | course | section | name | intro | idnumber |
| assign | Acceptance test site | 1 | Frontpage assignment | Assignment description | assign0 |
| assign | Acceptance test site | 1 | Frontpage assignment | Assignment description | assign1 |
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I should see "Frontpage assignment" in the "region-main" "region"
When I open "Frontpage assignment" actions menu
And "Move right" "link" should be visible
And "Move left" "link" should not be visible
And I choose "Move right" in the open action menu
Then I open "Frontpage assignment" actions menu
And "Move right" "link" should not be visible
And "Move left" "link" should be visible
And I choose "Move left" in the open action menu
And I open "Frontpage assignment" actions menu
And "Move right" "link" should be visible
And "Move left" "link" should not be visible

0 comments on commit 46a2912

Please sign in to comment.