%PDF- %PDF-
| Direktori : /home/vacivi36/ava/mod/lti/tests/behat/ |
| Current File : /home/vacivi36/ava/mod/lti/tests/behat/addtype.feature |
@mod @mod_lti
Feature: Add preconfigured tools via teacher interface
In order to provide reusable activities for teachers
As a teacher
I need to be able to add preconfigured tools
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Terry1 | Teacher1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
@javascript
Scenario: Add a tool from a cartridge
Given the following "activity" exists:
| course | C1 |
| activity | lti |
| name | Test tool activity |
When I am on the "Test tool activity" "lti activity editing" page logged in as teacher1
And I set the field "Tool URL" to local url "/mod/lti/tests/fixtures/ims_cartridge_basic_lti_link.xml"
And I press "Save and return to course"
And I am on the "Test tool activity" "lti activity editing" page
And I expand all fieldsets
Then the field "Tool URL" matches value "http://www.example.com/lti/provider.php"
And the field "Secure tool URL" matches value "https://www.example.com/lti/provider.php"
And the field "Icon URL" matches value "http://download.moodle.org/unittest/test.jpg"
And the field "Secure icon URL" matches value "https://download.moodle.org/unittest/test.jpg"
@javascript @_switch_window
Scenario: Add a preconfigured tool from a cartridge
Given the following "activity" exists:
| course | C1 |
| activity | lti |
| name | Test tool activity 1 |
When I am on the "Test tool activity 1" "lti activity editing" page logged in as teacher1
And I follow "Add preconfigured tool"
And I switch to "add_tool" window
And I set the field "Tool name" to "Placeholder"
And I set the field "Tool URL" to local url "/mod/lti/tests/fixtures/ims_cartridge_basic_lti_link.xml"
And I press "Save changes"
And I switch to the main window
And I wait "2" seconds
And I follow "Edit preconfigured tool"
And I switch to "edit_tool" window
Then the field "Tool URL" matches value "http://www.example.com/lti/provider.php"
And the field "Icon URL" matches value "http://download.moodle.org/unittest/test.jpg"
And the field "Secure icon URL" matches value "https://download.moodle.org/unittest/test.jpg"
And I press "Cancel"
And I switch to the main window
And I press "Save and return to course"
And I am on the "Test tool activity 1" "lti activity editing" page
And the field "Preconfigured tool" matches value "Placeholder"
@javascript @_switch_window
Scenario: Add and use a preconfigured tool
Given the following "activity" exists:
| course | C1 |
| activity | lti |
| name | Test tool activity |
When I am on the "Test tool activity" "lti activity editing" page logged in as teacher1
And I set the field "Tool URL" to local url "/mod/lti/tests/fixtures/tool_provider.php"
And I press "Save and return to course"
And I am on the "Test tool activity" "lti activity" page
And I switch to "contentframe" iframe
Then I should see "This represents a tool provider"