使用testingbot,无法在zalenkum仪表板上获取视频

时间:2019-06-19 15:25:50

标签: zalenium

1。总结问题


使用testingbot,测试完成后,无法在仪表板上获取视频。

在zalenium容器的以下路径中,视频不存在。

    CREATE TABLE  pdm2019.tabela_objecto_area
    (
    identificador integer NOT NULL DEFAULT nextval('pdm2019.tabela_objecto_area_identificador_seq'::regclass),
    dtcc character varying(4) NOT NULL DEFAULT '0101',
    planta_po boolean NOT NULL,
    indice_sequencial_po integer,
    -- tema_po character varying(254), -- use a view to populate these
    -- subtema_po character varying(254), -- use a view to populate these
    -- designacao_po character varying(254), -- use a view to populate these
    CONSTRAINT tabela_objecto_area_pkey PRIMARY KEY (identificador)
    )
    WITH (
      OIDS=FALSE
    );

    CREATE VIEW v_tabela_objecto_area as (
    select a.*, b.tema_po, b.subtema_po, b.designacao_po 
    from tabela_objecto_area a, tabela_is_po b
    where a.indice_sequencial_po = b.indice_sequencial_po);

另一方面,我使用本地的elgalu / selenium,可以在仪表板上获取视频,而没有任何问题。

我可以使用zalenium + testingbot获得视频吗?

2。我已经尝试过


在测试结束时,zalenium似乎从以下代码显示的URL获取视频。

https://github.com/zalando/zalenium/blob/4d27dde9cf04e95fa49f4bc7e5d0b781af7761de/src/main/java/de/zalando/ep/zalenium/proxy/TestingBotRemoteProxy.java#L103

/home/seluser/videos

在zalenium容器中,我确认可以使用密钥和机密访问此API。

3。一些代码和组件版本


  • docker:18.06.1-ce
  • docker-compose:1.17.1
  • li / za id:150b95a0aa6b 创建于:2019-06-17T06:23:59.635702925Z
  • elgalu /硒 id:4afe4ce965ee 创建于:2019-06-05T06:01:05.71727027Z
  • 操作系统:ubuntu 18.04.2
  • docker-compose.yml
https://api.testingbot.com/v1/tests/<session_id>
  • 有关驱动程序(base.rb)的mytest脚本
version: '2'
services:
  selenium-hub:
    container_name: selenium-hub
    env_file:
      - ./env/env.secret
    environment:
      TESTINGBOT_KEY: <my_key>
      TESTINGBOT_SECRET: <my_secret>
      TESTINGBOT_URL: http://hub.testingbot.com:80
    image: dosel/zalenium:latest
    ports:
      - 4444:4444
    volumes:
      - /dev/shm:/dev/shm
      - /var/run/docker.sock:/var/run/docker.sock
      - /tmp/videos:/home/seluser/videos
    privileged: true
    stdin_open: true
    tty: true
    command: >
      start
        --timeZone "Asia/Tokyo"
        --testingBotEnabled true
  • common / capabilities.rb
require 'selenium-webdriver'
require 'test/unit'
require 'common/capabilities'
module TestSets
  class Base < Test::Unit::TestCase
    attr_accessor(:driver, :target_host)
    self.test_order = :defined

    def setup
      set_driver
      @target_host = <target url>
      @accept_next_alert = true
      @verification_errors = []
      set_window_size

      # set timezone
      ENV['TZ'] = "Asia/Tokyo"
    end

    def teardown
      @driver.quit
      assert_equal [], @verification_errors
    end

    def set_window_size
      @driver.manage.window.resize_to(1600, 1024)
    end

    def set_driver
      set_driver_remote(Capabilities.win10_ie11)
    end

    private

    def set_driver_remote(caps)
      @driver = Selenium::WebDriver.for(
        :remote,
        url: remote_url,
        desired_capabilities: caps,
        http_client: http_client,
      )
    end

    def http_client
      client = Selenium::WebDriver::Remote::Http::Default.new
      client.read_timeout = 90
      client
    end

    def remote_url
      testingbot_url
    end

    def testingbot_url
      %(https://#{Settings.testingbot.key}:#{Settings.testingbot.secret}@hub.testingbot.com/wd/hub)
    end
  end
end

1 个答案:

答案 0 :(得分:0)

谢谢您的帮助。

我了解原因。

在创建硒驱动程序时指定的URL直接指定了测试机器人,而没有指定zalenium集线器。

右: http://selenium-hub:4444/wd/hub

错误: https://# {Settings.testingbot.key}:#{Settings.testingbot.secret} @ hub.testingbot.com / wd / hub

问题很简单。