chippers / hello_tauri

Absolutely minimal example for a linux Tauri application.
Apache License 2.0
15 stars 5 forks source link

Broken example for WebDriverIO #4

Open jLynx opened 4 months ago

jLynx commented 4 months ago

Hi I have been following along with the example from https://tauri.app/v1/guides/testing/webdriver/example/webdriverio and I am able to run the application locally, but when it comes to running the WebDriverIO tests on Windows it failed. Here is my log

C:\Users\NAME\Documents\Code\NextJS\hello_tauri\webdriver\webdriverio>npm test

> webdriverio@1.0.0 test
> wdio run wdio.conf.js

Execution of 1 workers started at 2024-03-03T23:29:30.670Z

2024-03-03T23:29:30.680Z INFO @wdio/cli:launcher: Run onPrepare hook
2024-03-03T23:29:30.971Z INFO @wdio/cli:launcher: Run onWorkerStart hook
2024-03-03T23:29:30.972Z INFO @wdio/local-runner: Start worker 0-0 with arg: run,wdio.conf.js
[0-0] 2024-03-03T23:29:31.369Z INFO @wdio/local-runner: Run worker command: run
[0-0] Starting Microsoft Edge WebDriver 122.0.2365.66 (ab363614b8f04700fdbbc3d9d7f9deca8102a1c4) on port 4445
[0-0] To submit feedback, report a bug, or suggest new features, please visit https://github.com/MicrosoftEdge/EdgeWebDriver
[0-0]
[0-0] Only local connections are allowed.
[0-0] Please see https://aka.ms/WebDriverSecurity for suggestions on keeping Microsoft Edge WebDriver safe.
[0-0]
[0-0] RUNNING in undefined - C:\Users\NAME\Documents\Code\NextJS\hello_tauri\webdriver\webdriverio\test\specs\example.e2e.js
[0-0] 2024-03-03T23:29:31.492Z INFO webdriver: Initiate new session using the WebDriver protocol
[0-0] 2024-03-03T23:29:31.521Z INFO webdriver: [POST] http://localhost:4444/session
[0-0] 2024-03-03T23:29:31.521Z INFO webdriver: DATA {
[0-0]   capabilities: { alwaysMatch: { 'tauri:options': [Object] }, firstMatch: [ {} ] },
[0-0]   desiredCapabilities: {
[0-0]     'tauri:options': { application: '../../target/release/hello_tauri' }
[0-0]   }
[0-0] }
[0-0] 2024-03-03T23:29:31.546Z WARN webdriver: Request failed with status 400 due to invalid argument: cannot parse capability: ms:edgeOptions
[0-0] from invalid argument: cannot parse webviewOptions
[0-0] from invalid argument: must be a dictionary
[0-0] 2024-03-03T23:29:31.546Z INFO webdriver: Retrying 1/3
[0-0] 2024-03-03T23:29:31.546Z INFO webdriver: [POST] http://localhost:4444/session
[0-0] 2024-03-03T23:29:31.546Z INFO webdriver: DATA {
[0-0]   capabilities: { alwaysMatch: { 'tauri:options': [Object] }, firstMatch: [ {} ] },
[0-0]   desiredCapabilities: {
[0-0]     'tauri:options': { application: '../../target/release/hello_tauri' }
[0-0]   }
[0-0] }
[0-0] 2024-03-03T23:29:31.548Z WARN webdriver: Request failed with status 400 due to invalid argument: cannot parse capability: ms:edgeOptions
[0-0] from invalid argument: cannot parse webviewOptions
[0-0] from invalid argument: must be a dictionary
[0-0] 2024-03-03T23:29:31.549Z INFO webdriver: Retrying 2/3
[0-0] 2024-03-03T23:29:31.549Z INFO webdriver: [POST] http://localhost:4444/session
[0-0] 2024-03-03T23:29:31.549Z INFO webdriver: DATA {
[0-0]   capabilities: { alwaysMatch: { 'tauri:options': [Object] }, firstMatch: [ {} ] },
[0-0]   desiredCapabilities: {
[0-0]     'tauri:options': { application: '../../target/release/hello_tauri' }
[0-0]   }
[0-0] }
[0-0] 2024-03-03T23:29:31.550Z WARN webdriver: Request failed with status 400 due to invalid argument: cannot parse capability: ms:edgeOptions
[0-0] from invalid argument: cannot parse webviewOptions
[0-0] from invalid argument: must be a dictionary
[0-0] 2024-03-03T23:29:31.551Z INFO webdriver: Retrying 3/3
[0-0] 2024-03-03T23:29:31.551Z INFO webdriver: [POST] http://localhost:4444/session
[0-0] 2024-03-03T23:29:31.551Z INFO webdriver: DATA {
[0-0]   capabilities: { alwaysMatch: { 'tauri:options': [Object] }, firstMatch: [ {} ] },
[0-0]   desiredCapabilities: {
[0-0]     'tauri:options': { application: '../../target/release/hello_tauri' }
[0-0]   }
[0-0] }
[0-0] 2024-03-03T23:29:31.552Z ERROR webdriver: Request failed with status 400 due to invalid argument: invalid argument: cannot parse capability: ms:edgeOptions
[0-0] from invalid argument: cannot parse webviewOptions
[0-0] from invalid argument: must be a dictionary
[0-0] 2024-03-03T23:29:31.552Z ERROR webdriver:         GetHandleVerifier [0x00007FF6D06EB852+63538]
[0-0]   Microsoft::Applications::Events::ILogConfiguration::operator* [0x00007FF6D066F6D2+238290]
[0-0]   (No symbol) [0x00007FF6D04A3407]
[0-0]   (No symbol) [0x00007FF6D04CFDE1]
[0-0]   (No symbol) [0x00007FF6D04CA548]
[0-0]   (No symbol) [0x00007FF6D048EF50]
[0-0]   (No symbol) [0x00007FF6D04C87ED]
[0-0]   (No symbol) [0x00007FF6D04CA548]
[0-0]   (No symbol) [0x00007FF6D048EF50]
[0-0]   (No symbol) [0x00007FF6D04C51DF]
[0-0]   (No symbol) [0x00007FF6D0510F69]
[0-0]   (No symbol) [0x00007FF6D0510B83]
[0-0]   (No symbol) [0x00007FF6D0512251]
[0-0]   (No symbol) [0x00007FF6D0508A83]
[0-0]   (No symbol) [0x00007FF6D04DE55E]
[0-0]   (No symbol) [0x00007FF6D04DD71C]
[0-0]   (No symbol) [0x00007FF6D04DE111]
[0-0]   Microsoft::Applications::Events::EventProperty::to_string [0x00007FF6D08C1D3C+1102764]
[0-0]   (No symbol) [0x00007FF6D05525F6]
[0-0]   (No symbol) [0x00007FF6D05E3DAC]
[0-0]   (No symbol) [0x00007FF6D05DBDA8]
[0-0]   Microsoft::Applications::Events::EventProperty::to_string [0x00007FF6D08C0C85+1098485]
[0-0]   Microsoft::Applications::Events::ILogConfiguration::operator* [0x00007FF6D0679E91+281233]
[0-0]   Microsoft::Applications::Events::ILogConfiguration::operator* [0x00007FF6D0674614+258580]
[0-0]   Microsoft::Applications::Events::ILogConfiguration::operator* [0x00007FF6D067474F+258895]
[0-0]   Microsoft::Applications::Events::ILogConfiguration::operator* [0x00007FF6D0668F21+211745]
[0-0]   BaseThreadInitThunk [0x00007FFA5255257D+29]
[0-0]   RtlUserThreadStart [0x00007FFA53BEAA58+40]
[0-0]
[0-0] 2024-03-03T23:29:31.553Z ERROR @wdio/runner: Error: Failed to create session.
[0-0] invalid argument: cannot parse capability: ms:edgeOptions
[0-0] from invalid argument: cannot parse webviewOptions
[0-0] from invalid argument: must be a dictionary
[0-0]     at Object.startWebDriverSession (C:\Users\NAME\Documents\Code\NextJS\hello_tauri\webdriver\node_modules\webdriver\build\utils.js:68:15)
[0-0]     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[0-0]     at async WebDriver.newSession (C:\Users\NAME\Documents\Code\NextJS\hello_tauri\webdriver\node_modules\webdriver\build\index.js:58:45)
[0-0]     at async Object.remote (C:\Users\NAME\Documents\Code\NextJS\hello_tauri\webdriver\node_modules\@wdio\runner\node_modules\webdriverio\build\index.js:67:22)
[0-0]     at async Runner._startSession (C:\Users\NAME\Documents\Code\NextJS\hello_tauri\webdriver\node_modules\@wdio\runner\build\index.js:216:56)
[0-0]     at async Runner._initSession (C:\Users\NAME\Documents\Code\NextJS\hello_tauri\webdriver\node_modules\@wdio\runner\build\index.js:172:25)
[0-0]     at async Runner.run (C:\Users\NAME\Documents\Code\NextJS\hello_tauri\webdriver\node_modules\@wdio\runner\build\index.js:87:19)
[0-0] FAILED in undefined - C:\Users\NAME\Documents\Code\NextJS\hello_tauri\webdriver\webdriverio\test\specs\example.e2e.js
2024-03-03T23:29:31.684Z INFO @wdio/cli:launcher: Run onComplete hook

