2024-03-08 12:25:43 +00:00
|
|
|
//
|
2024-09-06 16:34:30 +03:00
|
|
|
// Copyright 2024 New Vector Ltd.
|
2024-03-08 12:25:43 +00:00
|
|
|
//
|
2025-01-06 11:27:37 +01:00
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
|
|
|
// Please see LICENSE files in the repository root for full details.
|
2024-03-08 12:25:43 +00:00
|
|
|
//
|
|
|
|
|
|
|
|
import XCTest
|
|
|
|
|
|
|
|
@MainActor
|
|
|
|
class RoomRolesAndPermissionsUITests: XCTestCase {
|
|
|
|
var app: XCUIApplication!
|
|
|
|
|
|
|
|
@MainActor enum Step {
|
|
|
|
static let rolesAndPermissions = 0
|
|
|
|
static let administratorsRole = 1
|
|
|
|
static let moderatorsRole = 2
|
|
|
|
static let roomDetailsPermissions = 3
|
|
|
|
static let messagesAndContentPermissions = 4
|
|
|
|
static let memberModerationPermissions = 5
|
|
|
|
}
|
|
|
|
|
|
|
|
func testFlow() async throws {
|
|
|
|
app = Application.launch(.roomRolesAndPermissionsFlow)
|
|
|
|
|
2025-03-04 17:17:52 +02:00
|
|
|
try await app.assertScreenshot(step: Step.rolesAndPermissions)
|
2024-03-08 12:25:43 +00:00
|
|
|
|
|
|
|
app.buttons[A11yIdentifiers.roomRolesAndPermissionsScreen.administrators].tap()
|
2025-03-04 17:17:52 +02:00
|
|
|
try await app.assertScreenshot(step: Step.administratorsRole)
|
2024-03-08 12:25:43 +00:00
|
|
|
app.navigationBars.buttons.element(boundBy: 0).tap()
|
|
|
|
|
|
|
|
app.buttons[A11yIdentifiers.roomRolesAndPermissionsScreen.moderators].tap()
|
2025-03-04 17:17:52 +02:00
|
|
|
try await app.assertScreenshot(step: Step.moderatorsRole)
|
2024-03-08 12:25:43 +00:00
|
|
|
app.navigationBars.buttons.element(boundBy: 0).tap()
|
|
|
|
|
|
|
|
app.buttons[A11yIdentifiers.roomRolesAndPermissionsScreen.roomDetails].tap()
|
2025-03-04 17:17:52 +02:00
|
|
|
try await app.assertScreenshot(step: Step.roomDetailsPermissions)
|
2024-03-08 12:25:43 +00:00
|
|
|
app.navigationBars.buttons.element(boundBy: 0).tap()
|
|
|
|
|
|
|
|
app.buttons[A11yIdentifiers.roomRolesAndPermissionsScreen.messagesAndContent].tap()
|
2025-03-04 17:17:52 +02:00
|
|
|
try await app.assertScreenshot(step: Step.messagesAndContentPermissions)
|
2024-03-08 12:25:43 +00:00
|
|
|
app.navigationBars.buttons.element(boundBy: 0).tap()
|
|
|
|
|
|
|
|
app.buttons[A11yIdentifiers.roomRolesAndPermissionsScreen.memberModeration].tap()
|
2025-03-04 17:17:52 +02:00
|
|
|
try await app.assertScreenshot(step: Step.memberModerationPermissions)
|
2024-03-08 12:25:43 +00:00
|
|
|
}
|
|
|
|
}
|