//
//  ProjectsUITests.swift
//  suixinkanUITests
//

import XCTest

final class ProjectsUITests: AuthenticatedUITestCase {
    /// 测试摄影师项目列表与新建页。
    func testProjectManagementCreatePage() throws {
        app = try UITestSession.relaunch(openMenu: "项目管理")
        NavigationAssertions.waitForNavigationTitle("项目管理", in: app)

        let createButton = app.application.buttons.matching(NSPredicate(format: "label CONTAINS '新建'")).firstMatch
        if createButton.waitForExistence(timeout: 6) {
            createButton.tap()
            NavigationAssertions.waitForNavigationTitle("新建项目", in: app)
            BackNavigator.goBack(app: app)
        }
    }

    /// 测试店铺项目管理页可打开。
    func testStoreProjectManagementPage() throws {
        app = try UITestSession.relaunch(openMenu: "店铺项目管理")
        NavigationAssertions.waitForNavigationTitle("店铺项目管理", in: app)
    }
}
