From 5a2f76afa89ced45a18202d090ac7837309b9a12 Mon Sep 17 00:00:00 2001 From: Angelia Dela Cruz Date: Tue, 29 Aug 2023 17:31:45 +0800 Subject: [PATCH] MDL-79195 core_course: Activity and resource description display behat --- ...ivity_resource_description_display.feature | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 course/tests/behat/activity_resource_description_display.feature diff --git a/course/tests/behat/activity_resource_description_display.feature b/course/tests/behat/activity_resource_description_display.feature new file mode 100644 index 0000000000000..8a1ac00e34baf --- /dev/null +++ b/course/tests/behat/activity_resource_description_display.feature @@ -0,0 +1,71 @@ +@core @core_course +Feature: Display activity and resource description + In order to display activity and resource description + As teacher + I should be able to enable "Display description on course page" + + Background: + Given the following "users" exist: + | username | firstname | lastname | email | + | teacher1 | Teacher | 1 | teacher1@example.com | + And the following "courses" exist: + | fullname | shortname | + | Course 1 | C1 | + And the following "course enrolments" exist: + | user | course | role | + | teacher1 | C1 | editingteacher | + + Scenario Outline: Display activity and resource descriptions + # Generate activity/resource with description + Given the following "activities" exist: + | activity | course | name | intro | showdescription | + | | C1 | | intro | 1 | + When I am on the "Course 1" course page logged in as teacher1 + # Confirm that activity name and description are displayed + Then I should see "" in the "region-main" "region" + And I should see " intro" in the "region-main" "region" + + Examples: + | acttype | actname | + | assign | Assign 1 | + | book | Book 1 | + | chat | Chat 1 | + | data | Database 1 | + | feedback | Feedback 1 | + | forum | Forum 1 | + | label | Label 1 | + | lti | LTI 1 | + | page | Page 1 | + | quiz | Quiz 1 | + | resource | Resource 1 | + | imscp | IMSCP 1 | + | folder | Folder 1 | + | glossary | Glossary 1 | + | scorm | Scorm 1 | + | lesson | Lesson 1 | + | survey | Survey 1 | + | url | URL 1 | + | wiki | Wiki 1 | + | workshop | Workshop 1 | + + Scenario: Display url activity description with pop-up display + # Generate url activity with description and popup appearance + Given the following "activities" exist: + | activity | course | name | intro | showdescription | display | popupwidth | popupheight | + | url | C1 | URL 1 | URL 1 intro | 1 | 6 | 620 | 450 | + When I am on the "Course 1" course page logged in as teacher1 + # Confirm that activity name and description are displayed + Then I should see "URL 1" in the "region-main" "region" + And I should see "URL 1 intro" in the "region-main" "region" + + Scenario: Display activity with image description + # Generate page activity with image embedded in description + Given the following "activities" exist: + | activity | course | name | intro | showdescription | + | page | C1 | Page 1 | Page 1 intro with image: | 1 | + When I am on the "Course 1" course page logged in as teacher1 + # Confirm that activity name and description are displayed + Then I should see "Page 1" in the "region-main" "region" + And I should see "Page 1 intro with image:" in the "region-main" "region" + # Confirm that image element exists + And "//img[contains(@src, 'http://download.moodle.org/unittest/test.jpg')]" "xpath_element" should exist in the "region-main" "region"