Skip to content

Commit

Permalink
small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
shamanec committed Jul 24, 2023
1 parent 63601d9 commit 8aacebd
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import XCTest

extension XCUIApplication {

/// Tap the zero coordinate of the app, useful for closing keyboards or triggering UIApplicationMonitor
func tapZero() { coordinate(withNormalizedOffset: .zero).tap() }
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ extension XCUIElementQuery {
/// Check if the XCUIElementQuery has no elements
var isEmpty: Bool { count == 0 }

// MARK: Return element by predicate methods
// MARK: - Return element by predicate methods
/// Get element where the label exactly matches the provided string
func element(withLabelMatching text: String) -> XCUIElement {
return element(matching: NSPredicate(format: "label == %@", text))
Expand Down
4 changes: 2 additions & 2 deletions xcuitest-sample-projUITests/Foundations/BasePage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class BasePage {
self.setReflectionIdleHack(false)
}

// MARK: Utility methods
// MARK: - Utility methods
func keyboardVisible() -> Bool {
let startTime = NSDate().timeIntervalSince1970
while (NSDate().timeIntervalSince1970 - startTime) < TestConstants.Timeout.medium {
Expand Down Expand Up @@ -82,7 +82,7 @@ class BasePage {
app.buttons["OK"].tap()
}

func tabCancel() {
func tapCancel() {
app.buttons["Cancel"].tap()
}
}
3 changes: 2 additions & 1 deletion xcuitest-sample-projUITests/SampleAppUITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ final class SampleAppUITests: BaseTest {
let firstPage = FirstPage(app: getApp())
let text = firstPage.carouselItems.lastMatch.label
print("The label of the last matching element in the carousel is `\(text)`")
XCTAssertFalse(text == "Item 1")
}

func testElementDisappearsSameScreen() {
Expand All @@ -59,7 +60,7 @@ final class SampleAppUITests: BaseTest {
let elements = secondPage.loadingElements
// Wait for 10 seconds to have 5 elements, should pass
Elements.waitUntilTableFilled(elements, 5, TestConstants.Timeout.medium)
// Wait 5 more seconds to have 6 elements, should fail because only 5 in total will be loaded
// Should fail because only 5 in total will be loaded
Elements.waitUntilTableFilled(elements, 6, TestConstants.Timeout.short)
}

Expand Down

0 comments on commit 8aacebd

Please sign in to comment.