MDL-63457 block_myoverview: Functionality and test updates

* Add identifiers for each card in the view
* Update js to hide instead of reload block
* Behat test updates
This commit is contained in:
Peter 2018-10-24 10:23:47 +08:00
parent e6f03948d7
commit c896546ce7
8 changed files with 53 additions and 38 deletions

View File

@ -1 +1 @@
define(["jquery","block_myoverview/repository","core/paged_content_factory","core/custom_interaction_events","core/notification","core/ajax","core/templates"],function(a,b,c,d,e,f,g){var h={COURSE_REGION:'[data-region="course-view-content"]',ACTION_HIDE_COURSE:'[data-action="hide-course"]',ACTION_SHOW_COURSE:'[data-action="show-course"]',ACTION_ADD_FAVOURITE:'[data-action="add-favourite"]',ACTION_REMOVE_FAVOURITE:'[data-action="remove-favourite"]',FAVOURITE_ICON:'[data-region="favourite-icon"]',ICON_IS_FAVOURITE:'[data-region="is-favourite"]',ICON_NOT_FAVOURITE:'[data-region="not-favourite"]',PAGED_CONTENT_CONTAINER:'[data-region="page-container"]'},i={COURSES_CARDS:"block_myoverview/view-cards",COURSES_LIST:"block_myoverview/view-list",COURSES_SUMMARY:"block_myoverview/view-summary",NOCOURSES:"block_myoverview/no-courses"},j=[12,24,48],k=[],l=function(a){var b={};return b.display=a.attr("data-display"),b.grouping=a.attr("data-grouping"),b.sort=a.attr("data-sort"),b},m={ignoreControlWhileLoading:!0,controlPlacementBottom:!0},n=function(a,c,d){return b.getEnrolledCoursesByTimeline({offset:d*c,limit:c,classification:a.grouping,sort:a.sort})},o=function(a,b){return a.find(h.FAVOURITE_ICON+'[data-course-id="'+b+'"]')},p=function(a,b){return a.find('[data-region="paged-content-page"][data-page="'+b+'"]')},q=function(a){return a.attr("data-course-id")},r=function(a,b){var c=o(a,b),d=c.find(h.ICON_IS_FAVOURITE);d.addClass("hidden"),d.attr("aria-hidden",!0);var e=c.find(h.ICON_NOT_FAVOURITE);e.removeClass("hidden"),e.attr("aria-hidden",!1)},s=function(a,b){var c=o(a,b),d=c.find(h.ICON_IS_FAVOURITE);d.removeClass("hidden"),d.attr("aria-hidden",!1);var e=c.find(h.ICON_NOT_FAVOURITE);e.addClass("hidden"),e.attr("aria-hidden",!0)},t=function(a,b){return a.find('[data-action="add-favourite"][data-course-id="'+b+'"]')},u=function(a,b){return a.find('[data-action="remove-favourite"][data-course-id="'+b+'"]')},v=function(a,b){var c=u(a,b),d=t(a,b);x(b,!0).then(function(f){f?(c.removeClass("hidden"),d.addClass("hidden"),s(a,b)):e.alert("Starring course failed","Could not change favourite state")})["catch"](e.exception)},w=function(a,b){var c=u(a,b),d=t(a,b);x(b,!1).then(function(f){f?(c.addClass("hidden"),d.removeClass("hidden"),r(a,b)):e.alert("Starring course failed","Could not change favourite state")})["catch"](e.exception)},x=function(a,c){return b.setFavouriteCourses({courses:[{id:a,favourite:c}]}).then(function(b){return 0==b.warnings.length&&(k.forEach(function(b){b.courses.forEach(function(d,e){d.id==a&&(b.courses[e].isfavourite=c)})}),!0)})["catch"](e.exception)},y=function(a,b){var c=l(a),d="";if(d="cards"==c.display?i.COURSES_CARDS:"list"==c.display?i.COURSES_LIST:i.COURSES_SUMMARY,b.courses.length)return g.render(d,{courses:b.courses});var e=a.attr("data-nocoursesimg");return g.render(i.NOCOURSES,{nocoursesimg:e})},z=function(a,b){var d=l(a),f=c.createWithLimit(j,function(b,c){var f=[];return b.forEach(function(b){var g=b.pageNumber,h=b.pageNumber-1,i=n(d,b.limit,h).then(function(d){return d.courses.length<b.limit&&c.allItemsLoaded(b.pageNumber),k[g]=d,y(a,d)})["catch"](e.exception);f.push(i)}),f},m);f.then(function(a,c){return g.replaceNodeContents(b,a,c)})["catch"](e.exception)},A=function(c,e){d.define(c,[d.events.activate]),c.on(d.events.activate,h.ACTION_ADD_FAVOURITE,function(b,d){var e=a(b.target).closest(h.ACTION_ADD_FAVOURITE),f=q(e);v(c,f),d.originalEvent.preventDefault()}),c.on(d.events.activate,h.ACTION_REMOVE_FAVOURITE,function(b,d){var e=a(b.target).closest(h.ACTION_REMOVE_FAVOURITE),f=q(e);w(c,f),d.originalEvent.preventDefault()}),c.on(d.events.activate,h.FAVOURITE_ICON,function(a,b){b.originalEvent.preventDefault()}),c.on(d.events.activate,h.ACTION_HIDE_COURSE,function(d,f){var g=a(d.target).closest(h.ACTION_HIDE_COURSE),i=q(g),j={preferences:[{type:"block_myoverview_hidden_course_"+i,value:!0}]};b.updateUserPreferences(j),z(c,e),f.originalEvent.preventDefault()}),c.on(d.events.activate,h.ACTION_SHOW_COURSE,function(d,f){var g=a(d.target).closest(h.ACTION_SHOW_COURSE),i=q(g),j={preferences:[{type:"block_myoverview_hidden_course_"+i,value:null}]};b.updateUserPreferences(j),z(c,e),f.originalEvent.preventDefault()})},B=function(b,c){b=a(b),b.attr("data-init")||(A(b,c),b.attr("data-init",!0)),z(b,c)},C=function(a,b){k.length>0?k.forEach(function(b,c){var d=p(a,c);y(a,b).then(function(a,b){return g.replaceNodeContents(d,a,b)})["catch"](e.exception)}):B(a,b)};return{init:B,reset:C}});
define(["jquery","block_myoverview/repository","core/paged_content_factory","core/custom_interaction_events","core/notification","core/templates"],function(a,b,c,d,e,f){var g={COURSE_REGION:'[data-region="course-view-content"]',ACTION_HIDE_COURSE:'[data-action="hide-course"]',ACTION_SHOW_COURSE:'[data-action="show-course"]',ACTION_ADD_FAVOURITE:'[data-action="add-favourite"]',ACTION_REMOVE_FAVOURITE:'[data-action="remove-favourite"]',FAVOURITE_ICON:'[data-region="favourite-icon"]',ICON_IS_FAVOURITE:'[data-region="is-favourite"]',ICON_NOT_FAVOURITE:'[data-region="not-favourite"]',PAGED_CONTENT_CONTAINER:'[data-region="page-container"]'},h={COURSES_CARDS:"block_myoverview/view-cards",COURSES_LIST:"block_myoverview/view-list",COURSES_SUMMARY:"block_myoverview/view-summary",NOCOURSES:"block_myoverview/no-courses"},i=[12,24,48],j=[],k=function(a){var b={};return b.display=a.attr("data-display"),b.grouping=a.attr("data-grouping"),b.sort=a.attr("data-sort"),b},l={ignoreControlWhileLoading:!0,controlPlacementBottom:!0},m=function(a,c,d){return b.getEnrolledCoursesByTimeline({offset:d*c,limit:c,classification:a.grouping,sort:a.sort})},n=function(a,b){return a.find(g.FAVOURITE_ICON+'[data-course-id="'+b+'"]')},o=function(a,b){return a.find('[data-region="paged-content-page"][data-page="'+b+'"]')},p=function(a){return a.attr("data-course-id")},q=function(a,b){var c=n(a,b),d=c.find(g.ICON_IS_FAVOURITE);d.addClass("hidden"),d.attr("aria-hidden",!0);var e=c.find(g.ICON_NOT_FAVOURITE);e.removeClass("hidden"),e.attr("aria-hidden",!1)},r=function(a,b){var c=n(a,b),d=c.find(g.ICON_IS_FAVOURITE);d.removeClass("hidden"),d.attr("aria-hidden",!1);var e=c.find(g.ICON_NOT_FAVOURITE);e.addClass("hidden"),e.attr("aria-hidden",!0)},s=function(a,b){return a.find('[data-action="add-favourite"][data-course-id="'+b+'"]')},t=function(a,b){return a.find('[data-action="remove-favourite"][data-course-id="'+b+'"]')},u=function(a,b){var c=t(a,b),d=s(a,b);x(b,!0).then(function(f){f?(c.removeClass("hidden"),d.addClass("hidden"),r(a,b)):e.alert("Starring course failed","Could not change favourite state")})["catch"](e.exception)},v=function(a,b){var c=t(a,b),d=s(a,b);x(b,!1).then(function(f){f?(c.addClass("hidden"),d.removeClass("hidden"),q(a,b)):e.alert("Starring course failed","Could not change favourite state")})["catch"](e.exception)},w=function(a,b,c){var d=a.find('[data-course-id="'+b+'"][data-region="course-content"]');j.forEach(function(a){a.courses.forEach(function(e,f){e.id==b&&(a.courses[f].hidden=c,d.css("display","none"))})})},x=function(a,c){return b.setFavouriteCourses({courses:[{id:a,favourite:c}]}).then(function(b){return 0==b.warnings.length&&(j.forEach(function(b){b.courses.forEach(function(d,e){d.id==a&&(b.courses[e].isfavourite=c)})}),!0)})["catch"](e.exception)},y=function(a,b){var c=k(a),d="";if(d="cards"==c.display?h.COURSES_CARDS:"list"==c.display?h.COURSES_LIST:h.COURSES_SUMMARY,b.courses.length)return f.render(d,{courses:b.courses});var e=a.attr("data-nocoursesimg");return f.render(h.NOCOURSES,{nocoursesimg:e})},z=function(a,b){var d=k(a),g=c.createWithLimit(i,function(b,c){var f=[];return b.forEach(function(b){var g=b.pageNumber,h=b.pageNumber-1,i=m(d,b.limit,h).then(function(d){return d.courses.length<b.limit&&c.allItemsLoaded(b.pageNumber),j[g]=d,y(a,d)})["catch"](e.exception);f.push(i)}),f},l);g.then(function(a,c){return f.replaceNodeContents(b,a,c)})["catch"](e.exception)},A=function(c){d.define(c,[d.events.activate]),c.on(d.events.activate,g.ACTION_ADD_FAVOURITE,function(b,d){var e=a(b.target).closest(g.ACTION_ADD_FAVOURITE),f=p(e);u(c,f),d.originalEvent.preventDefault()}),c.on(d.events.activate,g.ACTION_REMOVE_FAVOURITE,function(b,d){var e=a(b.target).closest(g.ACTION_REMOVE_FAVOURITE),f=p(e);v(c,f),d.originalEvent.preventDefault()}),c.on(d.events.activate,g.FAVOURITE_ICON,function(a,b){b.originalEvent.preventDefault()}),c.on(d.events.activate,g.ACTION_HIDE_COURSE,function(d,e){var f=a(d.target).closest(g.ACTION_HIDE_COURSE),h=p(f),i={preferences:[{type:"block_myoverview_hidden_course_"+h,value:!0}]};b.updateUserPreferences(i),w(c,h,!0),e.originalEvent.preventDefault()}),c.on(d.events.activate,g.ACTION_SHOW_COURSE,function(d,e){var f=a(d.target).closest(g.ACTION_SHOW_COURSE),h=p(f),i={preferences:[{type:"block_myoverview_hidden_course_"+h,value:null}]};b.updateUserPreferences(i),w(c,h,!1),e.originalEvent.preventDefault()})},B=function(b,c){b=a(b),b.attr("data-init")||(A(b,c),b.attr("data-init",!0)),z(b,c)},C=function(a,b){j.length>0?j.forEach(function(b,c){var d=o(a,c);y(a,b).then(function(a,b){return f.replaceNodeContents(d,a,b)})["catch"](e.exception)}):B(a,b)};return{init:B,reset:C}});

