adaptlearning / adapt-contrib-boxMenu

A simple contributed menu based upon a grid system
GNU General Public License v3.0
2 stars 29 forks source link

Box Menu tests need to detect if the landing page is a boxmenu #178

Closed cahirodoherty-learningpool closed 7 months ago

cahirodoherty-learningpool commented 8 months ago

Subject of the issue/enhancement/features

There isn't much in the tests to specifically identify that the landing page is a boxmenu content object

oliverfoster commented 8 months ago

It is possible to use the boxmenu as a sub menu only. The whole test assumes that boxmenu is being used as the main menu, which won't always be the case. It would be better to navigate to a contentobject (course/menu) which is a boxmenu and then perform these tests.

cahirodoherty-learningpool commented 8 months ago

It is possible to use the boxmenu as a sub menu only. The whole test assumes that boxmenu is being used as the main menu, which won't always be the case. It would be better to navigate to a contentobject (course/menu) which is a boxmenu and then perform these tests.

I agree with the sentiment here but I'm at a loss as to how/where that could be done. sorry. Could you point me in the right direction?

oliverfoster commented 8 months ago

Using this code comment https://github.com/adaptlearning/adapt-contrib-boxMenu/blob/master/js/adapt-contrib-boxMenu.js#L13 we can see that it's possible to use a boxMenu view with _component: "boxMenu" and _view: "boxMenu or in the classic mode defined here https://github.com/adaptlearning/adapt-contrib-boxMenu/blob/master/js/adapt-contrib-boxMenu.js#L9-L10 with either _type: "course" or _type: "menu".

After the cy.getData(); Do something like:

this.boxMenus =  this.data.filter(item => item._component === 'boxMenu' || item._view === 'boxMenu');
if (!this.boxMenus.length) this.boxMenus =  this.data.filter(item => ['course', 'menu'].includes(item._type));

Then run the tests on each this.boxMenus only. Navigate to each menu. Waiting appropriately for some sign that the menu has finished rendering (as in that other issue with the cy.wait problem).

github-actions[bot] commented 7 months ago

:tada: This issue has been resolved in version 6.5.2 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: