1
0
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:
2022-10-15 16:37:33 +02:00
parent cb3208c008
commit 273070ef27
4 changed files with 91 additions and 45 deletions

30
tests/ui/UITestCase.swift Normal file
View 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()
}
}