Skip to content

Instantly share code, notes, and snippets.

@codinguncut
Last active November 14, 2020 23:07
Show Gist options
  • Save codinguncut/9db7be8efd2e117a12704adadddf825b to your computer and use it in GitHub Desktop.
Save codinguncut/9db7be8efd2e117a12704adadddf825b to your computer and use it in GitHub Desktop.

Required for full Cypress support

  1. get/set/clear cookies by domain
  2. screenshot page
  3. record video of page (this can be done via getUserMedia api if it supports capturing the browser tab, which we do in firefox)
  4. a way to set a proxy server for all network traffic
  5. bypass the invalid ssl cert screen/prompt

Notes

  • It is not possible to pass any command line arguments to Safari.
  • Using Isolated Test Automation window, it disallows interaction with the window which is a major problem for how cypress works, at least for interactive mode.

AppleScript

use AppleScript to automate Safari

disable ssl check via console/ bookmarklet

get/set/clear cookies by domain

It sounds like you need to get/set/clear cookies for domains other than the one currently loaded, is that right? It looks like the only way of doing that using WebDriver/safaridriver would be to load a page from that domain and then use the endpoints with an implicit domain, but that's not great.

record video of page

I don't think this is possible, but I did have fun recording the whole macOS VM in Azure Pipelines using screencapture once. One can also record a specific window, but I presume you want the content area without decorations.

a way to set a proxy server for all network traffic

I'm pretty sure this is not possible yet.

a way to bypass the invalid ssl cert screen/prompt

I wouldn't be surprised if this is already possible with some setting or command line argument, but I don't know what it is. Our setup for web-platform-tests is a bit special, we update /etc/hosts and add a certificate to the system certificate store. It's a bit much, and also requires that you know what the domains under test are before you start the tests, which is probably not the case for Cypress.

source

Video Recording

Web Extension

Allow Remote Automation

Safari Webdriver

Isolated Automation Windows

"These isolated sessions also help to ensure that tests are unaffected by a previous test session’s persistent state." isolated automation windows

SSL Certs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment