-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix: add storage ui launch tests #1821
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
+214
−2
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8c9d122
fix: add storage ui launch tests
ncooke3 8a7ba75
rename
ncooke3 c77d87f
dont use sudo or -sdk
ncooke3 9d4701d
revert
ncooke3 9e1952a
storage fixes
ncooke3 04c761b
Merge branch 'main' into nc/strg-tests
ncooke3 68f8dc0
style
ncooke3 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
39 changes: 39 additions & 0 deletions
39
storage/StorageExample_iOS_UITests/StorageExampleUITests.swift
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,39 @@ | ||
| // Copyright 2025 Google LLC | ||
| // | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| import XCTest | ||
|
|
||
| final class StorageExample_iOS_UITests: XCTestCase { | ||
| override func setUpWithError() throws { | ||
| // Put setup code here. This method is called before the invocation of each test method in the class. | ||
|
|
||
| // In UI tests it is usually best to stop immediately when a failure occurs. | ||
| continueAfterFailure = false | ||
|
|
||
| // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. | ||
| } | ||
|
|
||
| override func tearDownWithError() throws { | ||
| // Put teardown code here. This method is called after the invocation of each test method in the class. | ||
| } | ||
|
Comment on lines
+27
to
+29
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| @MainActor | ||
| func testExample() throws { | ||
| // UI tests must launch the application that they test. | ||
| let app = XCUIApplication() | ||
| app.launch() | ||
|
|
||
| // Use XCTAssert and related functions to verify your tests produce the correct results. | ||
| } | ||
ncooke3 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
39 changes: 39 additions & 0 deletions
39
storage/StorageExample_iOS_UITests/StorageExampleUITestsLaunchTests.swift
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,39 @@ | ||
| // Copyright 2025 Google LLC | ||
| // | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| import XCTest | ||
|
|
||
| final class StorageExample_iOS_UITestsLaunchTests: XCTestCase { | ||
| override class var runsForEachTargetApplicationUIConfiguration: Bool { | ||
| true | ||
| } | ||
|
|
||
| override func setUpWithError() throws { | ||
| continueAfterFailure = false | ||
| } | ||
ncooke3 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| @MainActor | ||
| func testLaunch() throws { | ||
| let app = XCUIApplication() | ||
| app.launch() | ||
|
|
||
| // Insert steps here to perform after app launch but before taking a screenshot, | ||
| // such as logging into a test account or navigating somewhere in the app | ||
ncooke3 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| let attachment = XCTAttachment(screenshot: app.screenshot()) | ||
| attachment.name = "Launch Screen" | ||
| attachment.lifetime = .keepAlways | ||
| add(attachment) | ||
| } | ||
| } | ||
Oops, something went wrong.
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.
Boilerplate comments should be removed to improve readability. Also, it's required to call
super.setUpWithError()when overriding this method.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.
@ncooke3 I think you can just delete all the generated override stubs in this file.