Support Forum
describe('Sla testing', function (t) {
t.it('Test Sla Creation', function (t) {
t.chain({
waitForCQ: 'button[text=Scheduler]'
}, {
click: '>> button[text=Scheduler]'
}, {
click: '>> menuitem[text=Timetable]'
}, {
waitForCQ: 'panel[title=SLA]'
}, {
click: '>> panel[title=SLA]'
}, {
click: '>> button[tooltip=Create SLA]'
},
function (next) {
t.selectText('>> scheduler-sla-info textfield[fieldLabel=Name]');
t.type('>> scheduler-sla-info textfield[fieldLabel=Name]', 'SOME SLA', next);
},
function reloadPage(next) {
t.waitFor(2000, function () {
t.global.location.reload()
});
t.waitForPageLoad(next);
},
function (next) {
t.waitForComponentVisible('>> scheduler-sla-info textfield[value=SOME SLA]',next);
}
)
})
});
But exeptions are thrown,before testing starts, on initializtion.
No, I mean the zip folder with your setup or something else so that I can reproduce the problem.
Read the API documentation
Ok, then, please can you enable "stop on exception" in your debugger, do some investigation and post the results here? I can't fix the problem w/o knowing anything about it
Read the API documentation
The stack trace of error:
The line where it happens:
"AlertDependency" is alternative name of controller.
When I use this code to hook:
it has problems to see static clases, or maybe(I not sure) it tries to hook EditSlaAlertsController before AlertDependencyController or something like this.
ReferenceError: AlertDependency is not defined
at eval (https://localhost:8181/ac-web-package/plugins/scheduler/view/controller/EditSlaAlertsController.js:6:332)
at eval (native)
at Object.Ext.globalEval (https://localhost:8181/ac-web-package/extjs/ext-all-debug.js:1366:32)
at Object.Ext.Boot.Ext.Boot.Entry.inject (https://localhost:8181/ac-web-package/extjs/ext-all-debug.js:1122:21)
at Object.b.Boot.Entry.inject (eval at <anonymous> (https://localhost:8181/ac-web-package/:34:43), <anonymous>:3:470)
at Object.Ext.Boot.Ext.Boot.Entry.evaluateContent (https://localhost:8181/ac-web-package/extjs/ext-all-debug.js:1239:18)
at Object.Ext.Boot.Ext.Boot.Entry.evaluate (https://localhost:8181/ac-web-package/extjs/ext-all-debug.js:1255:24)
at Object.Ext.Boot.Ext.Boot.Entry.loadSync (https://localhost:8181/ac-web-package/extjs/ext-all-debug.js:1175:16)
at Object.Ext.Boot.Ext.Boot.Entry.load (https://localhost:8181/ac-web-package/extjs/ext-all-debug.js:1231:24)
at Object.Ext.Boot.Ext.Boot.Request.loadEntries (https://localhost:8181/ac-web-package/extjs/ext-all-debug.js:799:47)
Ext.define('Plugin.scheduler.view.controller.EditSlaAlertsController', {
extend : 'Ext.app.ViewController',
alias : 'controller.edit-sla-alerts-controller',
requires : ['Platform.utils.Permissions', 'Plugin.scheduler.utils.Events'],
control : {
'grid#assigned-alerts-grid' : {
selectionchange : 'onAlertSelectionChange',
itemdblclick : AlertDependency.onRedirectToAlert, <---HERE
rowkeydown : 'onAlertKeyDown',
boxready : 'initDnD'
}
},
Ext.define('Plugin.scheduler.dependency.AlertDependencyController', {
extend : 'Ext.app.Controller',
alternateClassName : ['AlertDependency'],
requires : ['Plugin.scheduler.utils.Events'],
<script type="text/javascript">console.log(parent);
parent.Harness && eval(parent.Harness.getLoaderInstrumentationHook())
</script>
Hm.. Can you reproduce the problem in simplified environment (build an empty app with single controller) and post the test case?
Read the API documentation