UI Tests fixes. (#1322)

* Fix broken UI tests and update snapshots.

* Tweak workflow.

* Update schedule and zip the result bundle.
This commit is contained in:
Doug 2023-07-13 16:10:41 +01:00 committed by GitHub
parent 3ff257c075
commit dff18d7851
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 28 additions and 16 deletions

View File

@ -2,7 +2,7 @@ name: Integration tests
on:
schedule:
- cron: '0 * * * *'
- cron: '0 6,18 * * *'
workflow_dispatch:

View File

@ -8,12 +8,12 @@ on:
required: false
schedule:
- cron: '0 0 * * 1-5'
- cron: '0 0,12 * * 1-5'
jobs:
tests:
name: Tests
runs-on: macos-13
runs-on: perf-only
concurrency:
# When running on develop, use the sha to allow all runs of this workflow to run concurrently.

View File

@ -328,10 +328,11 @@ class MockScreen: Identifiable {
let parameters = SessionVerificationScreenCoordinatorParameters(sessionVerificationControllerProxy: sessionVerificationControllerProxy)
return SessionVerificationScreenCoordinator(parameters: parameters)
case .userSessionScreen:
let navigationSplitCoordinator = NavigationSplitCoordinator(placeholderCoordinator: SplashScreenCoordinator())
let navigationSplitCoordinator = NavigationSplitCoordinator(placeholderCoordinator: PlaceholderScreenCoordinator())
let clientProxy = MockClientProxy(userID: "@mock:client.com", roomSummaryProvider: MockRoomSummaryProvider(state: .loaded(.mockRooms)))
ServiceLocator.shared.settings.migratedAccounts[clientProxy.userID] = true
ServiceLocator.shared.settings.hasShownWelcomeScreen = true
let coordinator = UserSessionFlowCoordinator(userSession: MockUserSession(clientProxy: clientProxy, mediaProvider: MockMediaProvider()),
navigationSplitCoordinator: navigationSplitCoordinator,

View File

@ -110,6 +110,9 @@ lane :unit_tests do
end
lane :ui_tests do |options|
# Use a fresh simulator state to ensure hardware keyboard isn't attached.
reset_simulator_contents()
create_simulator_if_necessary(
name: "iPad (9th generation)",
type: "com.apple.CoreSimulator.SimDeviceType.iPad-9th-generation"
@ -138,6 +141,14 @@ lane :ui_tests do |options|
scheme: "UITests",
binary_basename: "ElementX.app"
)
# Zip the result bundle for faster upload.
zip(
path: "./fastlane/test_output/UITests.xcresult",
output_path: "./fastlane/test_output/UITests.xcresult.zip"
)
# Shell working directory is already inside the fastlane dir.
sh("rm -rf ./test_output/UITests.xcresult")
end