Commit d525c0e4ec
Verified · cmc
Layout: unified · split
gitbayUITests/LiveSmokeUITests.swift +20 −2
| @@ -1782,8 +1782,7 @@ extension LiveSmokeUITests { | ||
| 1782 | 1782 | filter.tap() |
| 1783 | 1783 | choose("build-filter-job-menu", "test") |
| 1784 | 1784 | app.buttons["Done"].firstMatch.tap() |
| 1785 | XCTAssertTrue(app.staticTexts | |
| 1786 | .containing(NSPredicate(format: "label CONTAINS ' test'")).firstMatch | |
| 1785 | XCTAssertTrue(app.staticTexts["test"].firstMatch | |
| 1787 | 1786 | .waitForExistence(timeout: 20), "job filter did not narrow to test") |
| 1788 | 1787 | |
| 1789 | 1788 | // status = pending on a quiet repo: the filtered empty state. |
| @@ -1800,6 +1799,25 @@ extension LiveSmokeUITests { | ||
| 1800 | 1799 | XCTAssertTrue(app.cells.firstMatch.waitForExistence(timeout: 20), "list did not come back") |
| 1801 | 1800 | } |
| 1802 | 1801 | |
| 1802 | /// krz/gitbay has well over thirty builds, so the thirty-first is on | |
| 1803 | /// the second page. Reaching it means the footer asked for more. | |
| 1804 | func testBuildPagingFlow() throws { | |
| 1805 | guard let data = readCommand(["build", "list", "krz/gitbay", "--limit", "31"]), | |
| 1806 | let envelope = try? JSONSerialization.jsonObject(with: data) as? [String: Any], | |
| 1807 | let page = envelope["data"] as? [String: Any], | |
| 1808 | let items = page["items"] as? [[String: Any]], items.count == 31, | |
| 1809 | let number = items[30]["number"] as? Int | |
| 1810 | else { throw XCTSkip("could not read krz/gitbay's builds over the API") } | |
| 1811 | ||
| 1812 | openRepo("krz/gitbay") | |
| 1813 | app.staticTexts["Builds"].firstMatch.tap() | |
| 1814 | XCTAssertTrue(app.cells.firstMatch.waitForExistence(timeout: 20), "no builds listed") | |
| 1815 | let thirtyFirst = app.staticTexts | |
| 1816 | .containing(NSPredicate(format: "label BEGINSWITH %@", "#\(number) ")).firstMatch | |
| 1817 | XCTAssertTrue(scrollTo(thirtyFirst, swipes: 20), | |
| 1818 | "build #\(number), the first row of page two, never appeared") | |
| 1819 | } | |
| 1820 | ||
| 1803 | 1821 | /// Close in favour of another: the first fixture merge request is |
| 1804 | 1822 | /// closed from the app naming the second; the page then says so and |
| 1805 | 1823 | /// links to it. |