Month: December 2019

Test Stripe.js Elements with Capybara

To access and test Stripe.js Element objects with Capybara, try the following: card_frame = page.evaluate_script(“$(\”iframe[src*=’fieldName’]\”).attr(\”name\”)”) within_frame card_frame do   find(“.InputElement”).set(“value”) end Where fieldName is the name of the Stripe.js Element, for example ‘cardNumber’, and the value is whatever you would like to set the field value to (e.g. 4242 4242 4242 4242) Note, you may need […]

Github: Expand all collapsed files in PR diffs

GitHub will occasionally hide the Diff for various files in your pull requests (PRs). During a large review, this can get a little annoying. I wanted to avoid installing an extension to solve the problem, so this code will open each of the “Load Diff” areas automatically from the console: for(i=0; iā€¹document.getElementsByClassName(“js-button-text”).length; i++){ document.getElementsByClassName(“js-button-text”)[i].click();}