mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-08-07 20:10:08 +02:00
⚡️ Sped up and improved UI test
This commit is contained in:
30
tests/ui/UITestCase.swift
Normal file
30
tests/ui/UITestCase.swift
Normal file
@ -0,0 +1,30 @@
|
||||
//
|
||||
// UITestCase.swift
|
||||
// UI Tests
|
||||
//
|
||||
// Created by Nico Verbruggen on 15/10/2022.
|
||||
// Copyright © 2022 Nico Verbruggen. All rights reserved.
|
||||
//
|
||||
|
||||
import XCTest
|
||||
|
||||
class UITestCase: XCTestCase {
|
||||
|
||||
/** Checks if a single element exists. */
|
||||
public func assertExists(_ element: XCUIElement, _ timeout: TimeInterval = 0.05) {
|
||||
XCTAssert(element.waitForExistence(timeout: timeout))
|
||||
}
|
||||
|
||||
/** Checks if all elements exist. */
|
||||
public func assertAllExist(_ elements: [XCUIElement], _ timeout: TimeInterval = 0.05) {
|
||||
for element in elements {
|
||||
XCTAssert(element.waitForExistence(timeout: timeout))
|
||||
}
|
||||
}
|
||||
|
||||
/** Clicks on a given element. */
|
||||
public func click(_ element: XCUIElement) {
|
||||
element.click()
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user