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

disableCellular() failed with Invalid response: 400 The operation #2179

Open
creatorpiyush opened this issue Apr 18, 2024 · 2 comments
Open
Labels
docs Concerns doc comments, READMEs, or docs platform: ios iOS is affected

Comments

@creatorpiyush
Copy link

creatorpiyush commented Apr 18, 2024

Steps to reproduce

  1. Clone https://github.com/leancodepl/patrol.git
  2. Run iOS simulator(any)
  3. in patrol/dev/e2e_app run: patrol test --target=integration_test/service_cellular_test.dart --device="iPhone 15" --verbose

Actual results

disableCellular() and other services should work and not return 400

Logs

Logs
((passed) is true) failed - ══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞═════════════════
The following PatrolActionException was thrown running a test:
Patrol action failed: NativeAutomatorClientException:
disableCellular() failed with Invalid response: 400 The operation
couldn�t be completed. (patrol.PatrolError error 3.)

When the exception was thrown, this was the stack:
#0      NativeAutomator._wrapRequest (package:patrol/src/native/native_automator.dart:226:7)
<asynchronous suspension>
#1      main.<anonymous closure> (file:///Users/piyushanand/github_clones/patrol/dev/e2e_app/integration_test/service_cellular_test.dart:7:5)
<asynchronous suspension>
#2      patrolTest.<anonymous closure> (package:patrol/src/common.dart:134:7)
<asynchronous suspension>
#3      testWidgets.<anonymous closure>.<anonymous closure> (package:flutter_test/src/widget_tester.dart:168:15)
<asynchronous suspension>
#4      TestWidgetsFlutterBinding._runTestBody (package:flutter_test/src/binding.dart:1013:5)
<asynchronous suspension>
#5      TestWidgetsFlutterBinding._createTestCompletionHandler.<anonymous closure> (package:flutter_test/src/binding.dart:804:12)
<asynchronous suspension>

The test description was:
  disables and enables cellular twice
═════════════════════════════════════════════════════════════════

Patrol version

patrol: path: ../../packages/patrol (Master)
and also checked with patrol: 3.6.0

Patrol Doctor output

Patrol Doctor output
Patrol doctor:
Patrol CLI version: 2.7.0
Flutter command: flutter 
  Flutter 3.16.9 • channel [user-branch]
Android: 
• Program adb found in /Users/piyushanand/Library/Android/sdk/platform-tools/adb
• Env var $ANDROID_HOME set to /Users/piyushanand/Library/Android/sdk
iOS / macOS: 
• Program xcodebuild found in /usr/bin/xcodebuild
• Program ideviceinstaller found in /opt/homebrew/bin/ideviceinstaller

Flutter Doctor output

Flutter Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[!] Flutter (Channel [user-branch], 3.16.9, on macOS 14.4.1 23E224 darwin-arm64, locale en-IN)
    ! Flutter version 3.16.9 on channel [user-branch] at /Users/piyushanand/development/FlutterSDK/flutter
      Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
      If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install.
    ! Upstream repository unknown source is not a standard remote.
      Set environment variable "FLUTTER_GIT_URL" to unknown source to dismiss this error.
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.1)
[✓] VS Code (version 1.87.2)
[✓] Connected device (5 available)
    ! Error: Browsing on the local area network for Piyush’s iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area
      network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources
@piotruela
Copy link
Collaborator

I was able to reproduce the issue. As the device logs say:
PatrolServer: ERROR: Control Center is not available on Simulator.
So I'm afraid it's not possible to call this method for iOS Simulator. We should describe this limitation in NativeAutomator documentation.

@piotruela piotruela added docs Concerns doc comments, READMEs, or docs platform: ios iOS is affected labels Apr 29, 2024
@bartekpacia
Copy link
Contributor

#396

not related but worth to keep in mind

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Concerns doc comments, READMEs, or docs platform: ios iOS is affected
Projects
None yet
Development

No branches or pull requests

3 participants