Get help with testing, discuss unit testing strategies etc.


Post by samaro »

Hi!

We are trying to implement Siesta in order to automate our testing, but i ve encountered an issue.

We have Ext JS 3.4, with ASP NET MVC2 on the backend.
They connect via Ext.direct.MVC dll (https://github.com/elishnevsky/ext-direct-mvc).
I ve been trying for 6 hours to configure siesta, but no luck

When i start harness and run the tests (im running the sanity test), i encounter an error with my init.js

My init.js looks like this:

Ext.namespace('Maer.Web');

Ext.QuickTips.init();
Ext.ns('Ext.app');
Ext.Direct.addProvider(Ext.app.REMOTING_API); The error appears on this line

Ext.form.TextField.prototype.blankText = "Este campo no puede estar vacío";

I ve digged in, and the errors is with the ext-js-debug.js

addProvider: function (provider) {
var a = arguments;
if (a.length > 1) {
for (var i = 0, len = a.length; i < len; i++) {
this.addProvider(a);
}
return;
}


if (!provider.events) {
provider = new Ext.Direct.PROVIDERS[provider.type](provider);
}
on the if(!provider....) it's like provider is null


On our solution, we register the provider via webconfig, using the dll from the repo shown above (Ext.app.REMOTING_API).

Is there a way to use Siesta (either LITE or premium), in my enviroment? Using this ext.direct implementation?

Post by nickolay »

Hi,

Can you provide a reproducible test case, demonstrating the problem? Not clear what exactly is wrong.

Post by samaro »

I cant send you a reproducible test case, but i can send you more information.

When i run harness, with the sanity test it gives me this error

TypeError: Cannot read property 'events' of undefined
at constructor.addProvider (https://localhost:9090/Web/Scripts/extjs ... s:26184:22)
at https://localhost:9090/Web/Scripts/init.js:5:12


My enviroment is like this


/root
-------/Web
-------/Tests
--------------(My files- i uploaded them here so you can take a look)
--------------/Siesta (all the siesta lite directory)


In the zip, you ll find application.js and init.js, those are located on the web directory.

We use extjs, but without the MVC model, we bypass it to use .NET MVC, using this plugin: They connect via Ext.direct.MVC dll (https://github.com/elishnevsky/ext-direct-mvc).
On the init.js you ll find this line

Ext.Direct.addProvider(Ext.app.REMOTING_API); -> This line is where it fails!

I think it's due to the fact that Ext.app.REMOTING_API is null.

My question is:

Is there a way to integrate siesta with this enviroment? We are really looking forward this product, i m using the Lite version for research purposes, but we 'd really like to aquire the premium version if we can make it work.

Thanks!
Attachments
Tests.zip
(9.37 KiB) Downloaded 225 times
Harness window
Harness window
harness.png (99.39 KiB) Viewed 5908 times

Post by samaro »

i ve pseudo mocked the provider object with no luck, is like it is not loading Ex.direct.

Is there any way to integrate siesta with Ext.Direct?

Post by nickolay »

Try enabling the "Transparent exceptions" mode (the gear icon in the left bottom corner) and debug this exception in chrome ("pause on exception")? Btw I see your Siesta UI is a bit corrupted - do you include the siesta css file on harness page?

Are you sure you've listed all the dependencies of your app in the "preload" config? Perhaps something is missed or not loaded (check the "network" tab of the chrome debugger). You may also want to use the main page of your app for tests, using pageUrl config: https://www.bryntum.com/docs/siesta/#!/ ... fg-pageUrl

Post by nickolay »

Siesta just loads whatever is in the "preload" config and launch the "StartTest()" function, thats all, so it works with any type of code.

Post by samaro »

nickolay wrote:Siesta just loads whatever is in the "preload" config and launch the "StartTest()" function, thats all, so it works with any type of code.
Ajam, but Ext.Direct is a .NET assembly, what should i include?

Post by nickolay »

You mean your application will be running inside of some kind of wrapper to make a desktop app?

Post by samaro »

nickolay wrote:You mean your application will be running inside of some kind of wrapper to make a desktop app?
No, it's a web app, but it has Ext JS on the front end, and MVC2 .NET on the back end (server side).
https://github.com/elishnevsky/ext-direct-mvc This is the "wrapper", which provides a provider ( :P ) to by pass the built in MVC on ext js and give the controller's control to .NET MVC

Post by nickolay »

Siesta is a web app as well it does not know anything about your backend.

What it does: 1) creates an empty iframe 2) loads the files from "preload" in the iframe. 3) launch the tests

You need to include the same files your include in your application normally.

Post Reply