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
Safari requires user intervention to proceed #1387
Comments
@step2yeung I don't have a lot of time to look into this either, but I did spend a bit of time poking around. I wasn't able to locate any information about the CLI arguments/parameters for calling Safari. Do you know where there might be information on this? From testing with a static file I was able to find that if you accept the prompt once, it won't ask you again for the same file. But with the random temp folders used by testem, it doesn't seem like something that could even be used as a work around. I have seen most people using |
@step2yeung perhaps this open issue from the karma safari launcher might provide some helpful information. karma-runner/karma-safari-launcher#29 |
Perhaps we could have an alias in a static location that gets updated to point to to the temp folder on run? Perhaps Apple is clever enough to catch this, though... Not a great solution, either way. |
I have ran into this as well with Github Actions VMs and locally as well. There's something for Karma via AppleScript to workaround this. https://github.com/brandonocasey/karma-safari-applescript-launcher. |
Safari support has been broken due to testem#1387, which makes it unusable in CI. This change switches to a strategy of launching Safari via AppleScript instead of invoking it directly. Locally, the first time you do this you need to grant Terminal permissions to control Safari. I will see whether this works in CI on GitHub actions...
I have a workaround that you can put in your testem config. This works both locally for me on Big Sur and on GitHub Actions launch_in_ci: ['SafariApplescript'],
launchers: {
SafariApplescript: {
protocol: 'browser',
exe: 'osascript',
args: [
'-e',
`tell application "Safari"
activate
open location "<url>"
end tell
delay 3000`,
],
},
}, The delay is there because |
We could upstream this directly as the launcher for |
In Safari 13 on macOS 10.15 (Catalina), the user is required to confirm the start.html file being loaded into the browser before the tests will proceed. This is likely causing the tests to hang and timeout when running in the macOS runner on GitHub Actions.
To reproduce on macOS 10.15:
node ../../testem.js ci --file testem.json --launch Safari
Notice that when Safari is opened, the file open dialog is opened and requires the user to confirm or cancel the file to load.
The text was updated successfully, but these errors were encountered: