Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test web interface #1899

Open
mcspr opened this issue Sep 6, 2019 · 2 comments
Open

Test web interface #1899

mcspr opened this issue Sep 6, 2019 · 2 comments
Labels
enhancement New feature or request testing Find bugs before flashing web interface websockets

Comments

@mcspr
Copy link
Collaborator

mcspr commented Sep 6, 2019

Is your feature request related to a problem? Please describe.

Following #1898 , it would be useful to have a tests / test mode for WebUI

Describe the solution you'd like

https://gitter.im/tinkerman-cat/espurna?at=5d717445ae44a8412487f6c3
One of the options is to have a dummy web-server (node.js is a likely choice) that can WebUI page can interact with.
As an alternative, web page itself should have a special mode for running from file:/// (current check could be extended)

General test suite for .js code would also be useful.

Describe alternatives you've considered
-

Additional context
-

@mcspr mcspr added enhancement New feature or request testing Find bugs before flashing web interface websockets labels Sep 6, 2019
@Tofandel Tofandel mentioned this issue Oct 17, 2019
34 tasks
@tonilopezmr
Copy link
Contributor

Hi, I'm learning web development and using Cypress to make E2E testing using screenshot testing, and if we can mock the WebSocket using jest-websocket-mock commented here #1933 (comment), I think its a good way to go to create Web UI tests very easy.

@mcspr
Copy link
Collaborator Author

mcspr commented Oct 20, 2019

Cypress sells itself as a all-in-one thing, which sounds interesting.
However, if I properly understood how it works, in case of interactive stuff the only target browser is Chrome?
https://github.com/cypress-io/cypress/blob/dc251cc5d6c18da2be64ae3de269a00b75985099/packages/launcher/lib/browsers.ts#L6-L31

Re-quoting #1933 (comment), the point of mentioning local webserver was to possibly reuse some of the code in case Arduino & support libraries are mocked / redone to run on the host if that would be useful. And I think I also thought about a way to locally run the WebUI as-would-be on the device, without going about unhiding menus and panels manually.
fwiw the current webui's only entrypoint is the processData function (minus connectTo...), so local tests could already somehow work if something loads up index.html as document and feed data objects to it.

...and I would say I have not done as much progress on this as I would've liked to...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request testing Find bugs before flashing web interface websockets
Projects
None yet
Development

No branches or pull requests

2 participants