Scenario: Backup and restore course with preconfigured site LTI tool on the same site
When I log in as "admin"
And I navigate to "Manage tools" node in "Site administration > Plugins > Activity modules > External tool"
And I follow "Manage preconfigured tools"
And I follow "Add preconfigured tool"
And I set the following fields to these values:
|Toolname|Mysitetool|
|ToolURL|https://www.moodle.org|
|lti_coursevisible|1|
And I press "Save changes"
And I navigate to "Manage tools" node in "Site administration > Plugins > Activity modules > External tool"
And "This tool has not yet been used""text" should exist in the "//div[contains(@id,'tool-card-container') and contains(., 'My site tool')]""xpath_element"
And I am on site homepage
And I follow "Course 1"
And I turn editing mode on
And I add a "External tool" to section "1" and I fill the form with:
|Activityname|MyLTImodule|
|Preconfiguredtool|Mysitetool|
|Launchcontainer|Embed|
And I follow "Course 1"
And I should see "My LTI module"
And I backup "Course 1" course using this options:
And I choose "Edit settings" in the open action menu
Then the field "Preconfigured tool" matches value "My site tool"
And I navigate to "Manage tools" node in "Site administration > Plugins > Activity modules > External tool"
And "This tool is being used 2 times""text" should exist in the "//div[contains(@id,'tool-card-container') and contains(., 'My site tool')]""xpath_element"
@javascript@_switch_window
Scenario: Backup and restore course with preconfigured course LTI tool on the same site
When I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
# In the first course create an LTI module that uses a course preconfigured toolю
And I add a "External tool" to section "1"
And I set the following fields to these values:
|Activityname|Testtoolactivity2|
AndIfollow"Addpreconfiguredtool"
And I switch to "add_tool" window
And I set the field "Tool name" to "My course tool"
And I set the field "Tool URL" to "http://www.example.com/lti/provider.php"
And I set the field "Consumer key" to "my key"
And I set the field "Shared secret" to "my secret"
And I set the field "Default launch container" to "Existing window"
And I press "Save changes"
And I switch to the main window
And I press "Save and return to course"
# Backup course and restore into another course
And I backup "Course 1" course using this options: