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

[docs] Broken example for WebDriverIO #9203

Open
jLynx opened this issue Mar 16, 2024 · 6 comments
Open

[docs] Broken example for WebDriverIO #9203

jLynx opened this issue Mar 16, 2024 · 6 comments
Labels
type: documentation Need to update the API documentation

Comments

@jLynx
Copy link
Contributor

jLynx commented Mar 16, 2024

As suggested on Discord, I am opening an issue here. You can find relevant information about it on the original issue linked here chippers/hello_tauri#4

@petrvecera
Copy link

I also can't make the WDIO run at all 😞

@petrvecera
Copy link

I've got this working.

  1. Rollback to wdio v7
  2. Add webviewOptions to the config.

package.json

    "@wdio/cli": "^7",
    "@wdio/local-runner": "^7",
    "@wdio/mocha-framework": "^7",
    "@wdio/spec-reporter": "^7",

wdio.config.js

  capabilities: [
    {
      maxInstances: 1,
      'tauri:options': {
        application: './src-tauri/target/release/coh3-stats-desktop-app.exe',        
        webviewOptions: {},
      },
    },
  ],

Here is PR to my project cohstats/coh3-stats-desktop-app#85

@jLynx
Copy link
Contributor Author

jLynx commented Jun 5, 2024

Thanks @petrvecera Tried out your changes in the example project and got further, but running into this

C:\Users\{USER}\Documents\Code\NextJS\hello_tauri\target\debug\hello_tauri.exe

Execution of 1 workers started at 2024-06-05T22:10:57.462Z

2024-06-05T22:10:57.471Z INFO @wdio/cli:launcher: Run onPrepare hook
2024-06-05T22:10:57.523Z INFO @wdio/cli:launcher: Run onWorkerStart hook
2024-06-05T22:10:57.524Z INFO @wdio/local-runner: Start worker 0-0 with arg: run,wdio.conf.js
[0-0] 2024-06-05T22:10:57.913Z INFO @wdio/local-runner: Run worker command: run
[0-0] C:\Users\{USER}\Documents\Code\NextJS\hello_tauri\target\debug\hello_tauri.exe
[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\{USER}\Documents\Code\NextJS\hello_tauri\webdriver\webdriverio\test\specs\example.e2e.js
[0-0] 2024-06-05T22:10:58.038Z INFO webdriver: Initiate new session using the WebDriver protocol
[0-0] 2024-06-05T22:10:58.070Z INFO webdriver: [POST] http://localhost:4444/session
[0-0] 2024-06-05T22:10:58.070Z INFO webdriver: DATA {
[0-0]   capabilities: { alwaysMatch: { 'tauri:options': [Object] }, firstMatch: [ {} ] },
[0-0]   desiredCapabilities: {
[0-0]     'tauri:options': {
[0-0]       application: 'C:\\Users\\{USER}\\Documents\\Code\\NextJS\\hello_tauri\\target\\debug\\hello_tauri.exe',
[0-0]       webviewOptions: {}
[0-0]     }
[0-0]   }
[0-0] }
[19044:26144:0606/101058.201:ERROR:win_util.cc(1283)] failed to set WebView dpi awareness of 2: The operation completed successfully. (0x0)

DevTools listening on ws://127.0.0.1:55353/devtools/browser/94e9cf32-a7e7-472a-954a-cdba45848489
[19044:26144:0606/101058.266:ERROR:edge_auth_errors.cc(520)] EDGE_IDENTITY: Get Default OS Account failed: Error: Primary Error: kImplicitSignInFailure, Secondary Error: kAccountProviderFetchError, Platform error: 0, Error string:

[0-0] [1717625459.529][SEVERE]: bind() returned an error: Only one usage of each socket address (protocol/network address/port) is normally permitted. (0x2740)
[0-0] IPv6 port not available. Exiting...
[0-0] 2024-06-05T22:11:00.723Z WARN webdriver: Request failed with status 500 due to session not created: Microsoft Edge failed to start: crashed.
[0-0]   (chrome not reachable)
[0-0]   (The process started from msedge location C:\Users\{USER}\Documents\Code\NextJS\hello_tauri\target\debug\hello_tauri.exe is no longer running, so msedgedriver is assuming that msedge has crashed.)
[0-0] 2024-06-05T22:11:00.723Z INFO webdriver: Retrying 1/3
[0-0] 2024-06-05T22:11:00.723Z INFO webdriver: [POST] http://localhost:4444/session
[0-0] 2024-06-05T22:11:00.723Z INFO webdriver: DATA {
[0-0]   capabilities: { alwaysMatch: { 'tauri:options': [Object] }, firstMatch: [ {} ] },
[0-0]   desiredCapabilities: {
[0-0]     'tauri:options': {
[0-0]       application: 'C:\\Users\\{USER}\\Documents\\Code\\NextJS\\hello_tauri\\target\\debug\\hello_tauri.exe',
[0-0]       webviewOptions: {}
[0-0]     }
[0-0]   }
[0-0] }
[6236:20552:0606/101100.842:ERROR:win_util.cc(1283)] failed to set WebView dpi awareness of 2: The operation completed successfully. (0x0)

@jLynx
Copy link
Contributor Author

jLynx commented Jun 5, 2024

Scratch that, updated to driver 125 and it worked!
But only intermittently, sometimes it works. Other times it seems to crash

[25908:27028:0606/101607.173:ERROR:win_util.cc(1283)] failed to set WebView dpi awareness of 2: The operation completed successfully. (0x0)

DevTools listening on ws://127.0.0.1:55543/devtools/browser/486a7cc5-22f9-46f0-a006-d0b86cbdfb2f
[25908:27028:0606/101607.240:ERROR:edge_auth_errors.cc(520)] EDGE_IDENTITY: Get Default OS Account failed: Error: Primary Error: kImplicitSignInFailure, Secondary Error: kAccountProviderFetchError, Platform error: 0, Error string:

@jLynx
Copy link
Contributor Author

jLynx commented Jun 5, 2024

The issue seems to be that its not killing the driver process at the end

@bukowa
Copy link

bukowa commented Jun 26, 2024

The issue seems to be that its not killing the driver process at the end

Here's the pull request that fixes it #10108
You can get it directly from my forked crate https://crates.io/crates/tauri-driver-fork 0.1.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: documentation Need to update the API documentation
Projects
None yet
Development

No branches or pull requests

3 participants