View File

@ -28,7 +28,6 @@ define(
'core/paged_content_factory',
'core/custom_interaction_events',
'core/notification',
'core/ajax',
'core/templates',
],
function(
@ -37,7 +36,6 @@ function(
PagedContentFactory,
CustomEvents,
Notification,
Ajax,
Templates
) {
@ -234,6 +232,19 @@ function(
}).catch(Notification.exception);
};
var toggleHiddenFromCard = function(root, courseId, status) {
var element = root.find('[data-course-id="' + courseId + '"][data-region="course-content"]');
loadedPages.forEach(function(courseList) {
courseList.courses.forEach(function(course, index) {
if (course.id == courseId) {
courseList.courses[index].hidden = status;
element.css('display', 'none');
}
});
});
};
/**
* Set the courses favourite status and push to repository
*
@ -347,7 +358,7 @@ function(
*
* @param {Object} root The myoverview block container element.
*/
var registerEventListeners = function(root, content) {
var registerEventListeners = function(root) {
CustomEvents.define(root, [
CustomEvents.events.activate
]);
@ -384,8 +395,7 @@ function(
};
Repository.updateUserPreferences(request);
// Reload the paged content based on the hidden course
initializePagedContent(root, content);
toggleHiddenFromCard(root, id, true);
data.originalEvent.preventDefault();
});
@ -404,8 +414,7 @@ function(
Repository.updateUserPreferences(request);
// Reload the paged content based on the hidden course
initializePagedContent(root, content);
toggleHiddenFromCard(root, id, false);
data.originalEvent.preventDefault();
});
};

