Example
/*
* In window A's scripts, with A being on <http://example.com:8080>:
*/
var popup = window.open(...popup details...);
// When the popup has fully loaded, if not blocked by a popup blocker:| // All Backbone objects have the extend method built in. | |
| // This serves the same primary purpose as Coffeescript's extends keyword. | |
| // After all, they were actually written by the same person: Jeremey Ashkenas | |
| // Coffeescript Implementation for Backbone Model | |
| class Entities.User extends Backbone.Model | |
| defaults: | |
| firstName: "Brian" | |
| initialize: -> |
| Backbone.sync = (method, entity, options = {}) -> | |
| ## THIS WORKS | |
| _.each ["beforeSend", "complete", "error"], (fn) -> | |
| options[fn] or= -> | |
| orig = options[fn] | |
| options[fn] = -> | |
| orig.apply(entity, arguments) | |
| methods[fn].apply(entity, arguments) |
| resortView: -> | |
| @collection.each (model, index) => | |
| view = @children.findByModel(model) | |
| @moveViewToIndex(view, index) if view._index isnt index | |
| moveViewToIndex: (view, index) -> | |
| view._index = index | |
| sibling = view.$el.siblings().eq(index) | |
| view.$el.insertBefore(sibling) |
Example
/*
* In window A's scripts, with A being on <http://example.com:8080>:
*/
var popup = window.open(...popup details...);
// When the popup has fully loaded, if not blocked by a popup blocker:{
"cypress": {
"testFolder": "app/test/spec",
"fixturesFolder": "app/test/spec/_fixtures",
"supportFolder": "app/test/spec/_support",
"viewportWidth": 1300,
"viewportHeight": 660
}
}| chalk = require("chalk") | |
| asciify = require("asciify") | |
| asteriks = Array(90).join("*") | |
| log = { | |
| newLine: (num = 1) -> | |
| n = Array(num).join("\n") | |
| console.log(n) | |
| } |
| // if you open your chrome dev tools | |
| // you'll see it log out the performance | |
| // of each iterating in the console | |
| var array = Array(100) | |
| console.time("var") | |
| for (i = 0; i < array.length; i++) { | |
| var e = array[i] | |
| for (j = 0; j < array.length; j++) { |
| cy | |
| .get("ul[class='nav menu'] a").then(function($a){ | |
| var hrefs = $a.map(function(i, el){ | |
| return Cypress.$(el).attr("href") | |
| }).get() | |
| hrefs.forEach(function(href){ | |
| cy.visit("http://your.url" + href).should("not.contain", "your 404 message") | |
| // you might also try this |
| Cypress.addChildCommand("arrowdown", function($el){ | |
| var evt = new Event("keydown", { | |
| bubbles: true, | |
| cancelable: true, | |
| altKey: false, | |
| ctrlKey: false, | |
| metaKey: false, | |
| shiftKey: false, | |
| location: 0, | |
| charCode: 0, |
| Cypress.addDualCommand({ | |
| contains: function(subject, filter, text, options) { | |
| var checkToAutomaticallyRetry, getErr, getFirstDeepestElement, getOpts, getPhrase, onConsole, resolveElements, selector, setEl; | |
| if (options == null) { | |
| options = {}; | |
| } | |
| if (subject && !Cypress.Utils.hasElement(subject)) { | |
| subject = null; | |
| } | |
| switch (false) { |