Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Todorant UI test
//
// TodorantUITests.swift
// TodorantUITests
//
// Created by Nikita Kolmogorov on 2020-03-21.
// Copyright © 2020 Facebook. All rights reserved.
//
import XCTest
class TodorantUITests: XCTestCase {
override func setUp() {
super.setUp()
let app = XCUIApplication()
app.launchEnvironment = ProcessInfo.processInfo.environment
setupSnapshot(app, waitForAnimations: true)
app.launch()
}
func testScreenshots() {
let app = XCUIApplication()
sleep(20)
if deviceLanguage == "ru" {
app.buttons["Настройки, tab, 3 of 3"].tap()
sleep(2)
app.otherElements["delete"].tap()
sleep(2)
app.otherElements["add_ru"].tap()
sleep(8)
app.buttons["Текущее, tab, 1 of 3"].tap()
snapshot("1Current")
app.buttons["Планирование, tab, 2 of 3"].tap()
snapshot("2Planning")
sleep(2)
app.buttons["Настройки, tab, 3 of 3"].tap()
sleep(2)
app.otherElements["delete"].tap()
sleep(4)
app.buttons["Текущее, tab, 1 of 3"].tap()
snapshot("0Empty")
} else if deviceLanguage == "uk" {
<...>
} else if deviceLanguage == "it" {
<...>
} else {
app.buttons["Settings, tab, 3 of 3"].tap()
sleep(2)
app.otherElements["delete"].tap()
sleep(2)
app.otherElements["add_en"].tap()
sleep(8)
app.buttons["Current, tab, 1 of 3"].tap()
snapshot("1Current")
app.buttons["Planning, tab, 2 of 3"].tap()
snapshot("2Planning")
sleep(2)
app.buttons["Settings, tab, 3 of 3"].tap()
sleep(2)
app.otherElements["delete"].tap()
sleep(4)
app.buttons["Current, tab, 1 of 3"].tap()
snapshot("0Empty")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment