capybara

Check element visibility that is visible for less than a second in Rails Capybara

房东的猫 提交于 2021-02-19 08:02:16
问题 I am trying to write an integration test in which I must check the visibility of an element on button click. The code works perfectly in one machine and failing in the other. The element is displayed until the data comes from the backend. So its visibility depends on the speed of the machine also. Is that the problem? This is the code: assert page.has_css?('#my_element_id') assert find('#my_element_id', visible: true) But I am getting an error: expected false to be truthy . Is there any other

Check element visibility that is visible for less than a second in Rails Capybara

大城市里の小女人 提交于 2021-02-19 08:01:26
问题 I am trying to write an integration test in which I must check the visibility of an element on button click. The code works perfectly in one machine and failing in the other. The element is displayed until the data comes from the backend. So its visibility depends on the speed of the machine also. Is that the problem? This is the code: assert page.has_css?('#my_element_id') assert find('#my_element_id', visible: true) But I am getting an error: expected false to be truthy . Is there any other

New Microsoft Edge and Selenium web driver

偶尔善良 提交于 2021-02-11 14:48:05
问题 I am a student and I started writing my first scripts using Ruby, Capybara, rspec and selenium web driver. I need to run my script in all modern browsers, but I'm facing some problems to run my script at the new Microsoft browser Edge. My rspec config is something like this: Capybara.configure do |config| config.default_driver = :selenium #This line is for run tests using Mozilla Firefox #config.default_driver = :selenium_chrome #This line is for run tests using Google Chrome end Edge is just

Capybara open an html file in my computer

流过昼夜 提交于 2021-02-07 04:26:41
问题 I have an html file in my computer and I want to open that file using Capybara to test it. Could you help me to solve this problem? P/S: That html file is created automatically in my app. I do appreciate any idea helping me to solve this problem. Thanks :) UPDATE: Based on the capybara source code here, I found that I should use Capybara.current_session.driver.visit instead of page.visit. The problem is solved 回答1: I can confirm that the update to the question works (assuming the file is in

Capybara open an html file in my computer

你说的曾经没有我的故事 提交于 2021-02-07 04:26:13
问题 I have an html file in my computer and I want to open that file using Capybara to test it. Could you help me to solve this problem? P/S: That html file is created automatically in my app. I do appreciate any idea helping me to solve this problem. Thanks :) UPDATE: Based on the capybara source code here, I found that I should use Capybara.current_session.driver.visit instead of page.visit. The problem is solved 回答1: I can confirm that the update to the question works (assuming the file is in

RSpec + headless Chrome for front-end integration test

末鹿安然 提交于 2021-01-28 11:10:11
问题 I'm trying to test a part of my Rails 5.1 app that makes use of Vue.js. The issue I'm encountering is that, for example when generating a list, the Vue code looks like: <div v-for="(amenity, idx) in amenities"> <div class="custom-control custom-checkbox"> <input type="checkbox" class="custom-control-input" v-bind:id="amenity.text" v-model="checkedAmenities[idx]" :value="amenity.id"> <label class="custom-control-label" v-bind="{ 'for': amenity.text }" >{{ amenity.text }}</label> </div> </div>

Google Fuchsia 会是 Android 终结者吗?

霸气de小男生 提交于 2021-01-12 07:50:16
点击上方“ 开发者技术前线 ”,选择“置顶或者星标” 属于你的文章第一时间送达! 最早关于谷歌新系统 Fuchsia 的消息 出现 在 2016 年,到目前为止,距今已过去近两年。期间,大家一直期望谷歌会公布这款融合了桌面操作系统 Chrome OS 与移动操作系统 Android 的系统的消息。然而经历了两届谷歌开发者大会,除了民间的一些传闻,关于 Fuchsia 的官方消息可谓是屈指可数。 目前,像 Google Pixelbook 这些最好的 Chromebook 跑着 Chrome OS 桌面操作系统,但却可以通过谷歌应用商店运行 Android 应用。然而 Fuchsia 系统却将会更进一步,它将接管谷歌针对手机、平板电脑和 Chromebook 这些设备开发的独特又统一的操作系统的地位。 目前我们还没有看到任何关于谷歌系统 Fuchsia 的发布信息,不过我们也没“跟丢”什么内容。一位 Reddit 用户显然发现了谷歌正在开发"AltOS模式"的证据,该模式允许在某种双启动配置下在 Chrome OS 和“替代操作系统”之间切换,但最近我们发现有消息指出谷歌正在为其硬件添加 Windows 支持 —— 所以这种"AltOS模式"也可能与 Fuchsia 无关。不过,当它最终进入市场时,这可以作为运行 Fuchsia 的一个方法。 切回正题 Fuchsia 是什么

Make capybara wait until Ajax finishes

只愿长相守 提交于 2021-01-07 08:23:09
问题 I have a feature test, where a list of todos are listed on a page and you click on first todo to see the details of that todo. The first todo link has ID todo_1. The issue I'm facing is that I don't know how to wait for the link to appear before I visit it. The todos are listed in a table using an AJAX call. 回答1: Capybara has waiting behavior built in to most of its finders and actions, so you normally don't have to wait specifically for the ajax to finish since Capybara waits for the visible

Make capybara wait until Ajax finishes

随声附和 提交于 2021-01-07 08:22:27
问题 I have a feature test, where a list of todos are listed on a page and you click on first todo to see the details of that todo. The first todo link has ID todo_1. The issue I'm facing is that I don't know how to wait for the link to appear before I visit it. The todos are listed in a table using an AJAX call. 回答1: Capybara has waiting behavior built in to most of its finders and actions, so you normally don't have to wait specifically for the ajax to finish since Capybara waits for the visible