Created
June 7, 2020 21:24
-
-
Save artygus/3ac4dd463658e288caf2742e15b97514 to your computer and use it in GitHub Desktop.
Capyabara-chrome visible text lag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source "https://rubygems.org" | |
gem "minitest" | |
gem "rake" | |
gem "capybara" | |
gem "selenium-webdriver" | |
gem "webdrivers" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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