Loading Ext.js Application in test project

Get help with testing, discuss unit testing strategies etc.


User avatar
shamona95
Posts: 13
Joined: Thu Mar 14, 2019 5:42 pm

Re: Loading Ext.js Application in test project

Post by shamona95 »

Right , i never switched to siesta iframe itself , now i can reach to files in console , but as i told the main important thing is reaching the application classes inside test files , i couldn't solve this issue yet . (i just wanted to use console , to check if i can see my app files or not.)
if i use one of the app classes in test file , it says `undefined` .
Was there anything wrong with the way i implemented siesta ?
thanks for your responses .

User avatar
nickolay
Core Developer
Core Developer
Posts: 3457
Joined: Mon May 16, 2011 10:48 am

Re: Loading Ext.js Application in test project

Post by nickolay »

I just noticed you use `separateContext` option, enabled globally for the whole project. This is an old name for the enablePageRedirect option, which causes Siesta to create 2 iframes for the test - one for the application and one for the test. To reach the context of the application from the test, one will need to use `t.global`. So for example to reach the `MyStore` class from the test context, one need to use: `t.global.MyStore`. See the "Cross-page testing guide" for details.

You can also disable this option, if you don't reload/redirect the page during the test (or enable it only for such tests).
We offer training in both Ext JS and our products, read more here.
Read the API documentation

User avatar
shamona95
Posts: 13
Joined: Thu Mar 14, 2019 5:42 pm

Re: Loading Ext.js Application in test project

Post by shamona95 »

I will continue with your suggestion and will try to use classes with `t.global`, but still it means i can not define the whole application in test project, is that right ?
whenever i need a class i have to first define it with `t.global`.

Post Reply