mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 02:16:41 +02:00
MDL-69863 tool_brickfield: Added Behat tests.
This commit is contained in:
parent
19e3ba9f07
commit
abf3cb9e3d
5 changed files with 190 additions and 18 deletions
47
admin/tool/brickfield/tests/behat/accessresults.feature
Normal file
47
admin/tool/brickfield/tests/behat/accessresults.feature
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
@tool @tool_brickfield
|
||||||
|
Feature: Brickfield activityresults
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given the following "courses" exist:
|
||||||
|
| fullname | shortname | category | description |
|
||||||
|
| Course 1 | C1 | 0 | <b> Description text </b> |
|
||||||
|
And the following "activities" exist:
|
||||||
|
| activity | name | intro | course | idnumber |
|
||||||
|
| label | Label one | <b>Bold text is bold.</b> | C1 | id001 |
|
||||||
|
| label | Label two | <a href="modle.org">Click here</a> | C1 | id002 |
|
||||||
|
|
||||||
|
@javascript
|
||||||
|
Scenario: Test the Brickfield accessibility reports plugin
|
||||||
|
Given I log in as "admin"
|
||||||
|
And I navigate to "Plugins > Admin tools > Accessibility > Brickfield registration" in site administration
|
||||||
|
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."
|
||||||
|
And I navigate to "Plugins > Admin tools > Accessibility > Go to reports" in site administration
|
||||||
|
And I press "Submit for analysis"
|
||||||
|
Then I should see "The global (course independent) content has been scheduled for analysis."
|
||||||
|
And I am on "Course 1" course homepage
|
||||||
|
And I navigate to "Accessibility toolkit" in current page administration
|
||||||
|
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 navigate to "Accessibility toolkit" in current page administration
|
||||||
|
And I should see "Error details : Course: Course 1"
|
||||||
|
And I should see "Overall page content length"
|
||||||
|
And I should see "\"Bold\" (b) elements should not be used"
|
||||||
|
And I should see "Link text should be descriptive"
|
||||||
|
And I follow "Activity breakdown"
|
||||||
|
Then I should see "Results per activity : Course: Course 1"
|
||||||
|
And I navigate to "Plugins > Admin tools > Accessibility > Brickfield registration" in site administration
|
||||||
|
And I set the field "id_key" to "123456789012345678901234567890ab"
|
||||||
|
And I set the field "id_hash" to "ab123456789012345678901234567890"
|
||||||
|
And I press "Activate"
|
||||||
|
And I navigate to "Plugins > Admin tools > Accessibility > Go to reports" in site administration
|
||||||
|
And I should see "Error details : All reviewed courses (2)"
|
||||||
|
And I follow "Activity breakdown"
|
||||||
|
Then I should see "Results per activity : All reviewed courses (2)"
|
||||||
|
And I follow "Content types"
|
||||||
|
Then I should see "Results per content type : All reviewed courses (2)"
|
30
blocks/accessreview/tests/accessreview.feature
Normal file
30
blocks/accessreview/tests/accessreview.feature
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
@block @block_accessreview @javascript
|
||||||
|
Feature: Block accessreview
|
||||||
|
In order to overview accessibility information on my course
|
||||||
|
As a manager
|
||||||
|
I can add the accessreview block in a course
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given the following "courses" exist:
|
||||||
|
| fullname | shortname | format |
|
||||||
|
| Course 1 | C1 | topics |
|
||||||
|
|
||||||
|
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"
|
||||||
|
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"
|
||||||
|
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 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 should see "Your accessibility toolkit needs to be registered."
|
68
blocks/accessreview/tests/accessreview_results.feature
Normal file
68
blocks/accessreview/tests/accessreview_results.feature
Normal file
|
@ -0,0 +1,68 @@
|
||||||
|
@block @block_accessreview @javascript
|
||||||
|
Feature: Block accessreview results
|
||||||
|
In order to overview accessibility information on my course
|
||||||
|
As a manager
|
||||||
|
I can add the accessreview block in a course after running the scheduled task
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given the following "courses" exist:
|
||||||
|
| fullname | shortname | format |
|
||||||
|
| Course 1 | C1 | topics |
|
||||||
|
And the following "activities" exist:
|
||||||
|
| activity | name | intro | course | idnumber |
|
||||||
|
| label | Label one | <b>Bold text is bold.</b> | C1 | id001 |
|
||||||
|
| label | Label two | <a href="modle.org">Click here</a> | C1 | id002 |
|
||||||
|
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"
|
||||||
|
|
||||||
|
Scenario: View accessreview block results on a course
|
||||||
|
Given I log in as "admin"
|
||||||
|
And I navigate to "Plugins > Admin tools > Accessibility > Brickfield registration" in site administration
|
||||||
|
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."
|
||||||
|
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"
|
||||||
|
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"
|
||||||
|
# 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"
|
||||||
|
|
||||||
|
Scenario: Toggle highlighting on/off
|
||||||
|
Given I log in as "admin"
|
||||||
|
Given the following "user preferences" exist:
|
||||||
|
| user | preference | value |
|
||||||
|
| admin | block_accessreviewtogglestate | 0 |
|
||||||
|
And I navigate to "Plugins > Admin tools > Accessibility > Brickfield registration" in site administration
|
||||||
|
And I set the field "id_key" to "123456789012345678901234567890ab"
|
||||||
|
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
|
||||||
|
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 ".block_accessreview_view" "css_element" should be visible
|
||||||
|
And I click on "Toggle Brickfield Accessibility Heatmap" "icon"
|
||||||
|
And ".block_accessreview_view" "css_element" should not be visible
|
|
@ -14,17 +14,17 @@ Feature: Block accessreview
|
||||||
And I am on "Course 1" course homepage with editing mode on
|
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
|
||||||
Then I should see "Accessibility Review"
|
Then I should see "Accessibility Review"
|
||||||
And I should see "No accessibility results data was found."
|
And I should see "Your accessibility toolkit needs to be registered."
|
||||||
|
|
||||||
Scenario: Hide/show accessreview view
|
Scenario: Hide/show accessreview view
|
||||||
Given I log in as "admin"
|
Given I log in as "admin"
|
||||||
And I am on "Course 1" course homepage with editing mode on
|
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
|
||||||
Then I should see "Accessibility Review"
|
Then I should see "Accessibility Review"
|
||||||
And I should see "No accessibility results data was found."
|
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 click on "Actions menu" "icon" in the "Accessibility Review" "block"
|
||||||
And I follow "Hide Accessibility Review block"
|
And I follow "Hide Accessibility Review block"
|
||||||
And I should not see "No accessibility results data was found."
|
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 click on "Actions menu" "icon" in the "Accessibility Review" "block"
|
||||||
And I follow "Show Accessibility Review block"
|
And I follow "Show Accessibility Review block"
|
||||||
And I should see "No accessibility results data was found."
|
And I should see "Your accessibility toolkit needs to be registered."
|
||||||
|
|
|
@ -9,30 +9,57 @@ Feature: Block accessreview results
|
||||||
| fullname | shortname | format |
|
| fullname | shortname | format |
|
||||||
| Course 1 | C1 | topics |
|
| Course 1 | C1 | topics |
|
||||||
And the following "activities" exist:
|
And the following "activities" exist:
|
||||||
| activity | name | intro | course | idnumber |
|
| activity | name | intro | course | idnumber |
|
||||||
| label | Label one | <b>Bold text is bold.</b> | C1 | id001 |
|
| label | Label one | <b>Bold text is bold.</b> | C1 | id001 |
|
||||||
And I run the scheduled task "\tool_brickfield\task\bulk_process_courses"
|
| label | Label two | <a href="modle.org">Click here</a> | C1 | id002 |
|
||||||
|
|
||||||
Scenario: View accessreview block results on a course
|
Scenario: View accessreview block results on a course
|
||||||
Given I log in as "admin"
|
Given I log in as "admin"
|
||||||
|
And I navigate to "Plugins > Admin tools > Accessibility > Brickfield registration" in site administration
|
||||||
|
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."
|
||||||
And I am on "Course 1" course homepage with editing mode on
|
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
|
||||||
Then I should see "Accessibility Review"
|
Then I should see "Accessibility Review"
|
||||||
And I should not see "No accessibility results data was found."
|
And I press "Submit for analysis"
|
||||||
And I should see "Image"
|
Then I should see "This course has been scheduled for analysis."
|
||||||
And I should see "Layout"
|
And I run the scheduled task "\tool_brickfield\task\process_analysis_requests"
|
||||||
And I should see "Link"
|
And I run the scheduled task "\tool_brickfield\task\bulk_process_courses"
|
||||||
And I should see "Media"
|
And I run the scheduled task "\tool_brickfield\task\bulk_process_caches"
|
||||||
And I should see "Table"
|
And I reload the page
|
||||||
And I should see "Text"
|
And I should see "Image" in the "Accessibility Review" "block"
|
||||||
And I should see "View"
|
And I should see "Layout" in the "Accessibility Review" "block"
|
||||||
And I should see "Toggle highlighting"
|
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"
|
||||||
|
|
||||||
Scenario: Toggle highlighting on/off
|
Scenario: Toggle highlighting on/off
|
||||||
Given I log in as "admin"
|
Given I log in as "admin"
|
||||||
|
Given the following "user preferences" exist:
|
||||||
|
| user | preference | value |
|
||||||
|
| admin | block_accessreviewtogglestate | 0 |
|
||||||
|
And I navigate to "Plugins > Admin tools > Accessibility > Brickfield registration" in site administration
|
||||||
|
And I set the field "id_key" to "123456789012345678901234567890ab"
|
||||||
|
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
|
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
|
||||||
Then I should see "Toggle highlighting"
|
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 ".block_accessreview_view" "css_element" should be visible
|
And ".block_accessreview_view" "css_element" should be visible
|
||||||
And I click on "Toggle highlighting" "text"
|
And I click on "Toggle Brickfield Accessibility Heatmap" "icon"
|
||||||
And ".block_accessreview_view" "css_element" should not be visible
|
And ".block_accessreview_view" "css_element" should not be visible
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue