Skip to content

Correct Controller Tests

Latest
Compare
Choose a tag to compare
@samholst samholst released this 14 Oct 20:21

Corrected to use the most recent fork version of controller tests and not the older way.

class TestServer
  getter handler : Amber::Pipe::Pipeline
  
  def initialize
    @handler = Amber::Server.instance.handler
    @handler.prepare_pipelines
    @handler
  end

  def call(context)
    @handler.call(context)
  end
end

module GarnetSpec
  HANDLER = TestServer.new
  PATH = "/usr/local/bin/chromedriver" # Mac
  # PATH = "/usr/bin/chromedriver"        # Linux

  class Server
    CAPABILITIES = {
      browserName:              "chrome",
      version:                  "",
      platform:                 "ANY",
      javascriptEnabled:        true,
      takesScreenshot:          true,
      handlesAlerts:            true,
      databaseEnabled:          true,
      locationContextEnabled:   true,
      applicationCacheEnabled:  true,
      browserConnectionEnabled: true,
      cssSelectorsEnabled:      true,
      webStorageEnabled:        true,
      rotatable:                true,
      acceptSslCerts:           true,
      nativeEvents:             true,
      chromeOptions:            { args: ["--headless", "window-size=1080,1920", "--disable-gpu", "--disable-dev-shm-usage", "--no-sandbox", "--disable-extensions"], w3c: false },
    }
  end
end