(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| =Navigating= | |
| visit('/projects') | |
| visit(post_comments_path(post)) | |
| =Clicking links and buttons= | |
| click_link('id-of-link') | |
| click_link('Link Text') | |
| click_button('Save') | |
| click('Link Text') # Click either a link or a button | |
| click('Button Value') |
| this.Element && function(ElementPrototype) { | |
| ElementPrototype.matchesSelector = ElementPrototype.matchesSelector || | |
| ElementPrototype.mozMatchesSelector || | |
| ElementPrototype.msMatchesSelector || | |
| ElementPrototype.oMatchesSelector || | |
| ElementPrototype.webkitMatchesSelector || | |
| function (selector) { | |
| var node = this, nodes = (node.parentNode || node.document).querySelectorAll(selector), i = -1; | |
| while (nodes[++i] && nodes[i] != node); |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| /* | |
| * Takes provided URL passed as argument and make full height screenshots of this page | |
| * with several viewport widths using Nightwatch.js with Selenium. | |
| * | |
| * These viewport widths are taken from common android and iOS devices. Modify as needed. | |
| * | |
| * Takes an optional second argument for the path where screenshots are saved. | |
| * | |
| * Usage: | |
| * $ nightwatch -t viewport-shots.js http://example.com |
| // Refer to https://gist.github.com/remy/350433 | |
| try { | |
| // Test webstorage existence. | |
| if (!window.localStorage || !window.sessionStorage) throw "exception"; | |
| // Test webstorage accessibility - Needed for Safari private browsing. | |
| localStorage.setItem('storage_test', 1); | |
| localStorage.removeItem('storage_test'); | |
| } catch(e) { | |
| (function () { | |
| var Storage = function (type) { |
| module.exports = function ( grunt ) { | |
| /** | |
| * Load required Grunt tasks. These are installed based on the versions listed | |
| * in `package.json` when you do `npm install` in this directory. | |
| */ | |
| grunt.loadNpmTasks('grunt-contrib-clean'); | |
| grunt.loadNpmTasks('grunt-contrib-copy'); | |
| grunt.loadNpmTasks('grunt-contrib-jshint'); | |
| grunt.loadNpmTasks('grunt-contrib-concat'); |
| import React, { PropTypes } from 'react'; | |
| import Select from 'react-select'; | |
| import 'react-select/dist/react-select.css'; | |
| RFReactSelect.defaultProps = { | |
| multi: false, | |
| className: "" | |
| }; | |
| RFReactSelect.propTypes = { |
| import {Action, ActionCreator, Dispatch} from 'redux'; | |
| import {ThunkAction} from 'redux-thunk'; | |
| // Redux action | |
| const reduxAction: ActionCreator<Action> = (text: string) => { | |
| return { | |
| type: SET_TEXT, | |
| text | |
| }; | |
| }; |
| const md5File = require('md5-file'); | |
| const path = require('path'); | |
| // CSS styles will be imported on load and that complicates matters... ignore those bad boys! | |
| const ignoreStyles = require('ignore-styles'); | |
| const register = ignoreStyles.default; | |
| // We also want to ignore all image requests | |
| // When running locally these will load from a standard import | |
| // When running on the server, we want to load via their hashed version in the build folder |