Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion WordPress/UITests/Tests/EditorGutenbergTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class EditorGutenbergTests: XCTestCase {
private var editorScreen: BlockEditorScreen!

override func setUpWithError() throws {
setUpTestSuite()
setUpTestSuite(crashOnCoreDataConcurrencyIssues: false)

_ = try LoginFlow.login(siteUrl: WPUITestCredentials.testWPcomSiteAddress, email: WPUITestCredentials.testWPcomUserEmail, password: WPUITestCredentials.testWPcomPassword)
editorScreen = try EditorFlow
Expand Down
10 changes: 9 additions & 1 deletion WordPress/UITests/Utils/XCTest+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,22 @@ import XCTest

extension XCTestCase {

public func setUpTestSuite(for app: XCUIApplication = XCUIApplication(), removeBeforeLaunching: Bool = false) {
public func setUpTestSuite(
for app: XCUIApplication = XCUIApplication(),
removeBeforeLaunching: Bool = false,
crashOnCoreDataConcurrencyIssues: Bool = true
) {
super.setUp()

// In UI tests it is usually best to stop immediately when a failure occurs.
continueAfterFailure = false

app.launchArguments = ["-wpcom-api-base-url", WireMock.URL().absoluteString, "-no-animations", "-ui-testing"]

if crashOnCoreDataConcurrencyIssues {
app.launchArguments.append(contentsOf: ["-com.apple.CoreData.ConcurrencyDebug", "1"])
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only a subset of the tests use setUpTestSuite, which would result in this argument being applied inconsistently.

Have you considered using the test plan to set it and use this method to opt-out only?

image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good suggestion. I hadn't thought about it, but I'll give it a go.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only a subset of the tests use setUpTestSuite

The idea is only turn the debug option on for UI tests, which all calls this funciton, I think?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[UI tests] all calls this funciton, I think?

Oh, that is correct. I don't know why I got the impression only some of them called setUpTestSuite 🤔 But I checked each test and they all do.

Apologies.


if removeBeforeLaunching {
removeApp(app)
}
Expand Down