Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sophialee0416 committed Jan 13, 2023
2 parents 6107408 + 2482a73 commit 46d4470
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
'ios_device_build FluentUI-iOS Release build',
'ios_simulator_build Demo.Development Debug build',
'ios_simulator_build Demo.Development Release build',
'ios_simulator_build Demo.Development Debug build test -destination "platform=iOS Simulator,name=iPhone 14 Pro"',
'ios_device_build Demo.Development Debug build',
'ios_device_build Demo.Development Release build',
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO"
parallelizable = "YES">
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3A83F7BE295110FF00EF6629"
Expand Down
21 changes: 8 additions & 13 deletions ios/FluentUI.Demo/FluentUIDemoTests/BaseTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import XCTest

class BaseTest: XCTestCase {
let app = XCUIApplication()
let fluentUIDev: String = "FluentUI DEV"
// must be overridden
var controlName: String { "Base" }

Expand All @@ -16,18 +15,14 @@ class BaseTest: XCTestCase {
continueAfterFailure = false
app.launch()

let onHomePage: Bool = app.staticTexts[fluentUIDev].exists
let controlPage: XCUIElement = app.staticTexts[controlName]
let onDifferentControlPage: Bool = !onHomePage && !controlPage.exists
let backButton: XCUIElement = app.buttons[fluentUIDev].exists ? app.buttons[fluentUIDev] : app.buttons["Dismiss"]

if onHomePage {
XCTAssertTrue(!onDifferentControlPage)
controlPage.tap()
} else if onDifferentControlPage {
XCTAssertTrue(!onHomePage && !controlPage.exists)
backButton.tap()
controlPage.tap()
let onHomePage: Bool = app.staticTexts["FluentUI DEV"].exists
if !onHomePage {
if !app.navigationBars.element.exists {
app.buttons["Dismiss"].tap()
} else {
app.buttons.firstMatch.tap()
}
}
app.staticTexts[controlName].tap()
}
}

0 comments on commit 46d4470

Please sign in to comment.