Spec Files:      0 passed, 1 failed, 1 total (100% completed) in 00:00:01

2024-03-03T23:29:31.685Z INFO @wdio/local-runner: Shutting down spawned worker
2024-03-03T23:29:31.939Z INFO @wdio/local-runner: Waiting for 0 to shut down gracefully
2024-03-03T23:29:31.940Z INFO @wdio/local-runner: shutting down
npm ERR! Lifecycle script `test` failed with error:
npm ERR! Error: command failed
npm ERR!   in workspace: webdriverio@1.0.0
npm ERR!   at location: C:\Users\NAME\Documents\Code\NextJS\hello_tauri\webdriver\webdriverio

It seems like the main issue is this line here: Request failed with status 400 due to invalid argument: cannot parse capability: ms:edgeOptions

I am running Edge web driver 122.0.2365.66 x64 for Windows.

My package.json looks like this:

{
  "name": "webdriverio",
  "version": "1.0.0",
  "license": "Apache-2.0",
  "private": true,
  "scripts": {
    "test": "wdio run wdio.conf.js",
    "format": "prettier --write \"./**/*.js\""
  },
  "devDependencies": {
    "@wdio/local-runner": "^7.7.3",
    "@wdio/mocha-framework": "^7.7.3",
    "@wdio/spec-reporter": "^7.7.3"
  }
}

Has anyone got this working in 2024?

zC4sTr0 commented 3 weeks ago

Hello. Do you still have the issue?

I successfully did it with selenium and edge web driver, if you want help

jLynx commented 3 weeks ago

@zC4sTr0 Yes please, if you could post an example project or the related files so I could get up and running, that would be amazing

zC4sTr0 commented 3 weeks ago

@zC4sTr0 Yes please, if you could post an example project or the related files so I could get up and running, that would be amazing

Can you please create a topic at discussions in tauri? (https://github.com/tauri-apps/tauri/discussions) This way, other people can know the answer and I can create a PR to change docs and use the discussion as evidence that it is needed. We can discuss there until we have a working output from your side.

If you manage to do in next few hours we will discuss it almost in real time.. Thank you.

jLynx commented 3 weeks ago

I think posting here instead of in a discussion is fine since it's a bug with the repo as it doesn't work out of the box in its current state