diff --git a/SwiftRadioUITests/Extensions/XCTest+Allure.swift b/SwiftRadioUITests/Extensions/XCTest+Allure.swift index 84bf50c..6227d29 100644 --- a/SwiftRadioUITests/Extensions/XCTest+Allure.swift +++ b/SwiftRadioUITests/Extensions/XCTest+Allure.swift @@ -40,5 +40,21 @@ public extension XCTest { } return self } + + @discardableResult + func before(_ name: String, step: () -> Void) -> XCTest { + XCTContext.runActivity(named: "befores: " + name) { _ in + step() + } + return self + } + + @discardableResult + func after(_ name: String, step: () -> Void) -> XCTest { + XCTContext.runActivity(named: "afters: " + name) { _ in + step() + } + return self + } } diff --git a/SwiftRadioUITests/Tests/CommonTest.swift b/SwiftRadioUITests/Tests/CommonTest.swift index d26207d..2c8c0b8 100644 --- a/SwiftRadioUITests/Tests/CommonTest.swift +++ b/SwiftRadioUITests/Tests/CommonTest.swift @@ -11,13 +11,17 @@ import XCTest class CommonTest: XCTestCase { override func setUp() { - super.setUp() - - continueAfterFailure = false - XCUIApplication().launch() + before("Иницилизация приложения") { + super.setUp() + + continueAfterFailure = false + XCUIApplication().launch() + } } - override class func tearDown() { - super.tearDown() + override func tearDown() { + after("Очистка состояния") { + super.tearDown() + } } }