microsoft / appcenter

Central repository for App Center open source resources and planning.
https://appcenter.ms
Creative Commons Attribution 4.0 International
1.01k stars 223 forks source link

Xamarin.UITest issues #2295

Closed edmuundoo closed 2 years ago

edmuundoo commented 3 years ago

Hello,

Some environment info: iOS 14.4.2 Visual Studio mac

I've updated Xamarin.UITest from version 3.2 to 3.2.2 and I have a lot of problems with this update.

here is the Repl tree output: >>> tree [CalabashRootView > ... > UILayoutContainerView] [UINavigationTransitionView > ... > iLobby_Universal_iOS_Views_Registration_ExistingAccountView] [UIImageView] [UIScrollView] [UILabel] label: "Please enter iLobby account information", text: "Please enter iLobby account information" [UITextField] [UIView] [UITextFieldLabel] label: "user@domain.com", text: "user@domain.com" [_UITextLayoutCanvasView] [UITextField] [UIView] [UITextFieldLabel] label: "Password", text: "Password" [_UITextLayoutCanvasView] [UIButton] label: "Sign In" [UIImageView] [UIButtonLabel] label: "Sign In", text: "Sign In" [UIButton] label: "Create Account" [UIButtonLabel] label: "Create Account", text: "Create Account" [_UIScrollViewScrollIndicator > UIView] label: "Horizontal scroll bar, 1 page", text: "0 %" (center not on screen) [_UIScrollViewScrollIndicator > UIView] label: "Vertical scroll bar, 1 page", text: "0 %" (center not on screen) [UINavigationBar] id: "iLobby" [_UIBarBackground] [UIVisualEffectView > _UIVisualEffectBackdropView] [_UIBarBackgroundShadowView > _UIBarBackgroundShadowContentImageView] [_UINavigationBarContentView] [_UIButtonBarStackView] [_UIButtonBarButton] label: "Cancel" [_UIModernBarButton] label: "Cancel" [UIButtonLabel] label: "Cancel", text: "Cancel" [_UIButtonBarStackView] [_UIButtonBarButton] label: "Sign In" [_UIModernBarButton] label: "Sign In" [UIButtonLabel] label: "Sign In", text: "Sign In" [_UITAMICAdaptorView] [UILabel] label: "iLobby", text: "iLobby" [UIView] [_UIButtonBarButton] label: "Cancel" [_UIModernBarButton] label: "Cancel" [UIButtonLabel] label: "Cancel", text: "Cancel" [UILabel] label: "iLobby", text: "iLobby" [_UIButtonBarButton] label: "Sign In" [_UIModernBarButton] label: "Sign In" [UIButtonLabel] label: "Sign In", text: "Sign In"

I've hid the keyboard and run the next command in the Repl: app.EnterText("user@domain.com", "test@ui.com") and got the exception: System.TimeoutException: Timed out waiting for keyboard. It did not happen in the past version of the Xamarin.UITest(3.2). The keyboard was opening by itself.

However, if the keyboard is visible and the cursor in the [UITextFieldLabel] label: "user@domain.com" field, when I run the: app.EnterText("Password", "secret") the text is pasted to the [UITextFieldLabel] label: "user@domain.com" as well. Cursor is not moved to [UITextFieldLabel] label: "Password" field. Besides, comparing with previous version, cursor was moved by itself and text was pasted successfully.

When tapping to the elements [UIButtonLabel] label: "Sign In" and others, no errors does not occurs but in fact, nothing happened in the application.

The other issue is in the iPadOS 15

when running tests the transparent overlay is displayed with the text "Automation Running Hold both volume buttons to stop" that blocks the interaction with the elements.

LasseOL commented 3 years ago

This sound indeed like our problem as well. I can see in our app, that it is because the coordinates is off for some reason. So eg. it is doing the tap at the wrong coordinates and that is why nothing happens.

ghost commented 2 years ago

This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs within 15 days of this comment.

