AutorÃa | Ultima modificación | Ver Log |
@block @block_dashFeature: Enable the widget in dash block on the dashboard page and view it's contentsIn order to enable the widgets in dash block on the dashboardAs an adminI can add the dash block to the dashboardBackground:Given the following "categories" exist:| name | category | idnumber || Category 1 | 0 | CAT1 || Category 2 | 0 | CAT2 || Category 3 | CAT2 | CAT3 |And the following "courses" exist:| fullname | shortname | category | enablecompletion || Course 1 | C1 | 0 | 1 || Course 2 | C2 | CAT1 | 0 || Course 3 | C3 | CAT2 | 1 || Course 4 | C4 | CAT3 | 1 |And the following "users" exist:| username | firstname | lastname | email || student1 | Student | First | student1@example.com || teacher1 | Teacher | First | teacher1@example.com || student2 | Student | Two | student2@example.com |And the following "activities" exist:| activity | course | idnumber | section | name | intro | completion | completionview || page | C1 | page1 | 0 | Test page name | Test page description | 2 | 1 || page | C1 | page2 | 1 | Test page name 2 | Test page description | 2 | 1 |And the following "course enrolments" exist:| user | course | role || student1 | C1 | student || teacher1 | C1 | teacher || student1 | C2 | student || student1 | C3 | student |And I log in as "admin"And I navigate to "Appearance > Default Dashboard page" in site administrationAnd I turn dash block editing mode onAnd I add the "Dash" blockAnd I click on "My learning" "radio"And I configure the "New Dash" blockAnd I set the following fields to these values:| Block title | My Learning || Region | content || Content | My learaning empty state content |And I press "Save changes"And I click on "Reset Dashboard for all users" "button"And I log out@javascriptScenario: Add the dash mylearning widget block on the dashboardGiven I log in as "student1"Then I should see "Course 1" in the "My Learning" "block"And I should see "Course 2" in the "My Learning" "block"And I should see "Course 3" in the "My Learning" "block"And I should not see "Course 4" in the "My Learning" "block"@javascriptScenario: Course completion status in mylearning widgetGiven I log in as "admin"And I am on "Course 1" course homepage with editing mode onAnd I navigate to "Course completion" in current page administrationAnd I expand all fieldsetsAnd I set the following fields to these values:| Test page name | 1 || Test page name 2 | 1 |And I press "Save changes"And I log outWhen I log in as "student1"Then I should see "Course 1" in the "My Learning" "block"And I should see "0" in the ".card-header:nth-child(1)" "css_element"And I click on "General" "button" in the "My Learning" "block"Then I click on "Test page name" "link"And I follow dashboardThen the "class" attribute of ".block_dash-info-element .card:nth-child(1)" "css_element" should contain "completed-bg"And ".fa.fa-check" "css_element" should exist in the ".block_dash-info-element .card:nth-child(1)" "css_element"@javascript @_file_uploadScenario: Course badges list in Mylearning widgetGiven I log in as "admin"And I am on "Course 1" course homepageAnd I navigate to "Badges > Add a new badge" in current page administrationAnd I set the following fields to these values:| id_name | Badge 1 || id_description | Badge 1 |And I upload "blocks/badges/tests/fixtures/badge.png" file to "Image" filemanagerAnd I press "Create badge"And I select "Manual issue by role" from the "Add badge criteria" singleselectAnd I set the field "Teacher" to "1"And I press "Save"And I press "Enable access"And I press "Continue"And I follow badge recipientsAnd I press "Award badge"And I set the field "potentialrecipients[]" to "Student First (student1@example.com)"And I press "Award badge"And I log outWhen I log in as "student1"Then ".collected .activatebadge[alt=\"Badge 1\"]" "css_element" should exist in the "My Learning" "block"@javascriptScenario: Check the empty state option.Given I log in as "student2"Then I should see "My learaning empty state content" in the "My Learning" "block"And I log outWhen I log in as "student1"Then I should not see "My learaning empty state content" in the "My Learning" "block"And I log out