Skip to content

Commit

Permalink
fix: testNoBreadcrumbForTextFieldEditingChanged flakiness (#2992)
Browse files Browse the repository at this point in the history
Solving testNoBreadcrumbForTextFieldEditingChanged flakiness in the CI simulator.
  • Loading branch information
brustolin authored May 4, 2023
1 parent fd6a31c commit dc0fe58
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -281,14 +281,14 @@ jobs:

ui-tests:
name: UI Tests for ${{matrix.target}} on Simulators
runs-on: macos-12
strategy:
runs-on: macos-13
strategy:
matrix:
target: ['ios_swift', 'ios_objc', 'tvos_swift']

steps:
- uses: actions/checkout@v3
- run: ./scripts/ci-select-xcode.sh
- run: ./scripts/ci-select-xcode.sh "14.3"

# GitHub Actions sometimes fail to launch the UI tests. Therefore we retry
- name: Run Fastlane
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,16 @@ class UIEventBreadcrumbTests: XCTestCase {
app.buttons["Extra"].tap()
app.buttons["UI event tests"].tap()

let label = app.staticTexts["breadcrumbLabel"]

//Trigger a change in textfield
app.buttons["editingChangedButton"].tap()
app.buttons["editingChangedButton"].afterWaitingForExistence("Did not find editingChangedButton").tap()

//Check the last breadcrumb is the button being pressed
XCTAssertEqual(label.label, "performEditingChangedPressed:")
app.staticTexts["performEditingChangedPressed:"].waitForExistence("performEditingChangedPressed: not called")

//Trigger an endEditing in textfield
app.buttons["editingDidEndButton"].tap()
//Check the last breadcrumb is the endEditing from the textfield and not the button being pressed
XCTAssertEqual(label.label, "textFieldEndChanging:")
app.staticTexts["textFieldEndChanging:"].waitForExistence("textFieldEndChanging: not called")
}

func waitForExistenceOfMainScreen() {
Expand Down

0 comments on commit dc0fe58

Please sign in to comment.