ghost commented 2 years ago

This issue will now be closed because it hasn't had any activity for 15 days after stale. Please feel free to open a new issue if you still have a question/issue or suggestion.

Brosten commented 2 years ago

Please reopen! I also have the issue on ipads. Tried with ios 14 and 15 ipads, both give "Timed out waiting for keyboard" error. Works fine on iphone.

tuyen-vuduc commented 1 year ago

Any updates on this issue? It isn't an issue of AppCenter. It's an issue of UITest itself, I think.

IlyaBausovAkvelon commented 1 year ago

Hi @tuyen-vuduc! Could you provide more details on what is blocking you?

@Brosten this is the known issue. Thanks.

tuyen-vuduc commented 1 year ago

Here is the log.

The entry get focused, keyboard is shown, but nothing happened afteward.

/bin/Debug/....UITests.dll
   NUnit3TestExecutor discovered 1 of 1 NUnit test cases using Current Discovery mode, Non-Explicit run
Full log file: /var/folders/f_/rw78lrqd2jv8d6pclhd372_c0000gn/T/uitest/log-2023-01-27_05-58-21-957.txt
iOS test running Xamarin.UITest version: 3.2.7
Skipped IDE integration, connection failed.
Skipping local screenshots. Can be enabled with EnableScreenshots() when configuring app.
1 - LaunchTestAsync:
    deviceId: 38B27B25-1A83-415C-BD92-4A085CE18E72
1 - Launching simulator if not already running
Test server version: 0.23.1
Query for Marked("LoginPageId") gave 1 results.
Waiting for element matching Marked("MemberNameFormField").
Tapping element matching Marked("MemberNameFormField") at coordinates [ 187.5, 178.25 ].
Error while performing ClearText(Marked("MemberNameFormField").Descendant().Marked("FormFieldEntry"))
Exception: System.TimeoutException: Timed out waiting for keyboard.
  at Xamarin.UITest.Shared.WaitForHelper.WaitFor (System.Func`1[TResult] predicate, System.String timeoutMessage, System.Nullable`1[T] timeout, System.Nullable`1[T] retryFrequency, System.Nullable`1[T] postTimeout) [0x0002a] in <d9584c90cd85442eba772652d8e9f0b9>:0 
  at Xamarin.UITest.iOS.iOSApp+<>c__DisplayClass22_0.<ClearText>b__0 () [0x000d4] in <d9584c90cd85442eba772652d8e9f0b9>:0 
  at Xamarin.UITest.Utils.ErrorReporting.With (System.Action func, System.Object[] args, System.String memberName) [0x00006] in <d9584c90cd85442eba772652d8e9f0b9>:
IlyaBausovAkvelon commented 1 year ago

@tuyen-vuduc this issue should be fixed in 4.1.0.

tuyen-vuduc commented 1 year ago

@IlyaBausovAkvelon Thank you. I used to try upgrading but failed the last time. I can key in now on iOS. However, I faced another issue. Can you advise when triggering Rpel()?

Execution failed with exception: System.TypeLoadException: VTable setup of type ICSharpCode.NRefactory.TypeSystem.CecilLoader+DummyAssemblyResolver failed
  at Xamarin.UITest.Repl.Repl.NRefactoryCompletionEngine..ctor () [0x00087] in <6c3cd503f8d3482f88076fcdd083c9d2>:0 
  at Xamarin.UITest.Repl.Repl.ReplFacade..ctor () [0x00012] in <6c3cd503f8d3482f88076fcdd083c9d2>:0 
  at Xamarin.UITest.Repl.Program.Main (System.String[] args) [0x0008c] in <6c3cd503f8d3482f88076fcdd083c9d2>:0 
Press any key to exit.
AnatolyPristensky commented 1 year ago

Hello @tuyen-vuduc , This is a known issue that described in https://github.com/microsoft/appcenter/issues/2514/

The fix of this issue is in progress