mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Added custom enviroment flags for unit and UI tests.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// Application.swift
|
||||
// UITests
|
||||
//
|
||||
// Created by Stefan Ceriu on 13/04/2022.
|
||||
// Copyright © 2022 element.io. All rights reserved.
|
||||
//
|
||||
|
||||
import XCTest
|
||||
|
||||
struct Application {
|
||||
func launch() {
|
||||
let app = XCUIApplication()
|
||||
app.launchEnvironment = ["IS_RUNNING_UI_TESTS": "1"]
|
||||
app.launch()
|
||||
}
|
||||
}
|
||||
@@ -24,8 +24,7 @@ class ElementXUITests: XCTestCase {
|
||||
|
||||
func testExample() throws {
|
||||
// UI tests must launch the application that they test.
|
||||
let app = XCUIApplication()
|
||||
app.launch()
|
||||
Application().launch()
|
||||
|
||||
// Use recording to get started writing UI tests.
|
||||
// Use XCTAssert and related functions to verify your tests produce the correct results.
|
||||
@@ -35,7 +34,7 @@ class ElementXUITests: XCTestCase {
|
||||
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) {
|
||||
// This measures how long it takes to launch your application.
|
||||
measure(metrics: [XCTApplicationLaunchMetric()]) {
|
||||
XCUIApplication().launch()
|
||||
Application().launch()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user