appveyor user password is required on macos image

TAMAGAWA Hiroko's Avatar

TAMAGAWA Hiroko

29 May, 2020 02:03 PM

Hello, we've been using Visual Studio image so far and just started using macos image.
On the image we'd like to execute automated test on Safari, where we have to execute the command `safaridriver --enable` to enable Safari's remote automation feature as described in https://developer.apple.com/documentation/webkit/testing_with_webdriver_in_safari ("Configure Safari to Enable WebDriver Support" section)

But when we execute the command we're asked to input password (the same thing happens on local machines) and AppVeyor build hangs at the point. Is there any way to go through this?

FYI, `sudo safaridriver --enable` was OK. But the remote automation feature itself was not enabled. I guess we have to execute the command as appveyor user.

  1. Support Staff 1 Posted by Feodor Fitsner on 29 May, 2020 05:01 PM

    Feodor Fitsner's Avatar

    Could you please try the following commands:

    - defaults write com.apple.Safari IncludeDevelopMenu YES
    - defaults write com.apple.Safari AllowRemoteAutomation 1
    - sudo safaridriver --enable
    - safaridriver -p 0 &
    
  2. 2 Posted by TAMAGAWA Hiroko on 30 May, 2020 01:17 AM

    TAMAGAWA Hiroko's Avatar

    Thank you for your quick response, I tried but I couldn't resolve the issue.

    - defaults write com.apple.Safari IncludeDevelopMenu YES
    - defaults write com.apple.Safari AllowRemoteAutomation 1
    

    As far as I have confirmed on my local, Safari's preference is not stored to ~/Library/Preferences/com.apple.Safari.plist anymore on Catalina. Now it's moved to ~/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari.plist, which is not editable because guarded by SIP. The above commands update ~/Library/Preferences/com.apple.Safari.plist, thus no impact on Safari.

    - sudo safaridriver --enable
    

    Strangely, on my local this command works well and actually update Safari settings.
    On AppVeyor the command itself succeeds but Safari settings are not updated.
    Do you have any idea? Is there any difference around the user settings?

  3. 3 Posted by TAMAGAWA Hiroko on 02 Jun, 2020 12:49 AM

    TAMAGAWA Hiroko's Avatar

    Looking at Safari Technology Preview release notes on https://developer.apple.com/safari/technology-preview/release-notes/, I've found this in Release 94.

    WebDriver

    Fixed an issue that prevented sudo safaridriver --enable from working correctly

    I'm not sure which version of Safari corresponds to which STP, but it's suspicious.
    BTW, I have two Mac machines.

    • Machine 1:
      • macOS 10.15.4
      • Safari 13.1
      • sudo safaridriver --enable works
    • Machine 2:
      • macOS 10.15.2
      • Safari 13.0.4
      • sudo safaridriver --enable doesn't work

    On AppVeyor it seems to have Safari 13.0.3.

    Build started
    Running "init" scripts
    cat /Applications/Safari.app/Contents/version.plist
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
        <key>BuildAliasOf</key>
        <string>WebBrowser</string>
        <key>BuildVersion</key>
        <string>8</string>
        <key>CFBundleShortVersionString</key>
        <string>13.0.3</string>
        <key>CFBundleVersion</key>
        <string>15608.3.10.1.4</string>
        <key>ProjectName</key>
        <string>WebBrowser</string>
        <key>SourceVersion</key>
        <string>7608003010001004</string>
    </dict>
    </plist>
    

    Image macos-mojave also failed. So we're going to try Safari Technology Preview instead of Safari for now.

    We'd appreciate if we have macos image that has Safari beyond 13.1, but Safari is tied to macOS itself... Is it difficult?

  4. Support Staff 4 Posted by Feodor Fitsner on 02 Jun, 2020 04:08 AM

    Feodor Fitsner's Avatar

    Thank you for additional details provided!

    We are working on the next macOS images update which will have Safari updated.

    Would you be able to provide us with a very simple test/repro in a public repository which we could run to make sure the image is good? Thank you!

  5. 5 Posted by TAMAGAWA Hiroko on 02 Jun, 2020 05:00 AM

    TAMAGAWA Hiroko's Avatar

    We are working on the next macOS images update which will have Safari updated.

    I'm glad to hear that.

    Would you be able to provide us with a very simple test/repro in a public repository which we could run to make sure the image is good?

    OK, please give me some time.

    FYI, I succeeded in Safari Technology Preview installation on Catalina image, but our test failed again. This time cannot be reproduced on my second machine. I will give up STP now... and am sorry if Safari version is not really related to the problem.

  6. 6 Posted by TAMAGAWA Hiroko on 03 Jun, 2020 04:05 AM

    TAMAGAWA Hiroko's Avatar

    I have prepared a public repository to check macos image. https://github.com/nkns165/safaridriver-smoke-test
    Please note that I'm launching safaridriver inside the script, so there is no command like safaridriver -p XX &

    Latest result https://ci.appveyor.com/project/nkns165/safaridriver-smoke-test/bui...

    I've got some information from my friends. The difference might be whether desktop GUI session exists, rather than OS/Safari version. If so, you don't have to resolve this problem when you version up the image (Of course we're very glad if resolved)
    I don't know how, but GitHub Actions people have added some fix for that. https://github.com/actions/virtual-environments/issues/91

  7. Support Staff 7 Posted by Feodor Fitsner on 03 Jun, 2020 06:42 PM

    Feodor Fitsner's Avatar

    Thanks for additional info provided!

    I've created a new issue to try fixing that issue on the next images update (this week): https://github.com/appveyor/ci/issues/3462

    Also, macOS Catalina will be updated to the latest 15.5.5: https://github.com/appveyor/ci/issues/3420

  8. 8 Posted by TAMAGAWA Hiroko on 04 Jun, 2020 12:52 AM

    TAMAGAWA Hiroko's Avatar

    Many thanks!

  9. Support Staff 9 Posted by Feodor Fitsner on 04 Jun, 2020 01:02 AM

    Feodor Fitsner's Avatar

    I'm testing it on the next image update (not yet public) and it works (I guess as I'm getting green build): https://ci.appveyor.com/project/appveyor-tests/safaridriver-smoke-test

    I've commented sudo safaridriver --enable though as the driver is now enabled in the image.

  10. 10 Posted by TAMAGAWA Hiroko on 04 Jun, 2020 11:49 PM

    TAMAGAWA Hiroko's Avatar

    Great work. We're looking forward to the new image release, thank you.

  11. 11 Posted by TAMAGAWA Hiroko on 05 Jun, 2020 12:03 AM

    TAMAGAWA Hiroko's Avatar

    I feel a little bit worried that the green build didn't output any console log. It's assumed to output

    Safaridriver launched
    Safari worked
    

    My failing build output the first line (because it failed after that)

    Safaridriver launched
    Error: ....
    

    I hope it has no problem.

  12. Support Staff 12 Posted by Feodor Fitsner on 05 Jun, 2020 12:16 AM

    Feodor Fitsner's Avatar

    I see. Looking at the logs again it "could be" the rest of command after set -e was ignored as comment.

    Anyway, I'm going to give it another try today and let you know.

  13. Support Staff 13 Posted by Feodor Fitsner on 05 Jun, 2020 04:13 AM

    Feodor Fitsner's Avatar
  14. 14 Posted by TAMAGAWA Hiroko on 06 Jun, 2020 10:31 AM

    TAMAGAWA Hiroko's Avatar

    Wow, thank you.

  15. Support Staff 15 Posted by Feodor Fitsner on 08 Jun, 2020 07:11 PM

    Feodor Fitsner's Avatar

    Hi Hiroko,

    Updated macOS images have been deployed.

  16. 16 Posted by TAMAGAWA Hiroko on 09 Jun, 2020 01:40 AM

    TAMAGAWA Hiroko's Avatar

    We have also confirmed the fix on our private repository!
    Thank you very much for your quick response/fixes.

  17. TAMAGAWA Hiroko closed this discussion on 09 Jun, 2020 01:40 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac