React.js is a relatively new Javascript templating engine that has two-way-bindings like AngularJS or Batman. The interesting idea here is that React keeps a virtual copy of the...
...you can only truncate single lines with CSS by using text-overflow, this small JavaScript library also allows truncating text after multiple lines. Please note: For Internet Explorer, the element...
...it's unavailable, a timeout error is thrown. Now, consider a scenario like this: @javascript Scenario: Receive an e-mail after clicking the fancy link When I follow "fancy link...
...will be running. How is that last item the worst? Consider these steps: Before('@javascript') do # Disable code snippets that embed code to third party services, like Google Analytics, when...
ClockPicker is a JavaScript and Bootstrap implementation of an Android-style time picker which looks and feels great. Unfortunately, it is no longer maintained...
jQuery as new default Javascript library, streaming response support, attr_accessible with roles, prepared statements, easier migrations...
...with a Rails notifier and a RESTful API to write your own notifiers for Javascript, etc. Should we some day wish to do away with the current way we deal...
better_errors is an awesome gem for enhanced error pages in development, featuring a live-REPL for some light debugging...
...the following snippet: require 'headless' headless = Headless.new at_exit do headless.destroy end Before("@selenium,@javascript", "~@no-headless") do headless.start if Capybara.current_driver == :selenium end After("@selenium,@javascript", "~@no-headless") do...
...headless mode if you are running a scenario that is tagged with @selenium or @javascript. If you don't want a specific scenario to hide the selenium browser window, you...
...do not use ID's for CSS. Id's are much better used as javascript hooks so use them for this instead. .list {…} instead of #list {…} Animate an interface using...
...classes not inline styles Inline styles added by javascript are harder to update and maintain, prefer to add classes using javascript. CSS3 transitions can then handle any animations and if...
I recommend install Node.js using nvm. This way you can have multiple Node versions in your ~/.nvm. You also won...
Capybara has a variety of finder methods like find_button to help you look up DOM elements. There are also...
...HTML represented as a string (HTTP response body). It does not evaluate CSS or JavaScript. It uses Nokogiri for parsing the response body. This way you can use query selectors...
...is aware of all visible and hidden elements since it parses CSS rules and JavaScript, too. Conclusion In my opinion I would not recommend to ignore hidden elements by default...
Today I learned that you can animate HTML elements using the Web Animation API's method .animate(keyframes, options) (which...
I just ran into this deployment error after switching from the asset pipeline to webpack: 01:05 deploy:assets:precompile...
dragging the finger after touchstart touching the element for a long time an JavaScript event handler calling event.preventDefault() on the touchstart event an JavaScript event handler calling event.preventDefault() on...
...will never fire. Only these events will fire: touchstart touchend Caveats when canceling with JavaScript When you call event.preventDefault() on the touchstart or touchend event, you can prevent the subsequent...
TagCanvas is a Javascript class which will draw and animate a HTML5 canvas based tag cloud...
Although it's tempting flirt with detecting mobile/touch devices with CSS media queries or Javascript feature detection alone, this approach will be painful when heavily customizing a feature beyond just...
...Ruby method touch_device? for your Rails views and a method TouchDevice.isPresent() for your Javascripts. Note that we are detecting touch devices by grepping the user agent, and the keyword...
These steps are now part of Spreewald. Here are some useful examples how to use the attached Cucumber Timecop steps...
Angular 1.3+ has an alternative getter/setter pattern: You can bind ng-model to an accessor function. This is a function...
shoelace is a library of web components. Here is a proof of concept how a integration (slightly different as the...
...after each scenario: After do if Capybara.current_driver == :selenium && !Capybara.current_url.starts_with?('data:') page.execute_script <<-JAVASCRIPT localStorage.clear(); sessionStorage.clear(); JAVASCRIPT end
Building application assets with esbuild is the new way to do it, and it's great, especially in combination with...
Here is how to switch your Selenium to Chrome: Make sure you've got a recent version of chromedriver in...
...is the string format that represents simple data structures. Ruby data structures that resemble Javascript objects can be serialized to JSON with #to_json. These can be restored from a...