Setup Siesta with ExtJS 7 modern and CORS in Chrome
Posted: Thu Jan 21, 2021 10:54 am
by Clothia C
Hi,
I am trying to setup Siesta for my project.
Problem
I have to run the application on port 46000 because the service for the app is run on port 46001. How do I configure this?
I have to tell Chrome to use CORS, but how do I tell Siesta to use my new Chrome link?
Re: Setup Siesta with ExtJS 7 modern and CORS in Chrome
Posted: Thu Jan 21, 2021 11:49 am
by nickolay
Hello,
I have to tell Chrome to use CORS, but how do I tell Siesta to use my new Chrome link?
What does that mean exactly? Do you launch Chrome with certain command line arguments? If so, check the --browser-arg argument of the launcher (bin/webdriver --help)
Re: Setup Siesta with ExtJS 7 modern and CORS in Chrome
Posted: Thu Jan 21, 2021 11:55 am
by Clothia C
see my next post please
Re: Setup Siesta with ExtJS 7 modern and CORS in Chrome
Posted: Thu Jan 21, 2021 12:24 pm
by Clothia C
The problem now is that I can see that the webpage is loading, but Siesta throws the following exception:
Failed to access cross-origin page: https://localhost:56000/MyApp/index.html.
In general tests should reside on the same domain as the app itself,
but you can try to disable web security:
https://www.bryntum.com/blog/testing-x-domain-websites-with-siesta-in-chrome/
And it shows that 1 test failed, although I have 4 tests in the file:
t.diag("Sanity test, loading classes on demand and verifying they were indeed loaded.")
t.ok(Ext, 'ExtJS is here');
t.requireOk('MyApp.view.Viewport');
t.requireOk('MyApp.store.Language');
t.requireOk('MyApp.controller.CaseCreation');
Re: Setup Siesta with ExtJS 7 modern and CORS in Chrome
Posted: Thu Jan 21, 2021 12:31 pm
by nickolay
The problem now is that I can see that the webpage is loading, but Siesta throws the following exception:
Please describe your setup in more detailed way. So your project file is hosted on one port, but test page - on another? Can you host your project file on the same port as the test page?
And it shows that 1 test failed, although I have 4 tests in the file:
You probably mean assertions - the "test" term usually means a whole test file or t.it() section in it. Which one exactly is failing?
Re: Setup Siesta with ExtJS 7 modern and CORS in Chrome
Posted: Thu Jan 21, 2021 1:20 pm
by Clothia C
I cannot see which assertion is failing, as it seems not to start the assertions.
Result
I can see the siesta browser preview to run the webpage.
But I get the previous result.
My 010_sanity.t.js
describe('Sanity Test', t => {
t.it("Sanity", t => {
t.diag("Sanity test, loading classes on demand and verifying they were indeed loaded.")
t.ok(Ext, 'ExtJS is here');
t.requireOk('MyApp.view.Viewport');
t.requireOk('MyApp.store.Language');
t.requireOk('MyApp.controller.CaseCreation');
});
})
My siesta.js
const project = new Siesta.Project.Browser.ExtJS();
project.configure({
title: 'Basic browser test suite',
transparentEx: true,
autoCheckGlobals: true,
expectedGlobals : [
'Ext'
],
preload: []
});
project.start({
group: 'Application',
// need to set the `preload` to empty array - to avoid the double loading of dependencies
preload: [],
expectedGlobals: [
'MyApp',
'CKEDITOR',
'Fashion'
],
items: [
{
pageUrl: 'https://localhost:46000/MyApp/Client/index.html',
url : '010_sanity.t.js'
}
]
});