forked from flutter/plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[video_player] Add iOS unit and UI tests (flutter#3986)
- Loading branch information
Showing
10 changed files
with
400 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
273 changes: 250 additions & 23 deletions
273
packages/video_player/video_player/example/ios/Runner.xcodeproj/project.pbxproj
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...er/video_player/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
..._player/video_player/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>IDEDidComputeMac32BitWarning</key> | ||
<true/> | ||
</dict> | ||
</plist> |
22 changes: 22 additions & 0 deletions
22
packages/video_player/video_player/example/ios/RunnerTests/Info.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>$(DEVELOPMENT_LANGUAGE)</string> | ||
<key>CFBundleExecutable</key> | ||
<string>$(EXECUTABLE_NAME)</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundleName</key> | ||
<string>$(PRODUCT_NAME)</string> | ||
<key>CFBundlePackageType</key> | ||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>1.0</string> | ||
<key>CFBundleVersion</key> | ||
<string>1</string> | ||
</dict> | ||
</plist> |
18 changes: 18 additions & 0 deletions
18
packages/video_player/video_player/example/ios/RunnerTests/VideoPlayerTests.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
@import video_player; | ||
@import XCTest; | ||
|
||
@interface VideoPlayerTests : XCTestCase | ||
@end | ||
|
||
@implementation VideoPlayerTests | ||
|
||
- (void)testPlugin { | ||
FLTVideoPlayerPlugin* plugin = [[FLTVideoPlayerPlugin alloc] init]; | ||
XCTAssertNotNil(plugin); | ||
} | ||
|
||
@end |
22 changes: 22 additions & 0 deletions
22
packages/video_player/video_player/example/ios/RunnerUITests/Info.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>$(DEVELOPMENT_LANGUAGE)</string> | ||
<key>CFBundleExecutable</key> | ||
<string>$(EXECUTABLE_NAME)</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundleName</key> | ||
<string>$(PRODUCT_NAME)</string> | ||
<key>CFBundlePackageType</key> | ||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>1.0</string> | ||
<key>CFBundleVersion</key> | ||
<string>1</string> | ||
</dict> | ||
</plist> |
52 changes: 52 additions & 0 deletions
52
packages/video_player/video_player/example/ios/RunnerUITests/VideoPlayerUITests.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
@import os.log; | ||
@import XCTest; | ||
|
||
@interface VideoPlayerUITests : XCTestCase | ||
@property(nonatomic, strong) XCUIApplication* app; | ||
@end | ||
|
||
@implementation VideoPlayerUITests | ||
|
||
- (void)setUp { | ||
self.continueAfterFailure = NO; | ||
|
||
self.app = [[XCUIApplication alloc] init]; | ||
[self.app launch]; | ||
} | ||
|
||
- (void)testTabs { | ||
XCUIApplication* app = self.app; | ||
|
||
XCUIElement* remoteTab = [app.otherElements | ||
elementMatchingPredicate:[NSPredicate predicateWithFormat:@"selected == YES"]]; | ||
if (![remoteTab waitForExistenceWithTimeout:30.0]) { | ||
os_log_error(OS_LOG_DEFAULT, "%@", app.debugDescription); | ||
XCTFail(@"Failed due to not able to find selected Remote tab"); | ||
} | ||
XCTAssertTrue([remoteTab.label containsString:@"Remote"]); | ||
|
||
for (NSString* tabName in @[ @"Asset", @"List example" ]) { | ||
NSPredicate* predicate = [NSPredicate predicateWithFormat:@"label BEGINSWITH %@", tabName]; | ||
XCUIElement* unselectedTab = [app.staticTexts elementMatchingPredicate:predicate]; | ||
if (![unselectedTab waitForExistenceWithTimeout:30.0]) { | ||
os_log_error(OS_LOG_DEFAULT, "%@", app.debugDescription); | ||
XCTFail(@"Failed due to not able to find unselected %@ tab", tabName); | ||
} | ||
XCTAssertFalse(unselectedTab.isSelected); | ||
[unselectedTab tap]; | ||
|
||
XCUIElement* selectedTab = [app.otherElements | ||
elementMatchingPredicate:[NSPredicate predicateWithFormat:@"label BEGINSWITH %@", tabName]]; | ||
if (![selectedTab waitForExistenceWithTimeout:30.0]) { | ||
os_log_error(OS_LOG_DEFAULT, "%@", app.debugDescription); | ||
XCTFail(@"Failed due to not able to find selected %@ tab", tabName); | ||
} | ||
XCTAssertTrue(selectedTab.isSelected); | ||
} | ||
} | ||
|
||
@end |