Skip to content

Instantly share code, notes, and snippets.

@artygus
Created June 7, 2020 21:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save artygus/3ac4dd463658e288caf2742e15b97514 to your computer and use it in GitHub Desktop.
Save artygus/3ac4dd463658e288caf2742e15b97514 to your computer and use it in GitHub Desktop.
Capyabara-chrome visible text lag
source "https://rubygems.org"
gem "minitest"
gem "rake"
gem "capybara"
gem "selenium-webdriver"
gem "webdrivers"
<html>
<head>
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet">
</head>
<body>
<div id="block" style="display:none">
<% 1000.times do |i| %>
<div id="block-<%= i %>">text-<%= i %></div>
<% end %>
</div>
<button onclick="setTimeout(() => { document.body.insertAdjacentText('beforeend', 'new-text') }, 100)" type="button" id="btn">add text</button>
</body>
</html>
require "minitest/autorun"
require 'capybara/minitest'
require 'webdrivers'
class CapybaraTestCase < Minitest::Test
include Capybara::DSL
include Capybara::Minitest::Assertions
def setup
Capybara.default_driver = :selenium_chrome_headless
end
def test_zhopa
visit "http://localhost:3000/test"
click_on "add text"
assert_text page, "new-text"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment