Page 1 of 1

ExtJS Test loading app.js throws error

Posted: Mon Jan 25, 2021 10:54 am
by Clothia C

I am loading the ext-all.js and the app.js and I am getting the following error. What do I have to change?

Test threw an exception
TypeError: Cannot read property 'dom' of null
at https://localhost:46000/build/production/MyApp/mobile/app.js:1:1070188
at Object.Scope.Provider.Window[setupWithDocWrite] (https://localhost:46000/MyApp/Client/testing_siesta/siesta-all.js:9:77612)
at Object.internal wrapper [as setupWithDocWrite] (https://localhost:46000/MyApp/Client/testing_siesta/siesta-all.js:9:12255)
at Object.Scope.Provider.Window[setup] (https://localhost:46000/MyApp/Client/testing_siesta/siesta-all.js:9:76847)
at Object.internal wrapper [as setup] (https://localhost:46000/MyApp/Client/testing_siesta/siesta-all.js:9:12255)
at cont (https://localhost:46000/MyApp/Client/testing_siesta/siesta-all.js:9:234162)
at https://localhost:46000/MyApp/Client/testing_siesta/siesta-all.js:9:233994
at Object.Siesta.Test.Browser[earlySetup] (https://localhost:46000/MyApp/Client/testing_siesta/siesta-all.js:9:588186)
at Object.internal wrapper [as earlySetup] (https://localhost:46000/MyApp/Client/testing_siesta/siesta-all.js:9:12255)
at Object.Siesta.Project[processURL] (https://localhost:46000/MyApp/Client/testing_siesta/siesta-all.js:9:233972)

siesta.js plan

{
    group: 'Functional Testing',
   preload: [
        '../../../packages/ext/frameworks/7.2.0/build/ext-all.js',
        '../../../build/production/MyApp/mobile/app.js'
    ],
   items: [{
        group: 'App.utility',
        items: ['Functional/App_utility/App_110_LocaleProvider.t.js']
    }]
}

Re: ExtJS Test loading app.js throws error

Posted: Mon Jan 25, 2021 11:26 am
by nickolay

Hard to say anything, the error happens during loading of "app.js". Try loading non-minified sources and see what is the cause of exception?


Re: ExtJS Test loading app.js throws error

Posted: Mon Jan 25, 2021 12:27 pm
by Clothia C

I switched to smaller pieces, using LoaderPath. But still getting errors.

I am trying to test a package 'MyPac.utility.Config', which is located in packages.local.util_config.src.util.Config.js. The requires usually is 'MyPac.utility.Config'. How to add this to the LoaderPath.
Here is my try:

{
    group: 'Functional Testing',
    preload: [
        '../../../packages/ext/frameworks/7.2.0/build/ext-all.js'
    ],

items: [{
    loaderPath  : {
        'MyPac.utility.Config' : '../../../packages/local/util-config/'
    },

    group: 'MyPac.utility',
    items: ['Functional/MyPac_utility/MyPac_110_LocaleProvider.t.js']
}]
}

Ext.create('MyPac.utility.Config'); ==>

VM185552:3 Uncaught TypeError: c is not a constructor
    at eval (eval at getInstantiator (ext-all.js:20), <anonymous>:3:8)
    at Object.create (ext-all.js:20)
    at eval (eval at <anonymous> (MyPac_110_LocaleProvider.t.js:3), <anonymous>:1:5)
    at MyPac_110_LocaleProvider.t.js:3
    at f.Siesta.Test[launch] (siesta-all.js:9)
    at f.internal wrapper [as launch] (siesta-all.js:9)
    at f.originalCall (siesta-all.js:9)
    at f.SUPERARG (siesta-all.js:9)
    at f.Siesta.Test.Browser[launch] (siesta-all.js:9)
    at f.internal wrapper (siesta-all.js:9)
eval @ VM185552:3
create @ ext-all.js:20
eval @ VM191665:1
(anonymous) @ MyPac_110_LocaleProvider.t.js:3
Siesta.Test[launch] @ siesta-all.js:9
internal wrapper @ siesta-all.js:9
originalCall @ siesta-all.js:9
SUPERARG @ siesta-all.js:9
Siesta.Test.Browser[launch] @ siesta-all.js:9
internal wrapper @ siesta-all.js:9
Siesta.Test.Browser[override launch] @ siesta-all.js:9
internal wrapper @ siesta-all.js:9
Siesta.Test[doStart] @ siesta-all.js:9
internal wrapper @ siesta-all.js:9
originalCall @ siesta-all.js:9
SUPERARG @ siesta-all.js:9
Siesta.Test.SenchaTouch[doStart] @ siesta-all.js:9
internal wrapper @ siesta-all.js:9
Siesta.Test[start] @ siesta-all.js:9
internal wrapper @ siesta-all.js:9
Siesta.Test[launchSubTest] @ siesta-all.js:9
internal wrapper @ siesta-all.js:9
processor @ siesta-all.js:9
Siesta.Util.Queue[doOneStep] @ siesta-all.js:9
internal wrapper @ siesta-all.js:9
Siesta.Util.Queue[doSteps] @ siesta-all.js:9
internal wrapper @ siesta-all.js:9
Siesta.Util.Queue[run] @ siesta-all.js:9
internal wrapper @ siesta-all.js:9
Siesta.Test[chain] @ siesta-all.js:9
internal wrapper @ siesta-all.js:9
Siesta.Test[chainForArray] @ siesta-all.js:9
internal wrapper @ siesta-all.js:9
Siesta.Test[launchSpecs] @ siesta-all.js:9
internal wrapper @ siesta-all.js:9
Siesta.Test[override afterLaunch] @ siesta-all.js:9
internal wrapper @ siesta-all.js:9
Siesta.Test[launch] @ siesta-all.js:9
internal wrapper @ siesta-all.js:9
originalCall @ siesta-all.js:9
SUPERARG @ siesta-all.js:9
Siesta.Test.Browser[launch] @ siesta-all.js:9
internal wrapper @ siesta-all.js:9
Siesta.Test.Browser[override launch] @ siesta-all.js:9
internal wrapper @ siesta-all.js:9
(anonymous) @ siesta-all.js:9
Siesta.Test[setup] @ siesta-all.js:9
internal wrapper @ siesta-all.js:9
cont @ siesta-all.js:9
Siesta.Test[doStart] @ siesta-all.js:9
internal wrapper @ siesta-all.js:9
originalCall @ siesta-all.js:9
SUPERARG @ siesta-all.js:9
Siesta.Test.SenchaTouch[doStart] @ siesta-all.js:9
internal wrapper @ siesta-all.js:9
Siesta.Test[start] @ siesta-all.js:9
internal wrapper @ siesta-all.js:9
doLaunch @ siesta-all.js:9
setTimeout (async)
Siesta.Project[launchTest] @ siesta-all.js:9
internal wrapper @ siesta-all.js:9
originalCall @ siesta-all.js:9
SUPERARG @ siesta-all.js:9
Siesta.Project.Browser[override launchTest] @ siesta-all.js:9
internal wrapper @ siesta-all.js:9
(anonymous) @ siesta-all.js:9
cont @ siesta-all.js:9
cont @ siesta-all.js:9
parentWindow.Scope.Provider.__ONLOAD__.<computed> @ siesta-all.js:9
(anonymous) @ siesta.html:1
setTimeout (async)
onload @ siesta.html:1
Show 28 more frames

Re: ExtJS Test loading app.js throws error

Posted: Mon Jan 25, 2021 12:29 pm
by nickolay

Hard to conclude anything based on the provided info. Any chance you can provide a reproducible test case?


Re: ExtJS Test loading app.js throws error

Posted: Mon Jan 25, 2021 2:36 pm
by Clothia C

I found the problem:
I have several packages belonging to the same NameSpace MyPack.

loadPath : {
    MyPack: '../packages/local/mypacA',
    MyPack: '../packages/local/mypacB'
}

...does not work, but I do have the same namespace in both packages. How can I make Siesta recognize this?


Re: ExtJS Test loading app.js throws error

Posted: Mon Jan 25, 2021 2:41 pm
by nickolay

The loaderPath config is translated to the Ext.Loader.setPath(loaderPath) call. If that won't help, you'll probably have to set the loader path manually, in the beginning of the test. This can be extracted to separate preload as well.


Re: ExtJS Test loading app.js throws error

Posted: Mon Jan 25, 2021 2:51 pm
by Clothia C

Awesome.
In my application I called:

    Ext.ClassManager.paths

From there I copied all package paths and added them to loaderPath, added some additional ../ and it works.

Thanks a lot.


Re: ExtJS Test loading app.js throws error

Posted: Tue Jan 26, 2021 1:23 pm
by nickolay

Glad it works!