Skip to content

Commit

Permalink
MDL-69863 block_accessreview: Better error display.
Browse files Browse the repository at this point in the history
  • Loading branch information
mchurchward authored and stronk7 committed May 4, 2021
1 parent c0a52bc commit 749c657
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 34 deletions.
21 changes: 10 additions & 11 deletions blocks/accessreview/lang/en/block_accessreview.php
Expand Up @@ -25,19 +25,18 @@

defined('MOODLE_INTERNAL') || die();

$string['accessreview:addinstance'] = 'Add an Accessibility Review block to a course';
$string['accessreview:view'] = 'View the Accessibility Review';
$string['accessreview:addinstance'] = 'Add an accessibility review block to a course';
$string['accessreview:view'] = 'View the accessibility review';
$string['checktypes'] = 'Types';
$string['errors'] = 'Errors';
$string['errordisplay'] = 'Display errors in this format';
$string['errorssummary'] = 'Accessibility Review';
$string['errorssummary'] = 'Accessibility review';
$string['frown'] = 'Errors found, sorry!';
$string['guides'] = 'Guides';
$string['link:pdf'] = 'Link to PDF resource on {$a} - opens in new window';
$string['link:video'] = 'Link to Video resource on {$a} - opens in new window';
$string['link:video'] = 'Link to video resource on {$a} - opens in new window';
$string['nodata'] = 'No accessibility results data was found.';
$string['pluginname'] = 'Accessibility Review';
$string['privacy:metadata'] = 'The Accessibility Review plugin does not store any personal data.';
$string['pluginname'] = 'Accessibility review';
$string['privacy:metadata:preference:block_accessreviewtogglestate'] = 'The user\'s preference for hiding or showing the course accessibility highlighting.';
$string['privacy:togglestateoff'] = 'The current preference for the course accessibility highlighting is off.';
$string['privacy:togglestateon'] = 'The current preference for the course accessibility highlighting is on.';
Expand All @@ -50,15 +49,15 @@
$string['smile'] = '0 errors, congratulations!';
$string['status:successalt'] = 'Passed';
$string['status:success'] = 'Passed';
$string['status:errors'] = 'Failed {$a->errorCount} errors ({$a->failureRate}% of all checks)';
$string['status:errors'] = 'Failed - errors: {$a->errorCount} ({$a->failureRate}% of all checks)';
$string['status:errorsalt'] = 'Errors';
$string['toggleaccessreview'] = 'Toggle highlighting';
$string['toolpage'] = 'Report page to show';
$string['toolpage'] = 'Toolkit page to show';
$string['totalerrors'] = '<em>Total errors:</em> {$a} <br>(total excludes course settings)';
$string['viewreportalt'] = 'View Brickfield Accessibility Report';
$string['viewreportalt'] = 'View Brickfield accessibility toolkit';
$string['viewreport'] = 'View';
$string['downloadreportalt'] = 'Download Brickfield Accessibility Report';
$string['downloadreportalt'] = 'Download Brickfield accessibility summary report';
$string['downloadreport'] = 'Download';
$string['togglealt'] = 'Toggle Brickfield Accessibility Heatmap';
$string['togglealt'] = 'Toggle Brickfield accessibility heatmap';
$string['toggle'] = 'Toggle highlighting';
$string['whattoshow'] = 'What to show on course page';
16 changes: 8 additions & 8 deletions blocks/accessreview/tests/behat/accessreview.feature
Expand Up @@ -14,19 +14,19 @@ Feature: Block accessreview
Scenario: View accessreview block on a course
Given I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
When I add the "Accessibility Review" block
Then I should see "Accessibility Review"
When I add the "Accessibility review" block
Then I should see "Accessibility review"
And I should see "Your accessibility toolkit needs to be registered."

