1

嗨,我在使用 geckodriver 运行颤振驱动器时遇到问题(我的带有 M1 的 sys macos)我正在使用的命令:

flutter drive \
  --driver=test_driver/integration_test.dart \
  --target=integration_test/app_test.dart \
  -d web-server --browser-name=firefox

我的配置是按照此处的说明创建的: https ://flutter.dev/docs/testing/integration-tests

当我尝试使用 --no-headless 时,我看到 Firefox 正在运行并转到测试应用程序 URL,然后会话结束。

这就是我在日志中的内容:

USER@USER flutter-test-framework % flutter drive \
  --driver=test_driver/integration_test.dart \
  --target=integration_test/app_test.dart \
  -d web-server --browser-name=firefox             
Running "flutter pub get" in flutter-test-framework...           1 097ms
Launching integration_test/app_test.dart on Web Server in debug mode...
Waiting for connection from debug service on Web Server...         16,1s
integration_test/app_test.dart is being served at http://localhost:52114
The web-server device requires the Dart Debug Chrome extension for debugging. Consider using the Chrome or Edge devices for an improved development workflow.
Application finished.
Unhandled exception:
WebDriverException (405): Error parsing response body: HTTP method not allowed
#0      parseW3cResponse (package:webdriver/src/handler/w3c/utils.dart:19:5)
#1      W3cLogsHandler.parseGetLogsResponse (package:webdriver/src/handler/w3c_handler.dart:82:8)
#2      AsyncRequestClient.send (package:webdriver/src/common/request_client.dart:96:32)
<asynchronous suspension>
#3      Logs.get (package:webdriver/src/async/logs.dart:30:23)
<asynchronous suspension>
#4      new FlutterWebConnection.<anonymous closure> (package:flutter_driver/src/driver/web_driver.dart)
<asynchronous suspension>

来自 geckodriver 的日志:

1629444579808   Marionette      DEBUG   Marionette stopped listening
1629444579809   Marionette      DEBUG   0 <- [1,111,null,{"cause":"shutdown","forced":false}]
1629444579817   webdriver::server       DEBUG   Deleting session
JavaScript error: resource:///modules/Interactions.jsm, line 209: NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIUserIdleService.removeIdleObserver]
1629444579821   Marionette      DEBUG   0 -> [0,112,"Marionette:Quit",{"flags":["eForceQuit"]}]
1629444579821   Marionette      DEBUG   0 <- [1,112,{"error":"invalid session id","message":"WebDriver session does not exist, or is not active","stacktrace":"WebDriverEr ... ote/content/marionette/server.js:253:9\n_onJSONObjectReady/<@chrome://remote/content/marionette/transport.js:500:20\n"},null]
1629444579824   Marionette      DEBUG   Closed connection 0
1629444580028   geckodriver::marionette DEBUG   Browser process stopped: exit code: 0
1629444580052   webdriver::server       DEBUG   <- 200 OK {"value":null}

来自 geckodriver 的附加日志

1629717588412   webdriver::server       DEBUG   -> POST /session/f64f7d41-45ff-fe42-9759-9820c4b8f5dc/execute/sync {"script":"window.$flutterDriver('{\"command\":\"request_data\",\"timeout\":\"60000\"}')","args":[]}
1629717588413   Marionette      DEBUG   0 -> [0,26,"WebDriver:ExecuteScript",{"args":[],"script":"window.$flutterDriver('{\"command\":\"request_data\",\"timeout\":\"60000\"}')"}]
1629717588464   Marionette      DEBUG   0 <- [1,26,null,{"value":null}]
1629717588464   webdriver::server       DEBUG   <- 200 OK {"value":null}
1629717588467   webdriver::server       DEBUG   -> POST /session/f64f7d41-45ff-fe42-9759-9820c4b8f5dc/execute/sync {"script":"return $flutterDriverResult","args":[]}
1629717588467   Marionette      DEBUG   0 -> [0,27,"WebDriver:ExecuteScript",{"args":[],"script":"return $flutterDriverResult"}]
1629717588470   Marionette      DEBUG   0 <- [1,27,{"error":"javascript error","message":"ReferenceError: $flutterDriverResult is not defined","stacktrace":"@http://localhost:61904/:2:7\n@http://localhost:61904/:3:8\n"},null]
1629717588470   webdriver::server       DEBUG   <- 500 Internal Server Error {"value":{"error":"javascript error","message":"ReferenceError: $flutterDriverResult is not defined","stacktrace":"@http://localhost:61904/:2:7\n@http://localhost:61904/:3:8\n"}}
1629717588552   webdriver::server       DEBUG   -> DELETE /session/f64f7d41-45ff-fe42-9759-9820c4b8f5dc 
1629717588552   Marionette      DEBUG   0 -> [0,28,"Marionette:Quit",{"flags":["eForceQuit"]}]
1629717588553   Marionette      INFO    Stopped listening on port 61910

当然一切都在chromedriver上正常工作

4

0 回答 0