TouchEvents with SenchaTouch 2.4.1

Get help with testing, discuss unit testing strategies etc.
Post Reply
User avatar
Enzoo
Posts: 6
Joined: Wed Sep 18, 2019 8:23 am

TouchEvents with SenchaTouch 2.4.1

Post by Enzoo » Fri Sep 20, 2019 4:54 am

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.

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

Re: TouchEvents with SenchaTouch 2.4.1

Post by nickolay » Fri Sep 20, 2019 10:20 am

Hi,

Weird, it works for me with SenchaTouch 2.4.2 too. Yes, please use https://dropmefiles.com to upload the test case.
We offer training in both Ext JS and our products, read more here.
Read the API documentation

User avatar
Enzoo
Posts: 6
Joined: Wed Sep 18, 2019 8:23 am

Re: TouchEvents with SenchaTouch 2.4.1

Post by Enzoo » Mon Sep 23, 2019 12:38 am

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.

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

Re: TouchEvents with SenchaTouch 2.4.1

Post by nickolay » Mon Sep 23, 2019 11:51 am

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

Code: Select all

		    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:

Code: Select all

                {
                    action: 'tap',
                    target: () => btn
                },
However, the best would be just:

Code: Select all

                {
                    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":

Code: Select all

return comp.getEl ? comp.getEl() : locateInputEl && comp.input || comp.el || comp.element;
to

Code: Select all

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.
We offer training in both Ext JS and our products, read more here.
Read the API documentation

User avatar
Enzoo
Posts: 6
Joined: Wed Sep 18, 2019 8:23 am

Re: TouchEvents with SenchaTouch 2.4.1

Post by Enzoo » Tue Sep 24, 2019 7:46 am

Thanks, this helped a lot.

Post Reply