Scenario: Hide/show accessreview view
Given I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
When I add the "Accessibility Review" block
Then I should see "Accessibility Review"
When I add the "Accessibility review" block
Then I should see "Accessibility review"
And I should see "Your accessibility toolkit needs to be registered."
And I click on "Actions menu" "icon" in the "Accessibility Review" "block"
And I follow "Hide Accessibility Review block"
And I click on "Actions menu" "icon" in the "Accessibility review" "block"
And I follow "Hide Accessibility review block"
And I should not see "Your accessibility toolkit needs to be registered."
And I click on "Actions menu" "icon" in the "Accessibility Review" "block"
And I follow "Show Accessibility Review block"
And I click on "Actions menu" "icon" in the "Accessibility review" "block"
And I follow "Show Accessibility review block"
And I should see "Your accessibility toolkit needs to be registered."
30 changes: 15 additions & 15 deletions blocks/accessreview/tests/behat/accessreview_results.feature
Expand Up @@ -21,29 +21,29 @@ Feature: Block accessreview results
And I set the field "id_key" to "123456789012345678901234567890ab"
And I set the field "id_hash" to "ab123456789012345678901234567890"
And I press "Activate"
Then I should see "Your accessibility toolkit is still being validated."
Then I should see "Your accessibility toolkit is functional while being validated."
And I am on "Course 1" course homepage with editing mode on
When I add the "Accessibility Review" block
Then I should see "Accessibility Review"
When I add the "Accessibility review" block
Then I should see "Accessibility review"
And I press "Submit for analysis"
Then I should see "This course has been scheduled for analysis."
And I run the scheduled task "\tool_brickfield\task\process_analysis_requests"
And I run the scheduled task "\tool_brickfield\task\bulk_process_courses"
And I run the scheduled task "\tool_brickfield\task\bulk_process_caches"
And I reload the page
And I should see "Image" in the "Accessibility Review" "block"
And I should see "Layout" in the "Accessibility Review" "block"
And I should see "Link" in the "Accessibility Review" "block"
And I should see "Media" in the "Accessibility Review" "block"
And I should see "Table" in the "Accessibility Review" "block"
And I should see "Text" in the "Accessibility Review" "block"
And I should see "Image" in the "Accessibility review" "block"
And I should see "Layout" in the "Accessibility review" "block"
And I should see "Link" in the "Accessibility review" "block"
And I should see "Media" in the "Accessibility review" "block"
And I should see "Table" in the "Accessibility review" "block"
And I should see "Text" in the "Accessibility review" "block"
# We created one link error above.
And I should see "1" in the "Link" "table_row"
# We created one text issue, and the standard Behat course generator creates another (too much content).
And I should see "2" in the "Text" "table_row"
And "View Brickfield Accessibility Report" "icon" should exist in the "Accessibility Review" "block"
And "Toggle Brickfield Accessibility Heatmap" "icon" should exist in the "Accessibility Review" "block"
And "Download Brickfield Accessibility Report" "icon" should exist in the "Accessibility Review" "block"
And "View Brickfield accessibility toolkit" "icon" should exist in the "Accessibility review" "block"
And "Toggle Brickfield accessibility heatmap" "icon" should exist in the "Accessibility review" "block"
And "Download Brickfield accessibility summary report" "icon" should exist in the "Accessibility review" "block"

Scenario: Toggle highlighting on/off
Given I log in as "admin"
Expand All @@ -55,13 +55,13 @@ Feature: Block accessreview results
And I set the field "id_hash" to "ab123456789012345678901234567890"
And I press "Activate"
And I am on "Course 1" course homepage with editing mode on
When I add the "Accessibility Review" block
When I add the "Accessibility review" block
And I press "Submit for analysis"
And I run the scheduled task "\tool_brickfield\task\process_analysis_requests"
And I run the scheduled task "\tool_brickfield\task\bulk_process_courses"
And I run the scheduled task "\tool_brickfield\task\bulk_process_caches"
And I reload the page
And I click on "Toggle Brickfield Accessibility Heatmap" "icon"
And I click on "Toggle Brickfield accessibility heatmap" "icon"
And ".block_accessreview_view" "css_element" should be visible
And I click on "Toggle Brickfield Accessibility Heatmap" "icon"
And I click on "Toggle Brickfield accessibility heatmap" "icon"
And ".block_accessreview_view" "css_element" should not be visible

0 comments on commit 749c657

Please sign in to comment.