Picture of tsn
Registered 5 years 50 days
tsn Sunday, 14 March 2021, 07:45 PM
Testing app UI
Hi guys,

Could you please clarify what is the best way to test app UI?
I'm currently need to deploy the changes each time I want to check something related to CSS or some JS changes which don't require a connection to app instance. Just want to make sure I didn't miss anything obvious which can help me test UI locally without uploading the whole app each time.

Best regards,
Sergey
Picture of Daniel Deterding (innovaphone)
Moderator Registered 15 years 236 days
Daniel Deterding (innovaphone) Monday, 15 March 2021, 07:27 AM
Re: Testing app UI
The only way to do this is to fake the answers of requests which are normally answered by the app service side inside your JS code manually and then open the htm file from your disk directly.

Your htm files include files from the SDK, e.g.:
<script src="web/lib1/..."

So you need to manually copy sdk/web1 into the folder where your htm files are located and rename web1 to web here.
Then your browser can find the local SDK files.

Of course you won't be able to test inside the myApps client framework (APIs) and with server side connection like this.

Greetings,
Daniel
Picture of tsn
Registered 5 years 50 days
tsn Monday, 15 March 2021, 12:34 PM
Re: Testing app UI
Hi Daniel,

Thank you for quick reply. Yes, I only want to be able to check UI part.

Do you have some working example for Counter App how I can fake responses?
Picture of Daniel Deterding (innovaphone)
Moderator Registered 15 years 236 days
Daniel Deterding (innovaphone) Monday, 15 March 2021, 12:59 PM
Re: Testing app UI
Sorry, there is no working example.

Basically you must fake calls of the update function, where you receive response messages (in the counter example).

Best way would be to write a separate controller object, which you can switch between live and test mode.
In test mode, the controller fakes responses e.g. by calling windows.setTimeout(function() {
update({"mt":"MsgResponse",...})
}, 1);

Like this you you'll get an async answer after 1ms.

So it is some work to get this running to be able to switch between online and offline usage of an app.

Greetings,
Daniel
← You can define your color theme preference here