Reputation: 420
I'm following this video Detect and diagnose memory from WWDC 2021: https://developer.apple.com/videos/play/wwdc2021/10180/
In the video, after the UI test finishes execution, a memgraph is generated. I created a new project and added some UI tests, but after all the tests finished execution, Xcode didn't generate any memgraph.
Here is my test that follows the example in WWDC video:
func testExample() throws {
// UI tests must launch the application that they test.
let app = XCUIApplication()
let options = XCTMeasureOptions()
options.invocationOptions = [.manuallyStart]
measure(
metrics: [XCTMemoryMetric(application: app)],
options: options
) {
app.launch()
startMeasuring()
app.staticTexts["Abandoned Memory Example"].tap()
app.buttons["Scenarios"].tap()
app.staticTexts["Leaks Memory Example"].tap()
let simulateLogoutThenLoginActionButton = app.buttons["Simulate Logout then Login Action"]
simulateLogoutThenLoginActionButton.tap()
simulateLogoutThenLoginActionButton.tap()
simulateLogoutThenLoginActionButton.tap()
simulateLogoutThenLoginActionButton.tap()
XCTAssertTrue(true)
}
}
What I've tried:
I'm using Xcode 14.2.
How can I make Xcode generate a memgraph after UI test finishes execution? Thanks in advance for your help!
Upvotes: 1
Views: 113