You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, im trying to e2e test my Tauri app and to start learning how to do it i call upon the documentation. Actually im on Windows 11, then i've done the following steps:
Checked my Edge browser version and downloaded the right msedgedriver.exe version, then included it in $PATH.
Installed the tauri-driver with the cargo install tauri-driver command.
Build and run the app with cargo run --release, for the first time.
Tried to run the tests in the webdriver/selenium directory, but received the following error:
I've tried to set the ms:edgeOptions capability to a empty object but i receive the same error, then i attempted to set the Microsoft Edge driver options with help of Selenium docs, but the same error again. Any clue how to solve this?
The test file:
constos=require("os");constpath=require("path");const{ expect }=require("chai");const{ spawn, spawnSync }=require("child_process");const{ Builder, By, Capabilities }=require("selenium-webdriver");// create the path to the expected application binaryconstapplication=path.resolve(__dirname,"..","..","..","target","release","hello_tauri");// keep track of the webdriver instance we createletdriver;// keep track of the tauri-driver process we startlettauriDriver;before(asyncfunction(){// set timeout to 2 minutes to allow the program to build if it needs tothis.timeout(120000)// ensure the program has been builtspawnSync("cargo",["build","--release"]);// start tauri-drivertauriDriver=spawn(path.resolve(os.homedir(),".cargo","bin","tauri-driver"),[],{stdio: [null,process.stdout,process.stderr]});constcapabilities=newCapabilities();capabilities.set("tauri:options",{ application });capabilities.setBrowserName("wry");// start the webdriver clientdriver=awaitnewBuilder().withCapabilities(capabilities).usingServer("http://localhost:4444/").build();});after(asyncfunction(){// stop the webdriver sessionawaitdriver.quit();// kill the tauri-driver processtauriDriver.kill();});describe("Hello Tauri",()=>{it("should be cordial",async()=>{consttext=awaitdriver.findElement(By.css("body > h1")).getText();expect(text).to.match(/^[hH]ello/);});it("should be excited",async()=>{consttext=awaitdriver.findElement(By.css("body > h1")).getText();expect(text).to.match(/!$/);});it("should be easy on the eyes",async()=>{// selenium returns color css values as rgb(r, g, b)consttext=awaitdriver.findElement(By.css("body")).getCssValue("background-color");constrgb=text.match(/^rgb\((?<r>\d+), (?<g>\d+), (?<b>\d+)\)$/).groups;expect(rgb).to.have.all.keys('r','g','b');constluma=0.2126*rgb.r+0.7152*rgb.g+0.0722*rgb.b;expect(luma).to.be.lessThan(100)});});
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello, im trying to e2e test my Tauri app and to start learning how to do it i call upon the documentation. Actually im on Windows 11, then i've done the following steps:
msedgedriver.exe
version, then included it in$PATH
.tauri-driver
with thecargo install tauri-driver
command.cargo run --release
, for the first time.webdriver/selenium
directory, but received the following error:I've tried to set the
ms:edgeOptions
capability to a empty object but i receive the same error, then i attempted to set the Microsoft Edge driver options with help of Selenium docs, but the same error again. Any clue how to solve this?The test file:
Beta Was this translation helpful? Give feedback.
All reactions