使用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获得视频吗?
在测试结束时,zalenium似乎从以下代码显示的URL获取视频。
/home/seluser/videos
在zalenium容器中,我确认可以使用密钥和机密访问此API。
https://api.testingbot.com/v1/tests/<session_id>
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
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
答案 0 :(得分:0)
谢谢您的帮助。
我了解原因。
在创建硒驱动程序时指定的URL直接指定了测试机器人,而没有指定zalenium集线器。
右: http://selenium-hub:4444/wd/hub
错误: https://# {Settings.testingbot.key}:#{Settings.testingbot.secret} @ hub.testingbot.com / wd / hub
问题很简单。