openlang

Testing an entire wasm application with cargo?

This isn't necessarily specific to rust, although cargo makes testing convenient enough that I'd quite like to stick with it...

I'm taking a thoroughly tested desktop application and turning it into a wasm application. Once IO was moved higher in the call chain, very little code needed changing, so the library containing the code that makes up the wasm application remains thoroughly tested as a result.

The complete "app", though, includes additional pieces, with some html and a fair amount of JS. I'd like tests covering all of that (ideally across multiple browsers), but don't know where to start (especially with hooking it into cargo test). Presumably a web server has to be started... what comes next? A html form needs input, its submit button needs clicking, and a resulting download probably needs approving before its contents can be verified.

Could somebody suggest where I should start looking. Thanks beforehand!

The conversation continues 3

Follow the reasoning
  1. Permalink

    How wasm behaves depends on the browser. A test passing on Chrome might fail on Firefox. You'll therefore have to launch whichever browser you want to test (generally a headless version intended for this).

    UI test frameworks let you program actions like clicking, moving the mouse, or typing. Afterwards, check the resulting values or capture an image and compare individual pixels.

Other sides of the same question

  1. Making the sender appear as a label instead of an email address using Java Mail

    Im sending messages through the Java Mail API. On arrival, the inbox displays the address that sent the message. Id like some…

    Replies 2Latest activity java
  2. Dynamics CRM access from TypeScript

    Because my CRM code runs in a webresource, I have to write to retrieve the entity's data. Regrettably, that expression fails…

    Replies 2Latest activity typescript
  3. What date formatting does a Gleam HTTP response header need?

    I want to send a Date header. The required format looks like this: This is my current attempt:

    Replies 3Latest activity gleam