Opening a page in the Experience Editor might take a long time due to a large number of records in the sitecore_suggested_test_index.
To resolve the issue, consider one of the following options:
canExecute: function (context) {
var testCount = context.app.canExecute("Optimization.SuggestedTests.Count", context.currentContext);
var outputEl = $("a[data-sc-id='Suggested-Tests'] span");
var counterSpan = "<span> (" + testCount + ")</span>";
canExecute: function (context) {
var self = this;
self.setLoadingAnimation(true);
context.app.canExecute("Optimization.SuggestedTests.Count", context.currentContext, function (testCount) {
self.setLoadingAnimation(false);
self.fillupSuggestedTestsCount(testCount);
});
canExecute: function (context) { var testCount = 0;
var outputEl = $("a[data-sc-id='Suggested-Tests'] span");
var counterSpan = "";
canExecute: function (context) {
var self = this;
// self.setLoadingAnimation(true);
// context.app.canExecute("Optimization.SuggestedTests.Count", context.currentContext, function (testCount) {
// self.setLoadingAnimation(false);
// self.fillupSuggestedTestsCount(testCount);
// });
self.fillupSuggestedTestsCount(0);
<setting name="ContentTesting.AutomaticContentTesting.Enabled" value="false" />