Including the same test file multiple times

Get help with testing, discuss unit testing strategies etc.
Post Reply
User avatar
klodoma
Posts: 33
Joined: Thu Oct 01, 2015 11:55 am

Including the same test file multiple times

Post by klodoma » Mon Jun 10, 2019 5:33 pm

Hi, continuing my evaluation, I hit a potential issue.

I have the following use-case: I want to execute the same test-file on different builds (for example: extjs classic and modern). The test-code is the same for both cases. I am doing this to avoid code duplication. As you see in the config the hostPageUrl is different, but source test files are the same.

See this config:
Screenshot_370.png
Screenshot_370.png (46.13 KiB) Viewed 74 times
Problem 1:
In front-end the 2 files are displayed either in classic or modern tree but not in both. If you expand the KeyPad node you will see the files and they will disappear in the other node. See screenshots.
Screenshot_371.png
Screenshot_371.png (34.58 KiB) Viewed 74 times
Screenshot_372.png
Screenshot_372.png (43.86 KiB) Viewed 74 times

Problem 2:

If I try to execute the tests with webdriver I get the error that the files are already processed:

Code: Select all

[PASS]  src/view/keypad/KeyPadAmount.t.js
[PASS]  src/view/keypad/KeyPadNumber.t.js
Caught unhandled rejection:  Error: Element already processedsrc/view/keypad/KeyPadAmount.t.js
    at Object.endProgress (C:\devkit\Siesta\siesta-5.2.3-trial\bin\siesta-launcher-all.js:239:513)
    at Object.b [as endProgress] (C:\devkit\Siesta\siesta-5.2.3-trial\bin\siesta-launcher-all.js:27:357)
    at Object.consumeTestResult (C:\devkit\Siesta\siesta-5.2.3-trial\bin\siesta-launcher-all.js:284:449)
Any idea how to solve such a situation without duplicating the test files?

User avatar
mats
Core Developer
Core Developer
Posts: 14131
Joined: Sat Dec 19, 2009 11:41 pm
Location: Sweden
Contact:

Re: Including the same test file multiple times

Post by mats » Mon Jun 10, 2019 5:44 pm

Yes, this is a known limitation. We just append query string ourselves to make id unique (?foo=1) etc. Please try this!
Tired of debugging javascript errors in web applications? Try our new error logging service RootCause, or read more on the Sencha blog

@bryntum
Facebook
API documentation

User avatar
klodoma
Posts: 33
Joined: Thu Oct 01, 2015 11:55 am

Re: Including the same test file multiple times

Post by klodoma » Thu Jun 13, 2019 7:35 am

mats wrote:
Mon Jun 10, 2019 5:44 pm
We just append query string ourselves to make id unique (?foo=1) etc.
Yes, this does the trick! Thanks!

Post Reply