//
//  InviteUITests.swift
//  suixinkanUITests
//

import XCTest

final class InviteUITests: AuthenticatedUITestCase {
    /// 测试邀请页与邀请记录页。
    func testInviteAndRecordPages() throws {
        app = try UITestSession.relaunch(openMenu: "注册邀请")
        NavigationAssertions.waitForNavigationTitle("摄影师邀请", in: app)

        let recordEntry = app.application.staticTexts.matching(NSPredicate(format: "label CONTAINS '邀请记录'")).firstMatch
        if recordEntry.waitForExistence(timeout: 6) {
            recordEntry.tap()
            NavigationAssertions.waitForNavigationTitle("邀请记录", in: app)
        } else {
            app = try UITestSession.relaunch(openMenu: "邀请记录")
            NavigationAssertions.waitForNavigationTitle("邀请记录", in: app)
        }
    }
}
