diff --git a/course/tests/behat/frontpage_topic_section.feature b/course/tests/behat/frontpage_topic_section.feature index 646bb1d1c8f..1f1fa00c3f1 100644 --- a/course/tests/behat/frontpage_topic_section.feature +++ b/course/tests/behat/frontpage_topic_section.feature @@ -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: Admin 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: Admin 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: Admin 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: Admin 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