View File

@ -36,7 +36,9 @@
<div class="card-deck dashboard-card-deck" role="list">
{{#courses}}
<div class="card dashboard-card" role="listitem">
<div class="card dashboard-card" role="listitem"
data-region="course-content"
data-course-id="{{{id}}}">
<a href="{{viewurl}}" tabindex="-1">
<div class="card-img dashboard-card-img" style='background-image: url("{{{courseimage}}}");'>
<span class="sr-only">{{#str}}aria:courseimage, block_myoverview{{/str}}</span>

View File

@ -36,7 +36,9 @@
<ul class="list-group">
{{#courses}}
<li class="list-group-item course-listitem">
<li class="list-group-item course-listitem"
data-region="course-content"
data-course-id="{{{id}}}">
<div class="row-fluid">
<div class="{{#hasprogress}}col-6 span6{{/hasprogress}}{{^hasprogress}}col-11 span11{{/hasprogress}} p-l-0">
<div class="d-flex align-items-center">

View File

@ -36,7 +36,9 @@
}}
<div role="list">
{{#courses}}
<div class="course-summaryitem m-b-1 p-2" role="listitem">
<div class="course-summaryitem m-b-1 p-2" role="listitem"
data-region="course-content"
data-course-id="{{{id}}}">
<div class="row-fluid d-flex">
<a href="{{viewurl}}" class="col-sm-4 col-xl-3 span4 position-relative" tabindex="-1">
<div class="position-absolute">

View File

@ -163,8 +163,8 @@ Feature: The my overview block allows users to easily access their courses
Given I log in as "student1"
And I click on "All" "button" in the "Course overview" "block"
When I click on "In progress" "link" in the "Course overview" "block"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card course-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Hide from view" "link" in the "//div[@class='card course-card' and contains(.,'Course 2')]" "xpath_element"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Hide from view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I reload the page
Then I should see "Course 3" in the "Course overview" "block"
Then I should see "Course 4" in the "Course overview" "block"
@ -177,8 +177,8 @@ Feature: The my overview block allows users to easily access their courses
Given I log in as "student1"
And I click on "All" "button" in the "Course overview" "block"
When I click on "Past" "link" in the "Course overview" "block"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card course-card' and contains(.,'Course 1')]" "xpath_element"
And I click on "Hide from view" "link" in the "//div[@class='card course-card' and contains(.,'Course 1')]" "xpath_element"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 1')]" "xpath_element"
And I click on "Hide from view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 1')]" "xpath_element"
And I reload the page
Then I should not see "Course 1" in the "Course overview" "block"
And I should not see "Course 2" in the "Course overview" "block"
@ -191,8 +191,8 @@ Feature: The my overview block allows users to easily access their courses
Given I log in as "student1"
And I click on "All" "button" in the "Course overview" "block"
When I click on "Future" "link" in the "Course overview" "block"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card course-card' and contains(.,'Course 5')]" "xpath_element"
And I click on "Hide from view" "link" in the "//div[@class='card course-card' and contains(.,'Course 5')]" "xpath_element"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 5')]" "xpath_element"
And I click on "Hide from view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 5')]" "xpath_element"
And I reload the page
Then I should not see "Course 5" in the "Course overview" "block"
And I should not see "Course 1" in the "Course overview" "block"

View File

@ -28,11 +28,11 @@ Feature: The my overview block allows users to favourite their courses
When I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Star this course" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I reload the page
Then "//div[@role='listitem' and contains(.,'Course 2')]//span[@data-region='is-favourite' and @aria-hidden='false']" "xpath_element" should exist
And "//div[@role='listitem' and contains(.,'Course 2')]//span[@data-region='is-favourite' and @aria-hidden='true']" "xpath_element" should not exist
And "//div[@role='listitem' and contains(.,'Course 2')]//span[@data-region='not-favourite' and @aria-hidden='true']" "xpath_element" should exist
And "//div[@role='listitem' and contains(.,'Course 1')]//span[@data-region='is-favourite' and @aria-hidden='true']" "xpath_element" should exist
And "//div[@role='listitem' and contains(.,'Course 3')]//span[@data-region='is-favourite' and @aria-hidden='true']" "xpath_element" should exist
Then "//div[@class='card dashboard-card' and contains(.,'Course 2')]//span[@data-region='is-favourite' and @aria-hidden='false']" "xpath_element" should exist
And "//div[@class='card dashboard-card' and contains(.,'Course 2')]//span[@data-region='is-favourite' and @aria-hidden='true']" "xpath_element" should not exist
And "//div[@class='card dashboard-card' and contains(.,'Course 2')]//span[@data-region='not-favourite' and @aria-hidden='true']" "xpath_element" should exist
And "//div[@class='card dashboard-card' and contains(.,'Course 1')]//span[@data-region='is-favourite' and @aria-hidden='true']" "xpath_element" should exist
And "//div[@class='card dashboard-card' and contains(.,'Course 3')]//span[@data-region='is-favourite' and @aria-hidden='true']" "xpath_element" should exist
And I log out
Scenario: Star a course and switch display to list

View File

@ -25,18 +25,18 @@ Feature: The my overview block allows users to favourite their courses
Scenario: Test hide toggle functionality
Given I log in as "student1"
When I click on ".coursemenubtn" "css_element" in the "//div[@class='card course-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Hide from view" "link" in the "//div[@class='card course-card' and contains(.,'Course 2')]" "xpath_element"
When I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Hide from view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I reload the page
Then I should not see "Course 2" in the "Course overview" "block"
And I log out
Scenario: Test hide toggle functionality w/ favorites
Given I log in as "student1"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card course-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Star this course" "link" in the "//div[@class='card course-card' and contains(.,'Course 2')]" "xpath_element"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card course-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Hide from view" "link" in the "//div[@class='card course-card' and contains(.,'Course 2')]" "xpath_element"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Star this course" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Hide from view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
When I reload the page
Then I should not see "Course 2" in the "Course overview" "block"
And I click on "All" "button" in the "Course overview" "block"
@ -49,12 +49,12 @@ Feature: The my overview block allows users to favourite their courses
Scenario: Test show toggle functionality
Given I log in as "student1"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card course-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Hide from view" "link" in the "//div[@class='card course-card' and contains(.,'Course 2')]" "xpath_element"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Hide from view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
When I click on "All" "button" in the "Course overview" "block"
And I click on "Hidden" "link" in the "Course overview" "block"
When I click on ".coursemenubtn" "css_element" in the "//div[@class='card course-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Show this course" "link" in the "//div[@class='card course-card' and contains(.,'Course 2')]" "xpath_element"
When I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Show this course" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I reload the page
And I click on "Hidden" "button" in the "Course overview" "block"
When I click on "All" "link" in the "Course overview" "block"
@ -63,15 +63,15 @@ Feature: The my overview block allows users to favourite their courses
Scenario: Test show toggle functionality w/ favorites
Given I log in as "student1"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card course-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Star this course" "link" in the "//div[@class='card course-card' and contains(.,'Course 2')]" "xpath_element"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card course-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Hide from view" "link" in the "//div[@class='card course-card' and contains(.,'Course 2')]" "xpath_element"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Star this course" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Hide from view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "All" "button" in the "Course overview" "block"
And I click on "Hidden" "link" in the "Course overview" "block"
And I should see "Course 2" in the "Course overview" "block"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card course-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Show this course" "link" in the "//div[@class='card course-card' and contains(.,'Course 2')]" "xpath_element"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Show this course" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
When I reload the page
Then I should not see "Course 2" in the "Course overview" "block"
And I click on "Hidden" "button" in the "Course overview" "block"