Commit 36f3aee3 authored by Andrew Madden's avatar Andrew Madden Committed by ilya
Browse files

MDL-69092 mod_lti: Add js_pending to help behat tests

parent e14bb0b9
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
......@@ -299,6 +299,9 @@ define(['jquery', 'core/ajax', 'core/paged_content_factory', 'core/notification'
* @private
*/
var reloadToolList = function() {
// Behat tests should wait for the tool list to load.
M.cfg.js_pending('reloadToolList');
const cardContainer = getToolCardContainer();
const listContainer = getToolListContainer();
const limit = 60;
......@@ -322,7 +325,10 @@ define(['jquery', 'core/ajax', 'core/paged_content_factory', 'core/notification'
// Add the paged content into the page.
templates.replaceNodeContents(cardContainer, html, js);
})
.always(stopLoading(listContainer));
.always(function() {
stopLoading(listContainer);
M.cfg.js_complete('reloadToolList');
});
});
startLoading(listContainer);
};
......
......@@ -14,6 +14,7 @@ Feature: Navigate existing LTI tool types using pagination
Scenario: View first page of tool types.
Given I log in as "admin"
When I navigate to "Plugins > Activity modules > External tool > Manage tools" in site administration
And I wait until the page is ready
Then I should see "Test tool 30"
And "Test tool 70" "text" should not be visible
......@@ -21,7 +22,9 @@ Feature: Navigate existing LTI tool types using pagination
Scenario: View second page of tool types using page 2 button.
Given I log in as "admin"
When I navigate to "Plugins > Activity modules > External tool > Manage tools" in site administration
And I wait until the page is ready
And I click on "2" "link"
And I wait until the page is ready
Then I should see "Test tool 70"
And "Test tool 30" "text" should not be visible
......@@ -29,6 +32,8 @@ Feature: Navigate existing LTI tool types using pagination
Scenario: View last page of tool types using page 2 button.
Given I log in as "admin"
When I navigate to "Plugins > Activity modules > External tool > Manage tools" in site administration
And I wait until the page is ready
And I click on "Last" "link"
And I wait until the page is ready
Then I should see "Test tool 70"
And "Test tool 30" "text" should not be visible
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment