Get help with testing, discuss unit testing strategies etc.


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 .

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).

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