Reorganize docs and update reader search flows

This commit is contained in:
shenlei
2026-06-10 08:22:07 +08:00
parent 0e7c0577e3
commit d15187b730
72 changed files with 517 additions and 5214 deletions
@@ -56,23 +56,30 @@ final class BookmarkTests: XCTestCase {
}
func testBookmarksPanelIsAccessible() {
app.launchAndOpenSampleBook()
//
app.launchAndOpenSampleBook(resetsReaderState: false)
app.waitForReader()
app.showReaderChromeIfNeeded()
let bookmarkButton = app.buttons[IDs.readerBookmark]
XCTAssertTrue(bookmarkButton.waitForExistence(timeout: 5), "书签按钮未出现")
bookmarkButton.tap()
//
let state = app.currentDemoReaderState()
if state?.bookmarks == 0 || state?.bookmarks == nil {
let bookmarkButton = app.buttons[IDs.readerBookmark]
if bookmarkButton.waitForExistence(timeout: 5) {
bookmarkButton.tap()
RunLoop.current.run(until: Date().addingTimeInterval(1.5))
}
}
app.showReaderChromeIfNeeded()
let bookmarksListButton = app.buttons[IDs.readerBookmarks]
XCTAssertTrue(bookmarksListButton.waitForExistence(timeout: 5), "书签列表按钮未出现")
//
let enabledPredicate = NSPredicate(format: "isEnabled == true")
expectation(for: enabledPredicate, evaluatedWith: bookmarksListButton)
waitForExpectations(timeout: 10)
XCTAssertTrue(bookmarksListButton.isEnabled, "书签列表按钮未启用")
bookmarksListButton.tap()
let bookmarksPanel = app.tables[IDs.readerBookmarksTable]