         XCTAssertEqual(header.frame.height, 250)
         
         let collectionView = XCUIApplication().collectionViews.element(boundBy: 0)
-        collectionView.swipeUp()
-        XCTAssertEqual(header.frame.height, 64)
+        execute(block: {
+            collectionView.swipeUp()
+        }, until: header, hasHeight: 64)
     }
     
     func testCollectionViewContentInsetEqualToHeaderHeight() {

    private func navigateToStickyHeaderFeature() {
        XCUIApplication().collectionViews.staticTexts["Sticky header"].tap()
    }
}

        let header = XCUIApplication().otherElements["header"]
        XCTAssertTrue(header.exists)
        
        // Go to the top of the view and make sure that the header is now uncollapsed
        execute(block: {
            collectionView.swipeDown()
        }, until: header, hasHeight: 250)
    }
    
    // MARK: - Utilities
