mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-05 20:09:04 +00:00
possible fix for flaky UI tests
- increased the time for the oidc selection alert check - for the poll screen creation, in the test only we reduced the number of options to 10
This commit is contained in:
@@ -10,8 +10,8 @@ import SwiftUI
|
|||||||
|
|
||||||
struct PollFormScreenCoordinatorParameters {
|
struct PollFormScreenCoordinatorParameters {
|
||||||
let mode: PollFormMode
|
let mode: PollFormMode
|
||||||
/// The max number of allowed options, default is 20, but for faster UI tests we allow the value to be lower
|
/// The max number of allowed options, if no value provided the default value of the view model will be used.
|
||||||
var maxNumberOfOptions = 20
|
var maxNumberOfOptions: Int?
|
||||||
}
|
}
|
||||||
|
|
||||||
enum PollFormScreenCoordinatorAction {
|
enum PollFormScreenCoordinatorAction {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ enum PollFormScreenViewModelAction: Equatable {
|
|||||||
|
|
||||||
struct PollFormScreenViewState: BindableState {
|
struct PollFormScreenViewState: BindableState {
|
||||||
let mode: PollFormMode
|
let mode: PollFormMode
|
||||||
var maxNumberOfOptions: Int
|
let maxNumberOfOptions: Int
|
||||||
var bindings: PollFormScreenViewStateBindings = .init()
|
var bindings: PollFormScreenViewStateBindings = .init()
|
||||||
|
|
||||||
init(mode: PollFormMode, maxNumberOfOptions: Int) {
|
init(mode: PollFormMode, maxNumberOfOptions: Int) {
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ class PollFormScreenViewModel: PollFormScreenViewModelType, PollFormScreenViewMo
|
|||||||
actionsSubject.eraseToAnyPublisher()
|
actionsSubject.eraseToAnyPublisher()
|
||||||
}
|
}
|
||||||
|
|
||||||
init(mode: PollFormMode, maxNumberOfOptions: Int) {
|
init(mode: PollFormMode, maxNumberOfOptions: Int? = nil) {
|
||||||
super.init(initialViewState: .init(mode: mode, maxNumberOfOptions: maxNumberOfOptions))
|
super.init(initialViewState: .init(mode: mode, maxNumberOfOptions: maxNumberOfOptions ?? 20))
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - Public
|
// MARK: - Public
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class PollFormScreenUITests: XCTestCase {
|
|||||||
let createButton = app.buttons[A11yIdentifiers.pollFormScreen.submit]
|
let createButton = app.buttons[A11yIdentifiers.pollFormScreen.submit]
|
||||||
let addOption = app.buttons[A11yIdentifiers.pollFormScreen.addOption]
|
let addOption = app.buttons[A11yIdentifiers.pollFormScreen.addOption]
|
||||||
|
|
||||||
for _ in 1...18 {
|
for _ in 1...8 {
|
||||||
// Use the frame as a fallback to fix the button being obscured by the home indicator.
|
// Use the frame as a fallback to fix the button being obscured by the home indicator.
|
||||||
if !addOption.isHittable || addOption.frame.maxY > (app.frame.maxY - 20) {
|
if !addOption.isHittable || addOption.frame.maxY > (app.frame.maxY - 20) {
|
||||||
app.swipeUp()
|
app.swipeUp()
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:f917c5025edb6d96857a824a4686eafee33aed4759b0427f488cde8b0e4a0214
|
oid sha256:1141531136024258cb952d4a078d43e168258350e0afa8e048d3a12849dc7291
|
||||||
size 195197
|
size 133124
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:860ce4ca442b8c5b5936aa0da77d9efa885e1ec86f9e12f02c4d828e918e8f47
|
oid sha256:3692a76bba54ff6c9896df27208aa6866428a979b0030653f15d93bfe680ff72
|
||||||
size 299469
|
size 239255
|
||||||
|
|||||||
Reference in New Issue
Block a user