Support Forum
I'm getting a reference error when I try to run a component query within my test case. I tried adding extjs-all-debug.js to my harness and that didn't help. I also tried including it in my index.html file but I get a different error when doing that. The error is "Error: [Ext.createByAlias] Unrecognized alias: controller.viewport".
Any idea what might be causing this issue?
Any idea what might be causing this issue?
Sure thing.
Here's my index.html code.
Here's my harness.
And my test case (it doesn't do much).
Here's my index.html code.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>Siesta Harness</title>
<link rel="stylesheet" type="text/css" href="siesta/resources/css/siesta-all.css">
<script type="text/javascript" src="siesta/siesta-all.js"></script>
<script type="text/javascript" src="ext-6.2.0/build/ext-all-debug.js"></script>
<script type="text/javascript" src="harness.js"></script>
</head>
<body>
</body>
</html>
var harness = new Siesta.Harness.Browser.ExtJS();
harness.configure({
title: 'Siesta Harness',
preload: ['ext-6.2.0/build/ext-all-debug.js']
});
harness.start(
{
group: 'Tests',
expanded: true,
separateContext: true,
items: [
{
// url: 'harness_case.js',
url: 'sandbox_case.js',
name: 'Siesta Harness',
pageUrl: 'https://127.0.0.1:8443/OneView/home?notop=true',
name: 'Siesta Harness',
separateContext: true
}
]
}
);
StartTest(function(t) {
var result = Ext.ComponentQuery.query("treeview[id=treeview-1125]")[0].id;
t.diag(result);
}
)
When using pageRedirect, 'window' points to the 'top' window (where the Siesta application lives). You want to do:
or use https://bryntum.com/docs/siesta/#!/api/ ... method-Extt.global.Ext.ComponentQuery.query("treeview[id=treeview-1125]")[0].id;
t.Ext()
Also do not include ext-all-debug.js in your harness html file. Your tests are running in isolated iframes, which are not related to the harness html.
Read the API documentation
Try waiting for the ComponentQuery may be:
May be this flag will help also: https://local/workspace/JavaScript/siest ... orAppReady
{ waitFor : function() { return t.global.Ext && t.global.Ext.ComponentQuery; }}
May be this flag will help also: https://local/workspace/JavaScript/siest ... orAppReady
Read the API documentation