Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
BorisLys committed Nov 13, 2024
1 parent 6de4bee commit 7f3abc6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
16 changes: 16 additions & 0 deletions SwiftRadioUITests/Extensions/XCTest+Allure.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

16 changes: 10 additions & 6 deletions SwiftRadioUITests/Tests/CommonTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
}

0 comments on commit 7f3abc6

Please sign in to comment.