mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-10-31 16:24:11 +00:00
26 lines
566 B
Swift
26 lines
566 B
Swift
//
|
|
// XCUElement.swift
|
|
// ElementX
|
|
//
|
|
// Created by Stefan Ceriu on 27/07/2022.
|
|
// Copyright © 2022 Element. All rights reserved.
|
|
//
|
|
|
|
import XCTest
|
|
|
|
extension XCUIElement {
|
|
func clearAndTypeText(_ text: String) {
|
|
guard let stringValue = value as? String else {
|
|
XCTFail("Tried to clear and type text into a non string value")
|
|
return
|
|
}
|
|
|
|
tap()
|
|
|
|
let deleteString = String(repeating: XCUIKeyboardKey.delete.rawValue, count: stringValue.count)
|
|
|
|
typeText(deleteString)
|
|
typeText(text)
|
|
}
|
|
}
|