Skip to content

Commit

Permalink
MDL-79195 core_course: Activity and resource description display behat
Browse files Browse the repository at this point in the history
  • Loading branch information
andelacruz committed Sep 12, 2023
1 parent 8a0e29e commit 5a2f76a
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions 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 |
| <acttype> | C1 | <actname> | <actname> 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 "<actname>" in the "region-main" "region"
And I should see "<actname> 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: <img src="http://download.moodle.org/unittest/test.jpg"> | 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"

0 comments on commit 5a2f76a

Please sign in to comment.