-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/add openurl example test #1
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
Merged
ctreffs
merged 9 commits into
ctreffs:master
from
limey:feature/add-openurl-example-test
Oct 29, 2021
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
dc81a09
Add deep link url scheme
limey 1839424
Add deep link path to ContentView
limey 95c35a4
Add open url ui test
limey 33374d0
Remove unnecessary associated-domains entitlement
limey 31027ec
Fix typo and clarify documentation
limey 239ef75
Accept open url dialog if displayed
limey 849712d
Bump SwiftSimctl dependency to 0.4
limey b7245ac
Re-record appearance test screenshots
ctreffs bbca6cb
Lint
ctreffs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
4 changes: 2 additions & 2 deletions
4
SwiftSimctlExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,50 @@ | ||
| // | ||
| // Example_03_OpenUrlTests.swift | ||
| // SwiftSimctlExampleUITests | ||
| // | ||
| // Created by Robert Clark on 21.10.21. | ||
| // Copyright © 2021 Christian Treffs. All rights reserved. | ||
| // | ||
|
|
||
| import Simctl | ||
| import XCTest | ||
|
|
||
| class Example_03_OpenUrlTests: XCTestCase { | ||
| func testOpenUrlWithRegisteredScheme() throws { | ||
| let app = XCUIApplication.exampleApp | ||
| app.launch() | ||
|
|
||
| let exp = expectation(description: "\(#function)") | ||
|
|
||
| let deepLinkUrl = URL(string: "swiftsimctlexample://myDeepLink/display")! | ||
|
|
||
| simctl.openUrl(deepLinkUrl) { result in | ||
| switch result { | ||
| case .success: | ||
| exp.fulfill() | ||
|
|
||
| case let .failure(error): | ||
| XCTFail("\(error)") | ||
| } | ||
| } | ||
|
|
||
| wait(for: [exp], timeout: 5.0) | ||
|
|
||
| // First installs on fresh simulators will prompt to open registered urls. | ||
| // UIInterruptionMonitor doesn't intercept this dialog (as of iOS 15 | ||
| // & Xcode 13) so we use Springboard to tap on the potential positive dialog | ||
| // button instead. | ||
| let openButton = XCUIApplication.springboard.buttons.element(boundBy: 1) | ||
| if openButton.waitForExistence(timeout: 2) { | ||
| openButton.tap() | ||
| } | ||
|
|
||
| let deepLinkPathLabel = app.staticTexts["myDeepLink/display"] | ||
| guard deepLinkPathLabel.waitForExistence(timeout: 5.0) else { | ||
| XCTFail("We did not find deep link path label") | ||
| return | ||
| } | ||
|
|
||
| XCTAssertEqual(deepLinkPathLabel.label, "myDeepLink/display") | ||
| } | ||
| } |
This file contains hidden or 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
Binary file modified
BIN
+7.53 KB
(120%)
...ots__/Example_02_ChangeAppearanceTests/testDifferentAppearancesFullscreen.1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+8.73 KB
(110%)
...ots__/Example_02_ChangeAppearanceTests/testDifferentAppearancesFullscreen.2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to
Shared.swiftfor convenience, plus it remains lazy as it's a global property.