-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run integration tests in the Github Workflows on all platforms #141
Comments
I took Brett's commits and made a few changes. The tries can be found here: https://github.com/enigo-rs/enigo/tree/tests Here are a few things that I found out/tried out:
All these explorations resulted in https://github.com/enigo-rs/enigo/tree/75bb460e7b6ce2a9a1697925a3566a0b73805e1a |
Has someone tried to run the windows test locally running inside a VM and not nativ under windows? |
In the Github Workflow on Windows (Windows Server 2022) I saw the following output:
On Mac, there were no errors. The test just timed out :( |
There is Here is some code I had a look at to try to fix it: |
@Megamannen , in another issue you mentioned that you wrote a similar library. Were you able to run some integration tests for it? |
Yes, I just installed Windows 10 in Gnome Boxes and it works like a charm. It is a bit weird, because calling the functions to move the mouse work, but I don't see it move (I see new coordinates in the Firefox log when I use the "test page" though). I guess that is because the host controls the mouse and not the VM. Also I installed spice-guest-tools so that I can look at the Windows VM in fullscreen. That seems to mess with the mouse coordinates as well. The absolute ones are fine but the relative ones don't match the numbers I called the function with. The main_display_size() function returns the old dimensions of the "screen" before I installed spice. Maybe that is why they are weird. |
There is also https://github.com/sickcodes/Docker-OSX which apparently is able to use xvfb too |
I am trying to run the integration test on macOS. There is a popup that says that the code wants to control the computer using accessibility features. I have to grant access in the "Security & Privacy" preferences, located in System Preferences. That might be a reason why it does not work on macOS in the CI? |
On the mac I borrowed, enabling full screen is |
The blocker for macOS is the missing accessibility permission. An explanation about the relevant DB can be found here: https://www.rainforestqa.com/blog/macos-tcc-db-deep-dive The permissions can be checked by running: |
wow that is really unfortunate – do we have an alternative like a different CI we can run against? |
maybe appveyor has SIP disabled in their images? appveyor/ci#3426 |
I created an issue and asked, if they could add the required permissions to the Github runner: actions/runner-images#7269 |
Looks like this PR as merged. |
I tried adding more tests and to enable the integration tests on all platforms. My recent attempt can be found at https://github.com/pentamassiv/enigo/tree/more_test_cases. I am now at a point where moving the mouse and entering keys works. However the integration tests continue to fail under Windows and macOS. I added an action to take screenshots of the CI machine on all platforms. The screenshots are then uploaded as an artifacts so they can be looked at after the CI ran and we get more visibility into the machine. One of the reasons it failed on Windows was that Edge was used and it opened the first-start page instead of the test page. Now I am trying to open Firefox manually, but for some reason that also does not work and I don't get why. Maybe somebody else has an idea? |
We are so close to being able to run the integration tests in the CI... |
It is possible to run macOS in a VM by running the following two commands:
You probably also have to disable xhost security with: |
@BrettMayson had the idea to use a browser to run integration tests for the crate and laid the foundation for them. They run on Linux, but not on the other platforms. He said they succeed when ran locally. It would be nice if we could fix the tests so that we can run integration tests on all platforms automatically to get notified about regressions.
The text was updated successfully, but these errors were encountered: