Urgent.News

What's breaking now, across thousands of outlets.

Tech

How to Test a Tauri App End-to-End (No WebDriver Needed)

The above below running against Yaak, sped up with idle time removed. Click for the full replay. You can test a Tauri app end-to-end without WebDriver by describing each step in plain language. TestDriver matches each description against screenshots of the installed app, so: you test the same .deb your users install, with nothing compiled into it you don't write or maintain selectors your test…

To conduct end-to-end testing of a Tauri application without the need for a WebDriver, you can utilize a tool called TestDriver. TestDriver allows you to describe each step of the testing process in simple language, which it then matches against screenshots of the installed application. This approach has several advantages:

1. You are testing the exact .deb package that your users will install, without any additional compilation or custom code.

2. You do not need to write or maintain any selectors, as TestDriver reads like a set of instructions you would give to a teammate.

3. The test is easier to understand and maintain, as it reads like a series of steps a user would perform.

The example provided in the source code demonstrates how to install Yaak, an open-source API client built with Tauri, send a request, and check the response. The full project is available on GitHub at testdriverai/example-tauri-app.

One of the main reasons to avoid using WebDriver is that Tauri's testing documentation recommends using WebdriverIO's @wdio/tauri-service, which requires the tauri-plugin-wdio-webdriver to be compiled into your app. This is not the case with TestDriver, which does not require any additional compilation or dependencies.

TestDriver describes elements in the same way a user would see them on the screen. For example, instead of using a WebDriver-style selector like `await $( [aria-label= Send request ] ).click();`, TestDriver uses a description such as `await testdriver . find ( Send button (paper airplane icon) at the right end of the URL bar ).click();`. This approach ensures that the test remains stable even if the markup of the application changes.

The example code shows how to use TestDriver to download and install the .deb file, install the necessary Tauri runtime dependencies, and start the Yaak application. It then describes each step of the testing process, such as finding specific buttons or inputs, entering data, and asserting that the expected results are displayed on the screen.

By using TestDriver for end-to-end testing of Tauri applications, you can achieve a stable, maintainable, and user-friendly testing process without the need for a WebDriver. The documentation provides a detailed example and guides for using TestDriver effectively in your Tauri projects.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Apparently, Bland 2D Grey Squares Are Important to My 3D Renderer

A furnace render: an albedo-1 sphere inside a uniform environment of radiance 0.5. There’s a sphere in that picture. Can you see it? No, you can’t.

  • The furnace test reveals a flat grey sphere due to consistent light reflection.
  • Camera rays either miss or hit the albedo-1 sphere, both resulting in L radiance.
  • Julien Guertault's White Furnace Test demonstrates energy loss in darker spheres.

How GPS taught my car-sickness app which way is down

I'm the developer of Perusa, a small Android app I build on my own. It puts dots along the edges of the screen that follow the car's real braking and turns, on top of whatever you're reading, for…

  • Perusa app uses GPS data to determine down direction
  • GPS lag and holder angle accounted for in corrections
  • App reduced cue error and phantom-motion time significantly

AI Voice in Portuguese in your app: ElevenLabs and Murf in 15 lines of Python

Seu app, bot ou automação precisa falar português do Brasil ? Dá pra fazer com duas chamadas HTTP. Abaixo, o mínimo funcional com a API da ElevenLabs e a da Murf , mais quanto isso custa em reais.

  • Use two HTTP calls to ElevenLabs and Murf APIs for Portuguese Brazilian voice in app or automation.
  • Only four lines of Python code needed to deploy the solution.
  • Test voice quality with real numbers, dates, and proper names.

More from Thursday 22 October →