diff --git a/Example/UITests/FetchedResultsViewsUITests.swift b/Example/UITests/FetchedResultsViewsUITests.swift index a469e18..d50249e 100644 --- a/Example/UITests/FetchedResultsViewsUITests.swift +++ b/Example/UITests/FetchedResultsViewsUITests.swift @@ -28,11 +28,11 @@ final class FetchedResultsViewsUITests: XCTestCase { let app = XCUIApplication() let getCollectionView = { - XCUIApplication().collectionViews.matching(identifier: Identifiers.fetchedResultsCollectionView.rawValue).firstMatch + XCUIApplication().collectionViews[Identifiers.fetchedResultsCollectionView.rawValue] } let getTableView = { - XCUIApplication().tables.matching(identifier: Identifiers.fetchedResultsTableView.rawValue).firstMatch + XCUIApplication().tables[Identifiers.fetchedResultsTableView.rawValue] } let getDeleteButton = { @@ -148,34 +148,36 @@ final class FetchedResultsViewsUITests: XCTestCase { func test_ThatActionButton_AddNewOption_AddsCell() { fetchedResultsCollectionViewMenuItem.tap() - // GIVEN: initial number of cells in the collection + // GIVEN: initial empty collection let collection = getCollectionView() - let numberOfCellsBeforeInCollection = countElements(ofType: .cell, inView: collection) { $0.identifier } // WHEN: "Add new" option is tapped getShareButton().tap() app.sheets["You must select items first"].buttons["Add new"].tap() - // THEN: a new cell appears in the collection view - let numberOfCellsAfterInCollection = countElements(ofType: .cell, inView: collection) { $0.identifier } - XCTAssertEqual(numberOfCellsAfterInCollection, - numberOfCellsBeforeInCollection + 1, - "\"Add new\" should add one new cell") + let result1 = waitToAppearFor(element: collection.cells.element(boundBy: 0)) + XCTAssertEqual(result1, .completed) + + // THEN: one new cell appears in the collection view + let numberOfCellsInCollection = countElements(ofType: .cell, inView: collection) { $0.identifier } + XCTAssertEqual(numberOfCellsInCollection, 1, "\"Add new\" should add one new cell") navigateBack() + getDeleteButton().tap() fetchedResultsTableViewMenuItem.tap() - // GIVEN: initial number of cells in the table view + // GIVEN: initial empty table let table = getTableView() - let numberOfCellsBeforeInTable = countElements(ofType: .cell, inView: table) { $0.identifier } // WHEN: "Add new" option is tapped getShareButton().tap() app.sheets["You must select items first"].buttons["Add new"].tap() + let result2 = waitToAppearFor(element: table.cells.element(boundBy: 0)) + XCTAssertEqual(result2, .completed) - // THEN: a new cell appears in the table view - let numberOfCellsAfterInTable = countElements(ofType: .cell, inView: table) { $0.identifier } - XCTAssertEqual(numberOfCellsAfterInTable, numberOfCellsBeforeInTable + 1, "\"Add new\" should add one new cell") + // THEN: one new cell appears in the table view + let numberOfCellsInTable = countElements(ofType: .cell, inView: table) { $0.identifier } + XCTAssertEqual(numberOfCellsInTable, 1, "\"Add new\" should add one new cell") } func test_ThatActionButton_DeleteSelectedOption_RemovesSelectedCells() { diff --git a/Example/UITests/StaticViewsUITests.swift b/Example/UITests/StaticViewsUITests.swift index 2793b0d..7e5272b 100644 --- a/Example/UITests/StaticViewsUITests.swift +++ b/Example/UITests/StaticViewsUITests.swift @@ -23,8 +23,8 @@ final class StaticViewsUITests: XCTestCase { private let numberOfCellsInStaticTableView: Int = 9 private let numberOfCellsInStaticCollectionView: Int = 10 - private let staticTableViewMenuItem = XCUIApplication().tables.element.cells.element(boundBy: 0) - private let staticCollectionViewMenuItem = XCUIApplication().tables.element.cells.element(boundBy: 1) + private let staticTableViewMenuItem = XCUIApplication().tables[Identifiers.mainTableView.rawValue].cells.element(boundBy: 0) + private let staticCollectionViewMenuItem = XCUIApplication().tables[Identifiers.mainTableView.rawValue].cells.element(boundBy: 1) let app = XCUIApplication() diff --git a/Example/UITests/XCTestCase+Extensions.swift b/Example/UITests/XCTestCase+Extensions.swift index 2dce7b7..c1043e2 100644 --- a/Example/UITests/XCTestCase+Extensions.swift +++ b/Example/UITests/XCTestCase+Extensions.swift @@ -119,4 +119,17 @@ extension XCTestCase { numberOfElementsTapped += 1 } } + + @discardableResult + func waitToAppearFor(element: XCUIElement, timeout: Double = 5.0) -> XCTWaiter.Result { + let waiter = XCTWaiter() + let nsPredicate = NSPredicate(format: "exists == true") + let expectations = [XCTNSPredicateExpectation(predicate: nsPredicate, object: element)] + let result = waiter.wait(for: expectations, timeout: timeout) + + if result == .timedOut && element.exists && nsPredicate.evaluate(with: element) { + return .completed + } + return result + } } diff --git a/Gemfile b/Gemfile index 0c2fddc..dbee382 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source "https://rubygems.org" -gem 'cocoapods', '~> 1.7.5' +gem 'cocoapods', '~> 1.8' gem 'danger', '~> 6.0' gem 'danger-swiftlint' diff --git a/Gemfile.lock b/Gemfile.lock index e6e0375..82c12fd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -9,22 +9,25 @@ GEM tzinfo (~> 1.1) addressable (2.7.0) public_suffix (>= 2.0.2, < 5.0) + algoliasearch (1.27.0) + httpclient (~> 2.8, >= 2.8.3) + json (>= 1.5.1) atomos (0.1.3) claide (1.0.3) claide-plugins (0.9.2) cork nap open4 (~> 1.3) - cocoapods (1.7.5) + cocoapods (1.8.0) activesupport (>= 4.0.2, < 5) claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.7.5) + cocoapods-core (= 1.8.0) cocoapods-deintegrate (>= 1.0.3, < 2.0) cocoapods-downloader (>= 1.2.2, < 2.0) cocoapods-plugins (>= 1.0.0, < 2.0) cocoapods-search (>= 1.0.0, < 2.0) cocoapods-stats (>= 1.0.0, < 2.0) - cocoapods-trunk (>= 1.3.1, < 2.0) + cocoapods-trunk (>= 1.4.0, < 2.0) cocoapods-try (>= 1.1.0, < 2.0) colored2 (~> 3.1) escape (~> 0.0.4) @@ -33,9 +36,11 @@ GEM molinillo (~> 0.6.6) nap (~> 1.0) ruby-macho (~> 1.4) - xcodeproj (>= 1.10.0, < 2.0) - cocoapods-core (1.7.5) + xcodeproj (>= 1.11.1, < 2.0) + cocoapods-core (1.8.0) activesupport (>= 4.0.2, < 6) + algoliasearch (~> 1.0) + concurrent-ruby (~> 1.0) fuzzy_match (~> 2.0.4) nap (~> 1.0) cocoapods-deintegrate (1.0.4) @@ -86,8 +91,10 @@ GEM fuzzy_match (2.0.4) gh_inspector (1.1.3) git (1.5.0) + httpclient (2.8.3) i18n (0.9.5) concurrent-ruby (~> 1.0) + json (2.2.0) kramdown (2.1.0) kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) @@ -130,7 +137,7 @@ PLATFORMS ruby DEPENDENCIES - cocoapods (~> 1.7.5) + cocoapods (~> 1.8) danger (~> 6.0) danger-auto_label danger-prose diff --git a/docs/Classes.html b/docs/Classes.html index 6e576a3..67f83a2 100644 --- a/docs/Classes.html +++ b/docs/Classes.html @@ -244,8 +244,8 @@

Declaration

diff --git a/docs/Classes/DataSourceProvider.html b/docs/Classes/DataSourceProvider.html index d9f9322..aff160e 100644 --- a/docs/Classes/DataSourceProvider.html +++ b/docs/Classes/DataSourceProvider.html @@ -474,8 +474,8 @@

Declaration

diff --git a/docs/Classes/FetchedResultsController.html b/docs/Classes/FetchedResultsController.html index 06afe94..2ce9f5e 100644 --- a/docs/Classes/FetchedResultsController.html +++ b/docs/Classes/FetchedResultsController.html @@ -259,8 +259,8 @@

Return Value

diff --git a/docs/Classes/FetchedResultsDelegateProvider.html b/docs/Classes/FetchedResultsDelegateProvider.html index b2b83b9..45a2d74 100644 --- a/docs/Classes/FetchedResultsDelegateProvider.html +++ b/docs/Classes/FetchedResultsDelegateProvider.html @@ -164,9 +164,9 @@

Properties

  • - + - cellParentView + cellParentView
    @@ -412,8 +412,8 @@

    Declaration

    diff --git a/docs/Classes/TitledSupplementaryView.html b/docs/Classes/TitledSupplementaryView.html index 5cf09dc..dacffd8 100644 --- a/docs/Classes/TitledSupplementaryView.html +++ b/docs/Classes/TitledSupplementaryView.html @@ -249,8 +249,8 @@

    Declaration

    diff --git a/docs/Enums.html b/docs/Enums.html index 58d8cd4..cada77c 100644 --- a/docs/Enums.html +++ b/docs/Enums.html @@ -150,8 +150,8 @@

    Declaration

    diff --git a/docs/Enums/ReusableViewType.html b/docs/Enums/ReusableViewType.html index c8f6d1e..3137158 100644 --- a/docs/Enums/ReusableViewType.html +++ b/docs/Enums/ReusableViewType.html @@ -175,8 +175,8 @@

    Declaration

    diff --git a/docs/Guides.html b/docs/Guides.html index 67b49e9..d5b1063 100644 --- a/docs/Guides.html +++ b/docs/Guides.html @@ -108,11 +108,24 @@

    Guides

    +
    + +
    diff --git a/docs/Protocols.html b/docs/Protocols.html index 34739df..a655a54 100644 --- a/docs/Protocols.html +++ b/docs/Protocols.html @@ -265,8 +265,8 @@

    Declaration

    diff --git a/docs/Protocols/CellParentViewProtocol.html b/docs/Protocols/CellParentViewProtocol.html index c9b01f5..c05fc0c 100644 --- a/docs/Protocols/CellParentViewProtocol.html +++ b/docs/Protocols/CellParentViewProtocol.html @@ -305,8 +305,8 @@

    Return Value

    diff --git a/docs/Protocols/DataSourceProtocol.html b/docs/Protocols/DataSourceProtocol.html index 1891f99..4f38f82 100644 --- a/docs/Protocols/DataSourceProtocol.html +++ b/docs/Protocols/DataSourceProtocol.html @@ -510,8 +510,8 @@

    Return Value

    diff --git a/docs/Protocols/ReusableViewConfigProtocol.html b/docs/Protocols/ReusableViewConfigProtocol.html index 506c9ac..a94bbf9 100644 --- a/docs/Protocols/ReusableViewConfigProtocol.html +++ b/docs/Protocols/ReusableViewConfigProtocol.html @@ -643,8 +643,8 @@

    Return Value

    diff --git a/docs/Protocols/ReusableViewProtocol.html b/docs/Protocols/ReusableViewProtocol.html index f721221..35b6cc9 100644 --- a/docs/Protocols/ReusableViewProtocol.html +++ b/docs/Protocols/ReusableViewProtocol.html @@ -233,8 +233,8 @@

    Declaration

    diff --git a/docs/Structs.html b/docs/Structs.html index 6980479..ada2f70 100644 --- a/docs/Structs.html +++ b/docs/Structs.html @@ -282,8 +282,8 @@

    Declaration

    diff --git a/docs/Structs/DataSource.html b/docs/Structs/DataSource.html index ef38e78..dffab8c 100644 --- a/docs/Structs/DataSource.html +++ b/docs/Structs/DataSource.html @@ -679,8 +679,8 @@

    Return Value

    diff --git a/docs/Structs/ReusableViewConfig.html b/docs/Structs/ReusableViewConfig.html index df18dd0..e08dc58 100644 --- a/docs/Structs/ReusableViewConfig.html +++ b/docs/Structs/ReusableViewConfig.html @@ -407,8 +407,8 @@

    Parameters

    diff --git a/docs/Structs/Section.html b/docs/Structs/Section.html index 31d2c05..84c46d7 100644 --- a/docs/Structs/Section.html +++ b/docs/Structs/Section.html @@ -447,8 +447,8 @@

    Return Value

    diff --git a/docs/Structs/TableEditingController.html b/docs/Structs/TableEditingController.html index 7e00464..416e7b4 100644 --- a/docs/Structs/TableEditingController.html +++ b/docs/Structs/TableEditingController.html @@ -411,8 +411,8 @@

    Return Value

    diff --git a/docs/Structs/TitledSupplementaryViewConfig.html b/docs/Structs/TitledSupplementaryViewConfig.html index ad6e02a..56f0b9d 100644 --- a/docs/Structs/TitledSupplementaryViewConfig.html +++ b/docs/Structs/TitledSupplementaryViewConfig.html @@ -284,8 +284,8 @@

    Parameters

    diff --git a/docs/css/jazzy.css b/docs/css/jazzy.css index d628282..103ee29 100644 --- a/docs/css/jazzy.css +++ b/docs/css/jazzy.css @@ -150,7 +150,7 @@ header { margin-left: 246px; position: absolute; overflow: hidden; - padding-bottom: 60px; + padding-bottom: 20px; top: 70px; width: 734px; } .main-content p, .main-content a, .main-content code, .main-content em, .main-content ul, .main-content table, .main-content blockquote { @@ -216,10 +216,15 @@ header { .item code { background-color: transparent; padding: 0; } - .item .token { + .item .token, .item .direct-link { padding-left: 3px; margin-left: 15px; - font-size: 11.9px; } + font-size: 11.9px; + transition: all 300ms; } + .item .token-open { + margin-left: 0px; } + .item .discouraged { + text-decoration: line-through; } .item .declaration-note { font-size: .85em; color: gray; @@ -283,9 +288,9 @@ header { .language .aside-title { color: #4b8afb; } -.aside-warning { +.aside-warning, .aside-deprecated, .aside-unavailable { border-left: 5px solid #ff6666; } - .aside-warning .aside-title { + .aside-warning .aside-title, .aside-deprecated .aside-title, .aside-unavailable .aside-title { color: #ff0000; } .graybox { @@ -310,8 +315,9 @@ header { font-size: 0.9em; } #footer { - position: absolute; - bottom: 10px; + position: relative; + top: 10px; + bottom: 0px; margin-left: 25px; } #footer p { margin: 0; @@ -320,6 +326,7 @@ header { html.dash header, html.dash #breadcrumbs, html.dash .sidebar { display: none; } + html.dash .main-content { width: 980px; margin-left: 0; @@ -327,11 +334,15 @@ html.dash .main-content { width: 100%; top: 0; padding-bottom: 0; } + html.dash .height-container { display: block; } + html.dash .item .token { margin-left: 0; } + html.dash .content-wrapper { width: auto; } + html.dash #footer { position: static; } diff --git a/docs/getting-started.html b/docs/getting-started.html index c1aded1..46accad 100644 --- a/docs/getting-started.html +++ b/docs/getting-started.html @@ -157,8 +157,8 @@

    Demo Project

    diff --git a/docs/index.html b/docs/index.html index 0b30a19..df9010b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -116,8 +116,8 @@

    About

    Requirements