Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

[google_maps_flutter] Add iOS unit and UI tests #3978

Merged
merged 1 commit into from
May 27, 2021

Conversation

jmagman
Copy link
Member

@jmagman jmagman commented May 25, 2021

Add RunnerTests XCTest and RunnerUITest XCUITest iOS targets to example app.

  • Add unit test that creates the plugin and asserts it's not nil, proving linking is set up correctly.
  • Add UI test that navigates around, checks for a maps platform view, and handles the location permission popup.

google_maps_flutter part of flutter/flutter#83357

Passing presubmit tests: https://cirrus-ci.com/task/6672684797919232

Test Case '-[GoogleMapsUITests testUserInterface]' passed (11.633 seconds).
Test Suite 'GoogleMapsUITests' passed at 2021-05-25 16:00:22.642.
	 Executed 1 test, with 0 failures (0 unexpected) in 11.633 (11.634) seconds
Test Suite 'RunnerUITests.xctest' passed at 2021-05-25 16:00:22.644.
	 Executed 1 test, with 0 failures (0 unexpected) in 11.633 (11.636) seconds
Test Suite 'All tests' passed at 2021-05-25 16:00:22.645.
	 Executed 1 test, with 0 failures (0 unexpected) in 11.633 (11.639) seconds
Test Case '-[GoogleMapsTests testPlugin]' passed (0.003 seconds).
Test Suite 'GoogleMapsTests' passed at 2021-05-25 16:00:05.826.
	 Executed 1 test, with 0 failures (0 unexpected) in 0.003 (0.004) seconds
Test Suite 'RunnerTests.xctest' passed at 2021-05-25 16:00:05.827.
	 Executed 1 test, with 0 failures (0 unexpected) in 0.003 (0.005) seconds
Test Suite 'All tests' passed at 2021-05-25 16:00:05.827.
	 Executed 1 test, with 0 failures (0 unexpected) in 0.003 (0.008) seconds

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides]. (Note that unlike the flutter/flutter repo, the flutter/plugins repo does use dart format. See plugin_tool format)
  • I signed the [CLA].
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the [pub versioning philosophy].
  • I updated CHANGELOG.md to add a description of the change.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test exempt.
  • All existing and new tests are passing.

Comment on lines +32 to +34
target 'RunnerTests' do
inherit! :search_paths
end
Copy link
Member Author

@jmagman jmagman May 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RunnerTests needs to link against Flutter and plugins. RunnerUITests do not since they interact with the UI blackbox.

}];
}

- (void)testUserInterface {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a smoke test to prove the UI test is set up correctly.


@implementation GoogleMapsTests

- (void)testPlugin {
Copy link
Member Author

@jmagman jmagman May 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smoke test to prove linking against the plugin works.

Copy link
Contributor

@stuartmorgan stuartmorgan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks! LGTM :)

@stuartmorgan stuartmorgan added the waiting for tree to go green (Use "autosubmit") This PR is approved and tested, but waiting for the tree to be green to land. label May 27, 2021
@fluttergithubbot fluttergithubbot merged commit df0361e into flutter:master May 27, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 27, 2021
@jmagman jmagman deleted the gmf-test branch May 27, 2021 18:52
yasargil added a commit to yasargil/plugins that referenced this pull request Jun 2, 2021
* master: (131 commits)
  [in_app_purchase] fix "autoConsume" param in "buyConsumable" (flutter#3957)
  [video_player_web] fix: set autoplay to false during initialization (flutter#3985)
  [multiple_web] Adapt web PlatformView widgets to work slotted. (flutter#3964)
  [url_launcher] Add iOS unit and UI tests (flutter#3987)
  [image_picker] Change storage location for camera captures to internal cache on Android, to comply with new Google Play storage requirements.  (flutter#3956)
  [script/tool] Use 'dart pub' instead of deprecated 'pub' (flutter#3991)
  [video_player] Add iOS unit and UI tests (flutter#3986)
  Add pubspec convention checks (flutter#3984)
  Enable pubspec dependency sorting lint (flutter#3983)
  [image_picker] Migrate maven repo from jcenter to mavenCentral (flutter#3915)
  [video_player] Update README.md (flutter#3975)
  [script/tool] speed up the pub get portion of the analyze command (flutter#3982)
  Revert commit e742a7b (flutter#3976)
  Added support to request list of purchases (flutter#3944)
  [google_maps_flutter] Add iOS unit and UI tests (flutter#3978)
  Added Windows to the description (flutter#3936)
  use 'flutter pub get' for both dart and flutter packages (flutter#3973)
  [camera] android-rework part 3: Android exposure related features (flutter#3797)
  Remove exoplayer workaround from everything but video_player (flutter#3980)
  Allow reverts when checking versions (flutter#3981)
  ...
fotiDim pushed a commit to fotiDim/plugins that referenced this pull request Sep 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes p: google_maps_flutter platform-ios waiting for tree to go green (Use "autosubmit") This PR is approved and tested, but waiting for the tree to be green to land.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants