31 lines
811 B
Swift
31 lines
811 B
Swift
//
|
|
// XCUIApplication.swift
|
|
// AutoCat2UITests
|
|
//
|
|
// Created by Selim Mustafaev on 06.04.2022.
|
|
//
|
|
|
|
import Foundation
|
|
import XCTest
|
|
|
|
extension XCUIApplication {
|
|
|
|
func auth(login: String, password: String) {
|
|
|
|
let loginButton = buttons["loginButton"]
|
|
guard loginButton.waitForExistence(timeout: 3) else {
|
|
XCTFail("Login button not found")
|
|
return
|
|
}
|
|
|
|
textFields["emailTextField"].tap()
|
|
textFields["emailTextField"].typeText(login)
|
|
secureTextFields["passwordTextField"].tap()
|
|
secureTextFields["passwordTextField"].typeText(password)
|
|
loginButton.tap()
|
|
|
|
let newButtonFound = buttons["NewCheckButton"].waitForExistence(timeout: 3)
|
|
XCTAssert(newButtonFound, "New button not found")
|
|
}
|
|
}
|