UI test fixes (#2309)

* Fix settings screen screenshots

* Fix user session test snapshots

* Fix poll creation form UI test after moving to textViews instead of textFields

* Add missing room member details snapshot

* Update the home screen avatar snapshot as the badge is not shown anymore

* Dismiss the keyboard on the poll form when inserting a new line on a poll option
This commit is contained in:
Stefan Ceriu
2024-01-08 18:02:29 +02:00
committed by GitHub
parent 8374682111
commit d23ab7b921
35 changed files with 88 additions and 72 deletions

View File

@@ -74,9 +74,16 @@ struct PollFormScreen: View {
}
.focused($focus, equals: .option(index: index))
.accessibilityIdentifier(A11yIdentifiers.pollFormScreen.optionID(index))
.onSubmit {
let nextOptionIndex = index == context.options.endIndex - 1 ? nil : index + 1
focus = nextOptionIndex.map { .option(index: $0) }
.onChange(of: context.options[index].text) { optionText in
guard let lastCharacter = optionText.last, lastCharacter.isNewline else {
return
}
context.options[index].text.removeLast()
submitOption(at: index)
}
.onSubmit { // onSubmit is still called when using the return key on a hardware keyboard
submitOption(at: index)
}
.submitLabel(index == context.options.endIndex - 1 ? .done : .next)
}
@@ -98,6 +105,11 @@ struct PollFormScreen: View {
.animation(.noAnimation, value: UUID())
}
private func submitOption(at index: Array<PollFormScreenViewStateBindings.Option>.Index) {
let nextOptionIndex = index == context.options.endIndex - 1 ? nil : index + 1
focus = nextOptionIndex.map { .option(index: $0) }
}
private var showResultsSection: some View {
Section {
ListRow(label: .plain(title: L10n.screenCreatePollAnonymousDesc),

View File

@@ -42,7 +42,7 @@ class MockClientProxy: ClientProxyProtocol {
lazy var secureBackupController: SecureBackupControllerProtocol = {
let secureBackupController = SecureBackupControllerMock()
secureBackupController.underlyingRecoveryKeyState = .init(CurrentValueSubject<SecureBackupRecoveryKeyState, Never>(.disabled))
secureBackupController.underlyingRecoveryKeyState = .init(CurrentValueSubject<SecureBackupRecoveryKeyState, Never>(.enabled))
secureBackupController.underlyingKeyBackupState = .init(CurrentValueSubject<SecureBackupKeyBackupState, Never>(.enabled))
secureBackupController.isLastSessionReturnValue = .success(false)
return secureBackupController

View File

@@ -29,13 +29,16 @@ class PollFormScreenUITests: XCTestCase {
questionTextField.coordinate(withNormalizedOffset: .init(dx: 0.5, dy: 0.5)).tap() // Tap isn't registered without the offset.
questionTextField.typeText("Do you like polls?")
let option1TextField = app.textFields[A11yIdentifiers.pollFormScreen.optionID(0)]
let option1TextField = app.textViews[A11yIdentifiers.pollFormScreen.optionID(0)]
option1TextField.tap()
option1TextField.typeText("Yes")
let option2TextField = app.textFields[A11yIdentifiers.pollFormScreen.optionID(1)]
let option2TextField = app.textViews[A11yIdentifiers.pollFormScreen.optionID(1)]
option2TextField.tap()
option2TextField.typeText("No\n")
option2TextField.typeText("No")
// Dismiss the keyboard
app.swipeDown()
let createButton = app.buttons[A11yIdentifiers.pollFormScreen.submit]
XCTAssertTrue(createButton.isEnabled)
@@ -56,9 +59,7 @@ class PollFormScreenUITests: XCTestCase {
addOption.tap()
}
if app.hasFocus {
app.typeText("\n") // Dismiss the keyboard so the Add button is always visible.
}
app.swipeUp() // Dismiss the keyboard so the Add button is always visible.
app.swipeUp() // Ensures that the bottom is shown.

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2955b8a8c24fc65f917c722ed3ed73dc91adcd0c2b690fc1ba9fb0ebcb9a2e65
size 87226
oid sha256:f4c47488fd24df0a5978a65cc314dd73c70032d1250daa6d42f514e2f3336caa
size 87215

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:46e0da06cd751549c0debc4cc44ca7c05f368387f2b868db79ef33dccc16c368
size 182444
oid sha256:29d5664afdacb95c37595bd24e6eaa1fa86499796387aa558e276b7cfa6e2f36
size 199127

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f80d3352ccc3f89a9a68c041145416562c3e5b6c893a6b099c3012f1cfbc300b
size 90898
oid sha256:d6d6002eaaf040d5af88484896e135852fef3c658e0c4f43f581ac210e2b7d37
size 93731

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8493f5a8c052742c71503b4961fa79d6dab9f15204fff5e031fac20b29d4c8d2
size 82132

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7f325518a5e8c40b114b4f17d3130c45ad3d90fc6a565ac242cdbb1a18ab4eb7
size 131266
oid sha256:d3c08ea0ffa71cf6eb554ddc394a7db01325588bb93e3ab094f18a76f669dd9e
size 138739

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ad6a7599f4b1d74c92dfa8532ba5cabc9b2d7459101e1002f61482323226abc7
size 306965
oid sha256:b6aee882464293122bbcc9ce942f451e99d235482239a55df28f681db63f6c15
size 305624

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bc1b366b38e9a25162877ca843da0d58609946ce2640d445df08b9a218214699
size 437096
oid sha256:32e269b7a3af5e5bd670d746c20f4bc493265e78c6c723075ec94cf0c4996fdc
size 435351

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6c63a17cbe70e0f31021c4b4b35aa8ffade74c163ca039cc5cbdff12e8f56b98
size 677269
oid sha256:f6639bce64f5acb1c189079c94709c958a441fef85e01b837a6c2d0dab7722ce
size 675960

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8970c952ecf8716e31b6eaa29d166d8f65facce71b0bcdcf0eb4ead97f938562
size 724878
oid sha256:1d8a1c8eaf1032ab62ad65df5e3ce9ea417525706c2c4ce66b18592942a8a9ec
size 723207

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d726e92508ea0b4a281163d9be72e93eaeae0fa89551692039076eeaf742f749
size 436895
oid sha256:606df7d3229d796e41080f88dcaeb25d0bdbd4878d4f3a0de7a0ab04042d91dc
size 435350

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:75bcf15476edcba2231c2fe032dfa5bfdb059bd0e5204a73a0d5e6e51b8e91fd
size 440739
oid sha256:bf9c7d05a0ac2398eb6cf8755fc0957c2742f71713a310382b0f15bba2f08a52
size 438493

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:55c14d4b93f46ca93e3dcbfceaa41f04c72d07e2208d71579c54960b26e17789
size 102626
oid sha256:f133e2fa910216995ade966fdd67b26a822043eab8a49c37dfe9795d0cb9e0a7
size 102595

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cfefd5eb7f3de236f877444a148bb5e538b5880dabc2a0db26c2d4815fa3acf6
size 329998
oid sha256:514654dd18e520e15b0bd7aa74598995290add90a6cdabbce9916d346c196ee5
size 315639

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fd42c7188d81f3f3e9d95dd38b8e1fc91a7606c7cd62fe2d489b174b51cf8253
size 107729
oid sha256:ebf33418e3ffe7b849f3f3f45fecafe173c91b466802d1a3a41fe689d82795e4
size 111817

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7b0fa00ad415609baa7a50da28ce46e83d7ff4d78ec61e863c1418d00e232977
size 162508
oid sha256:25076c598482ee48360108f0acc67cde09d191a51c296afb763018bbd748291f
size 164268

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:45e6ae2461507f5c02e285133462363909a9413a01103e421d4c6f850370e12b
size 293670
oid sha256:d84cdc9ea7d879e8d32a8eb80bb53c34204fa75ce00ff1fade9b628e71abbf46
size 290392

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0de593a81e150cd96f2b5a7b8dd0b4782c07e6deb1df8d4df4cee773a8283ae7
size 91558
oid sha256:93a7286010dbf90fcf5147a2f36f950653eb88e90e95dc65f6c1f471bbc3d924
size 91541

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:eb62280b037556efb52b2b0c55f7fc3b9f2b73f34f83d0af9b2c8881c3b66207
size 217791
oid sha256:9cd1af2b4affcf2d997df8bd0543ca44cf0850ab4ad0e26676bf9e0fb1937ce5
size 239243

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c5f89615f4a3021fe65d5e1790a3c5b0708bf057cc56f9ed9b31c20ae5975f75
size 98656
oid sha256:9b420fa1b797ccdde61bcc360d74aef09fab52c6db2e27541ff9d645f8979350
size 102174

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:78b54082ac3918544071784378539093724e486d59a125c1a4d5fbaa189cbc6a
size 140353
oid sha256:400e3eba5557dd4138c7b8ff2cc305dd95e74c3e1b86f2bd5675a5c7c8dcf656
size 148563

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:efe56f7957d25b98e01c10287a6d005e6a85226876e570b955e9da289c92df8c
size 309127
oid sha256:ad61a203b949fb8cd2f2d151a8124cd8030adc821726c50b48e935a3d671d6dd
size 307767

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d232f9d53d854bc36c45af4c468c4626e2991936579024e0b88e8085c832b32e
size 439431
oid sha256:ad908576aee0c1f3c3595c927938e2c9f2e54791a431f047eef01fc05342bad8
size 437722

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:52dc1a4f33096db7ddb0a3cd18fd70a4e509f6fb55d037fb9f8b67b27c1c2e4b
size 712617
oid sha256:bb37c37a31030a267b6830d6f5330dda7970b3aed5dcd9e5288db2a4f8a11178
size 711458

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ed37bb57322b17e2b8fa83fe116a2a213a739116121547d5d6404093be1ca07a
size 774121
oid sha256:520f1f237b8cf2c3b9acf70f56a15f18418bff5f8d0c9c5313f363531f4ea794
size 772175

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3c871a43eb998305ad328f10a0138394b53381e3b8e77f6c5239338539d84cb0
size 439306
oid sha256:6bf7be59ffe34391237c3e2c643e82989f1c3e5eafe6ced8316069b3672556ef
size 437757

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:55ad7deec9d69e5e23f998afb1fda2f610117a5999b55d935f8976469db9f43a
size 443196
oid sha256:fc646c5164aba4e869d3f62959650591810625314c92a7e5e7fa892b4c990904
size 440994

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4cd6ee2d916ff6d436ac3c88c65f2483591997aeaa8e61b7be1db9d3d81beb1d
size 116890
oid sha256:141dcda412af166bda5e8154ad8883f6d421580c573d8aa7770b57aaa050a44c
size 116877

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:002b96030766a5a83654c2d265ab537e5fa8be9bff00b1ec3e0b056a8a0efcf9
size 363236
oid sha256:07ee7052eb6ee109121163152455db6db46590c19fb39d055040a101dd96422f
size 358613

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b146f3309a3356836781c2ce0a5b5bf89ecc5094a4ec5776d2f3a9f36e023379
size 129146
oid sha256:30dad7c1a1cd703e06cdc126e89d16ec0e53fa6a68cd0a543e8ebd07bb949edb
size 132248

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a08cf3a415a04c32f52cbc6fc6cae063eb6ef4871d4bd0b7c7caff7b6466cdc6
size 180060
oid sha256:e1eb3e2304004c1d0b21f8431678fdbf9c7e751c57ff4c686706d37fec9bc0d3
size 184449

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7174d289197b64d0f3baddeb7721fb041788b96a6b7b1ad41eb8467258cdd59c
size 297199
oid sha256:af1c290c85c81aa4d9f74deeb8755b4597a3b8460bb3066791d24bb5f467ed7c
size 293925

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ceef950f0e74453a572d90b85cea1a3ba2a702595358efb36d76285d51acee15
size 106872
oid sha256:2b391abfdd2172848ae1a2510d50ea597e337425793560d01959b57429972ba2
size 106343