generated from StanfordSpezi/SpeziTemplateApplication
-
-
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.
added protein tests and updated readme (#69)
# *Added protein tests, update README, clean failing beta test for previous PR* ## ♻️ Current situation & Problem - No protein tests, less code coverage - Previous PR failing for a UI test ## ⚙️ Release Notes - Added protein tests - Updated README with protein tracking documentation ## 📚 Documentation *Please ensure that you properly document any additions in conformance to [Spezi Documentation Guide](https://github.com/StanfordSpezi/.github/blob/main/DOCUMENTATIONGUIDE.md).* *You can use this section to describe your solution, but we encourage contributors to document your reasoning and changes using in-line documentation.* ## ✅ Testing *Please ensure that the PR meets the testing requirements set by CodeCov and that new functionality is appropriately tested.* *This section describes important information about the tests and why some elements might not be testable.* ## 📝 Code of Conduct & Contributing Guidelines By submitting creating this pull request, you agree to follow our [Code of Conduct](https://github.com/CS342/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/CS342/.github/blob/main/CONTRIBUTING.md): - [x] I agree to follow the [Code of Conduct](https://github.com/CS342/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/CS342/.github/blob/main/CONTRIBUTING.md). --------- Co-authored-by: Theo Kanell <[email protected]>
- Loading branch information
1 parent
92790a7
commit e1e36bf
Showing
3 changed files
with
92 additions
and
7 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
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,58 @@ | ||
// | ||
// ProBotTest.swift | ||
// StrongerUITests | ||
// | ||
// Created by Tulika Jha on 14/03/24. | ||
// | ||
// This source file is part of the Stronger based on the Stanford Spezi Template Application project | ||
// | ||
// SPDX-FileCopyrightText: 2023 Stanford University | ||
// | ||
// SPDX-License-Identifier: MIT | ||
// | ||
|
||
import XCTest | ||
|
||
|
||
class ProteinTests: XCTestCase { | ||
override func setUpWithError() throws { | ||
try super.setUpWithError() | ||
|
||
continueAfterFailure = false | ||
|
||
let app = XCUIApplication() | ||
app.launchArguments = ["--skipOnboarding"] | ||
app.launch() | ||
} | ||
|
||
|
||
func testProBotChatWindow() throws { | ||
let app = XCUIApplication() | ||
XCTAssertEqual(app.state, .runningForeground) | ||
|
||
XCTAssertTrue(app.tabBars["Tab Bar"].buttons["Food Tracking"].waitForExistence(timeout: 2)) | ||
app.tabBars["Tab Bar"].buttons["Food Tracking"].tap() | ||
|
||
XCTAssertTrue(app.buttons["Input with ChatBot"].waitForExistence(timeout: 2)) | ||
app.buttons["Input with ChatBot"].tap() | ||
|
||
XCTAssert(app.staticTexts["OpenAI API Key"].waitForExistence(timeout: 2)) | ||
XCTAssert(app.staticTexts["Pro-Bot"].waitForExistence(timeout: 2)) | ||
} | ||
|
||
func testImageRecognition() throws { | ||
let app = XCUIApplication() | ||
XCTAssertEqual(app.state, .runningForeground) | ||
|
||
XCTAssertTrue(app.tabBars["Tab Bar"].buttons["Food Tracking"].waitForExistence(timeout: 2)) | ||
app.tabBars["Tab Bar"].buttons["Food Tracking"].tap() | ||
|
||
XCTAssertTrue(app.buttons["Input with Camera"].waitForExistence(timeout: 2)) | ||
app.buttons["Input with Camera"].tap() | ||
|
||
XCTAssert(app.staticTexts["Food Image Classifier"].waitForExistence(timeout: 2)) | ||
|
||
app.buttons["Select or Take Picture"].waitForExistence(timeout: 2) | ||
app.buttons["Select or Take Picture"].tap() | ||
} | ||
} |