Get help with testing, discuss unit testing strategies etc.


Post by anunnaki »

Hello anyone,

I'd like to test an application which contains any modules with its own extjs instance. There is a master application as container for seperate modules. The master application and most of the modules have its one ExtJS instance. At this time I find the elements about the dom structure without Siesta. Have I a possibility to use Siesta functionality to identify the elements?

Thank you for your help

anunnaki

Post by mats »

Not sure what you mean, Siesta can use ComponentQuery, CSS selectors, real DOM node references etc as the target for operations like 'click', 'type'. Is this what you mean? Did you try playing around with the Ext JS examples included in the Siesta SDK?

Post by anunnaki »

Hello, thank you for reply!

I have an application with to panels, like the left and the right panel in the attachment. In Both panels could be embedded modules with different ExtJS versions. Maybe in the left panel will used ExtJS 3.xx and in the right panel ExtJS 4.xx. The master panel where both modules panels are embedded use maybe ExtJs 4.1. The master panel is only used as container for the embedded modules. This modules could be any application. The don't need but can known each other.
If I try to find e.g. a button in the container panel I' take a the a code like this
t.query('div.x-panel',parent).
If I like to do the same for a module panel I always get back a Array with length=0.
To find the button I use at this time this code:
function getElementsByClass(searchClass, node) {
          if (node == null)
                        node = document;
                    var classElements = [],
                    els = node.getElementsByTagName("*"),
                    elsLen = els.length,
                    pattern = new RegExp("(^|\\s)" + searchClass + "(\\s|$)"), i, j;

                    for (i = 0, j = 0; i < elsLen; i++) {
                        if (pattern.test(els[i].className)) {
                            classElements[j] = els[i];
                            j++;
                        }
                    }
                    return classElements;
                }
But I'd like to use the same command as described above.
Yes I have looked in Siesta examples but have nothing found to hepl me.

Best Regards
anunnaki
Attachments
example.PNG
example.PNG (23.24 KiB) Viewed 3602 times

Post by mats »

I'm assuming you're using frames then for each such Module? This could get slightly tricky, and I'd highly recommend to test each module separately first - before trying to load multi-version Ext JS applications into a single test. Simplicity always wins IMHO.

Post by anunnaki »

Hallo,

Yes you have right. The modules are in different iframes. I can't test the modules separately. The modules are indeed discrete but they work together and I have to test the interaction of the modules (Integration Test). In one module I make settings and for the right behavior of an other module. No matter, so I have to use my own solution.It is indeed not so fashionable how it would be with siesta but it works.

Thank you for help and for your time.

Best regards
anunnaki

Post by mats »

So you're able to get things working to do the testing ok?

Post Reply