I’m working on a set of integration tests for the dropbox oauth sequence which finishes in a series of 302 redirects, the last of which is a custom protocol/scheme. Everything works as expected in the mobile app which the testing mimics, and everything bar this works in the integration tests.
The testing environment runs on ubuntu server (no GUI) and is headless using xvfb.
Objectively, I don’t actually need the custom protocol URI to be followed, I just need to get access to the URI to confirm the contents match expectations. I have tried everything I can think of to access the URI containing the custom scheme from within watir/selenium, but all the references I can find say that the underlying detail is deliberately hidden by design.
I have also tried all the options I can find for creating a custom protocol handler within the firefox profile, but no matter what happens the script isn’t called.
Nothing useful is being left in the watir/selenium logs.
Any thoughts?
Custom protocol handler snippet:
# initialise headless
headless = Headless.new( reuse: false )
headless.start
# initialise profile
profile = Selenium::WebDriver::Firefox::Profile.new
profile[ 'general.useragent.override' ] = 'agent'
profile[ 'network.protocol-handler.app.biscuit' ] = '/usr/bin/biscuit'
profile[ 'network.protocol-handler.external.biscuit' ] = true
profile[ 'network.protocol-handler.expose.biscuit' ] = true
profile[ 'network.protocol-handler.warn-external.biscuit' ] = false
# initialise client
client = Selenium::WebDriver::Remote::Http::Persistent.new
# initialise browser
browser = Watir::Browser.new :firefox, profile: profile, accept_insecure_certs: true, http_client: client
# run dropbox authentication cycle
# cleanup
browser.close
headless.destroy