Get help with testing, discuss unit testing strategies etc.


Post by Enzoo »

nickolay wrote: Thu Sep 19, 2019 10:04 am @Enzoo - I've just tried with Sencha Touch 2.3 and it seems to work fine. What is your Sencha Touch version? Please start a new thread for your reply.
Hi, i am using the following in my application
siesta-5.2.3
SenchaTouch-2.4.1

the test app to test the application is using

siesta-5.2.3
SenchaTouch-2.4.1
extJS-6.0.1-gpl

i have attached a test application where the test just clicks one button, "getting started", it does not do the click when it actually should.

Is there somehow i can send you the file, it says its too large to add as an attachment, its 71mb.

Post by nickolay »

Hi,

Weird, it works for me with SenchaTouch 2.4.2 too. Yes, please use https://dropmefiles.com to upload the test case.

Post by Enzoo »

Hi Nickolay,

here is the link to my test app https://dropmefiles.com/FBaQJ
all you prob need to change is the extjs location in the index.html file.

Post by nickolay »

Thank you for the test case. There were few issues in it:

1) The `btn` variable used as a target in the 2nd step will be set to `undefined`, because it is dereferenced at the time of `t.chain()` execution. At that time, the 1st step did not start yet, so `btn` is still "empty".
		    var t = this,
                btn;

		    t.chain(

                // exit app if app is open
                function (next) {
                    var main = t.getMain();
                    btn = main.down('button[title="Get Started"]');
                    //debugger;
                    btn = btn.element.dom;
                    t.waitForMs(500, next);
                },

                {
                    action: 'tap',
                    target: btn
                },
To correct, one can delay dereferencing with function:
                {
                    action: 'tap',
                    target: () => btn
                },
However, the best would be just:
                {
                    action: 'tap',
                    target: '>>button[title="Get Started"]'
                },
which leads to problem 2

2) The exception is thrown `TypeError: Cannot read property 'deprecate' of undefined` which is caused by the `Ext.Logger` class missing in the application build.

This can be fixed by either adding Ext.Logger, or modifying this line in the "siesta-all.js":
return comp.getEl ? comp.getEl() : locateInputEl && comp.input || comp.el || comp.element;
to
return comp.getEl && !comp.element ? comp.getEl() : locateInputEl && comp.input || comp.el || comp.element;
(this change will be in the next release)

3) Since version 4.1.0, there's no need to include ExtJS on the project ("harness") html page. The Siesta UI is already compiled and included in the "siesta-all.js". See the "examples/browser/index.html" for example.

Post by Enzoo »

Thanks, this helped a lot.

Post Reply