Ruby-Capybara不起作用的Parallel_tests

发布于 2025-02-07 08:09:19 字数 736 浏览 1 评论 0原文

使用Capybara进行简单的登录自动化测试。没有使用数据库。 我正在尝试使用parallel_test GEM同时调用多个测试会话(Chrome浏览器)使用以下命令

parallel_rspec -n 2

调用了两个浏览器,但只有第一个浏览器使用正确的URL启动第二个只是空白。同样,在第一个浏览器输入字段中,登录值和密码值两次(数据碰撞)串联。

框架 - 非轨道。带有Capybara Spec_file的Ruby

config/database.yml

test: &TEST
  adapter: postgresql
  host: localhost
  database: test_db<%= ENV['TEST_ENV_NUMBER'] %>
  encoding: utf8
  username: postgres
  password: postgres

-1

describe '' do
 it '' do
  ENV['TEST_ENV_NUMBER'] = ''
 end
end

Spec_file -2

describe '' do
 it '' do
  ENV['TEST_ENV_NUMBER'] = '2'
 end
end

两个Spec文件在同一文件夹中,

非误差设置的指导很少。任何帮助都将不胜感激。

Running a simple login automation test using Capybara. No database is used.
I am trying to use parallel_test gem to invoke multiple test sessions at the same time (chrome browser) using the following command

parallel_rspec -n 2

two browsers are invoked but only the first one is launched with the correct URL and the second one is simply blank. Also, the login and password values are concatenated twice (data collision) in the first browser input fields.

Framework - Non-rails. Ruby with capybara

config/database.yml

test: &TEST
  adapter: postgresql
  host: localhost
  database: test_db<%= ENV['TEST_ENV_NUMBER'] %>
  encoding: utf8
  username: postgres
  password: postgres

spec_file - 1

describe '' do
 it '' do
  ENV['TEST_ENV_NUMBER'] = ''
 end
end

spec_file - 2

describe '' do
 it '' do
  ENV['TEST_ENV_NUMBER'] = '2'
 end
end

both spec files are in the same folder

There is very little guidance for nonrails setup. Any help would be much appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文