How to use LabCS method in wpt

Best JavaScript code snippet using wpt

colorspace.js

Source:colorspace.js Github

copy

Full Screen

...52 case 'LabCS':53 var whitePoint = IR[1].WhitePoint;54 var blackPoint = IR[1].BlackPoint;55 var range = IR[1].Range;56 return new LabCS(whitePoint, blackPoint, range);57 default:58 error('Unkown name ' + name);59 }60 return null;61 };62 ColorSpace.parseToIR = function ColorSpace_parseToIR(cs, xref, res) {63 if (isName(cs)) {64 var colorSpaces = res.get('ColorSpace');65 if (isDict(colorSpaces)) {66 var refcs = colorSpaces.get(cs.name);67 if (refcs)68 cs = refcs;69 }70 }71 cs = xref.fetchIfRef(cs);72 var mode;73 if (isName(cs)) {74 mode = cs.name;75 this.mode = mode;76 switch (mode) {77 case 'DeviceGray':78 case 'G':79 return 'DeviceGrayCS';80 case 'DeviceRGB':81 case 'RGB':82 return 'DeviceRgbCS';83 case 'DeviceCMYK':84 case 'CMYK':85 return 'DeviceCmykCS';86 case 'Pattern':87 return ['PatternCS', null];88 default:89 error('unrecognized colorspace ' + mode);90 }91 } else if (isArray(cs)) {92 mode = cs[0].name;93 this.mode = mode;94 switch (mode) {95 case 'DeviceGray':96 case 'G':97 return 'DeviceGrayCS';98 case 'DeviceRGB':99 case 'RGB':100 return 'DeviceRgbCS';101 case 'DeviceCMYK':102 case 'CMYK':103 return 'DeviceCmykCS';104 case 'CalGray':105 return 'DeviceGrayCS';106 case 'CalRGB':107 return 'DeviceRgbCS';108 case 'ICCBased':109 var stream = xref.fetchIfRef(cs[1]);110 var dict = stream.dict;111 var numComps = dict.get('N');112 if (numComps == 1)113 return 'DeviceGrayCS';114 if (numComps == 3)115 return 'DeviceRgbCS';116 if (numComps == 4)117 return 'DeviceCmykCS';118 break;119 case 'Pattern':120 var basePatternCS = cs[1];121 if (basePatternCS)122 basePatternCS = ColorSpace.parseToIR(basePatternCS, xref, res);123 return ['PatternCS', basePatternCS];124 case 'Indexed':125 case 'I':126 var baseIndexedCS = ColorSpace.parseToIR(cs[1], xref, res);127 var hiVal = cs[2] + 1;128 var lookup = xref.fetchIfRef(cs[3]);129 if (isStream(lookup)) {130 lookup = lookup.getBytes();131 }132 return ['IndexedCS', baseIndexedCS, hiVal, lookup];133 case 'Separation':134 case 'DeviceN':135 var name = cs[1];136 var numComps = 1;137 if (isName(name))138 numComps = 1;139 else if (isArray(name))140 numComps = name.length;141 var alt = ColorSpace.parseToIR(cs[2], xref, res);142 var tintFnIR = PDFFunction.getIR(xref, xref.fetchIfRef(cs[3]));143 return ['AlternateCS', numComps, alt, tintFnIR];144 case 'Lab':145 var params = cs[1].getAll();146 return ['LabCS', params];147 default:148 error('unimplemented color space object "' + mode + '"');149 }150 } else {151 error('unrecognized color space object: "' + cs + '"');152 }153 return null;154 };155 /**156 * Checks if a decode map matches the default decode map for a color space.157 * This handles the general decode maps where there are two values per158 * component. e.g. [0, 1, 0, 1, 0, 1] for a RGB color.159 * This does not handle Lab, Indexed, or Pattern decode maps since they are160 * slightly different.161 * @param {Array} decode Decode map (usually from an image).162 * @param {Number} n Number of components the color space has.163 */164 ColorSpace.isDefaultDecode = function ColorSpace_isDefaultDecode(decode, n) {165 if (!decode)166 return true;167 if (n * 2 !== decode.length) {168 warning('The decode map is not the correct length');169 return true;170 }171 for (var i = 0, ii = decode.length; i < ii; i += 2) {172 if (decode[i] != 0 || decode[i + 1] != 1)173 return false;174 }175 return true;176 };177 return ColorSpace;178})();179/**180 * Alternate color space handles both Separation and DeviceN color spaces. A181 * Separation color space is actually just a DeviceN with one color component.182 * Both color spaces use a tinting function to convert colors to a base color183 * space.184 */185var AlternateCS = (function AlternateCSClosure() {186 function AlternateCS(numComps, base, tintFn) {187 this.name = 'Alternate';188 this.numComps = numComps;189 this.defaultColor = [];190 for (var i = 0; i < numComps; ++i)191 this.defaultColor.push(1);192 this.base = base;193 this.tintFn = tintFn;194 }195 AlternateCS.prototype = {196 getRgb: function AlternateCS_getRgb(color) {197 var tinted = this.tintFn(color);198 return this.base.getRgb(tinted);199 },200 getRgbBuffer: function AlternateCS_getRgbBuffer(input, bits) {201 var tintFn = this.tintFn;202 var base = this.base;203 var scale = 1 / ((1 << bits) - 1);204 var length = input.length;205 var pos = 0;206 var baseNumComps = base.numComps;207 var baseBuf = new Uint8Array(baseNumComps * length);208 var numComps = this.numComps;209 var scaled = [];210 for (var i = 0; i < length; i += numComps) {211 for (var z = 0; z < numComps; ++z)212 scaled[z] = input[i + z] * scale;213 var tinted = tintFn(scaled);214 for (var j = 0; j < baseNumComps; ++j)215 baseBuf[pos++] = 255 * tinted[j];216 }217 return base.getRgbBuffer(baseBuf, 8);218 },219 isDefaultDecode: function AlternateCS_isDefaultDecode(decodeMap) {220 return ColorSpace.isDefaultDecode(decodeMap, this.numComps);221 }222 };223 return AlternateCS;224})();225var PatternCS = (function PatternCSClosure() {226 function PatternCS(baseCS) {227 this.name = 'Pattern';228 this.base = baseCS;229 }230 PatternCS.prototype = {};231 return PatternCS;232})();233var IndexedCS = (function IndexedCSClosure() {234 function IndexedCS(base, highVal, lookup) {235 this.name = 'Indexed';236 this.numComps = 1;237 this.defaultColor = [0];238 this.base = base;239 this.highVal = highVal;240 var baseNumComps = base.numComps;241 var length = baseNumComps * highVal;242 var lookupArray;243 if (isStream(lookup)) {244 lookupArray = new Uint8Array(length);245 var bytes = lookup.getBytes(length);246 lookupArray.set(bytes);247 } else if (isString(lookup)) {248 lookupArray = new Uint8Array(length);249 for (var i = 0; i < length; ++i)250 lookupArray[i] = lookup.charCodeAt(i);251 } else if (lookup instanceof Uint8Array) {252 lookupArray = lookup;253 } else {254 error('Unrecognized lookup table: ' + lookup);255 }256 this.lookup = lookupArray;257 }258 IndexedCS.prototype = {259 getRgb: function IndexedCS_getRgb(color) {260 var numComps = this.base.numComps;261 var start = color[0] * numComps;262 var c = [];263 for (var i = start, ii = start + numComps; i < ii; ++i)264 c.push(this.lookup[i]);265 return this.base.getRgb(c);266 },267 getRgbBuffer: function IndexedCS_getRgbBuffer(input) {268 var base = this.base;269 var numComps = base.numComps;270 var lookup = this.lookup;271 var length = input.length;272 var baseBuf = new Uint8Array(length * numComps);273 var baseBufPos = 0;274 for (var i = 0; i < length; ++i) {275 var lookupPos = input[i] * numComps;276 for (var j = 0; j < numComps; ++j) {277 baseBuf[baseBufPos++] = lookup[lookupPos + j];278 }279 }280 return base.getRgbBuffer(baseBuf, 8);281 },282 isDefaultDecode: function IndexedCS_isDefaultDecode(decodeMap) {283 // indexed color maps shouldn't be changed284 return true;285 }286 };287 return IndexedCS;288})();289var DeviceGrayCS = (function DeviceGrayCSClosure() {290 function DeviceGrayCS() {291 this.name = 'DeviceGray';292 this.numComps = 1;293 this.defaultColor = [0];294 }295 DeviceGrayCS.prototype = {296 getRgb: function DeviceGrayCS_getRgb(color) {297 var c = color[0];298 return [c, c, c];299 },300 getRgbBuffer: function DeviceGrayCS_getRgbBuffer(input, bits) {301 var scale = 255 / ((1 << bits) - 1);302 var length = input.length;303 var rgbBuf = new Uint8Array(length * 3);304 for (var i = 0, j = 0; i < length; ++i) {305 var c = (scale * input[i]) | 0;306 rgbBuf[j++] = c;307 rgbBuf[j++] = c;308 rgbBuf[j++] = c;309 }310 return rgbBuf;311 },312 isDefaultDecode: function DeviceGrayCS_isDefaultDecode(decodeMap) {313 return ColorSpace.isDefaultDecode(decodeMap, this.numComps);314 }315 };316 return DeviceGrayCS;317})();318var DeviceRgbCS = (function DeviceRgbCSClosure() {319 function DeviceRgbCS() {320 this.name = 'DeviceRGB';321 this.numComps = 3;322 this.defaultColor = [0, 0, 0];323 }324 DeviceRgbCS.prototype = {325 getRgb: function DeviceRgbCS_getRgb(color) {326 return color;327 },328 getRgbBuffer: function DeviceRgbCS_getRgbBuffer(input, bits) {329 if (bits == 8)330 return input;331 var scale = 255 / ((1 << bits) - 1);332 var i, length = input.length;333 var rgbBuf = new Uint8Array(length);334 for (i = 0; i < length; ++i)335 rgbBuf[i] = (scale * input[i]) | 0;336 return rgbBuf;337 },338 isDefaultDecode: function DeviceRgbCS_isDefaultDecode(decodeMap) {339 return ColorSpace.isDefaultDecode(decodeMap, this.numComps);340 }341 };342 return DeviceRgbCS;343})();344var DeviceCmykCS = (function DeviceCmykCSClosure() {345 function DeviceCmykCS() {346 this.name = 'DeviceCMYK';347 this.numComps = 4;348 this.defaultColor = [0, 0, 0, 1];349 }350 DeviceCmykCS.prototype = {351 getRgb: function DeviceCmykCS_getRgb(color) {352 var c = color[0], m = color[1], y = color[2], k = color[3];353 // CMYK -> CMY: http://www.easyrgb.com/index.php?X=MATH&H=14#text14354 c = (c * (1 - k) + k);355 m = (m * (1 - k) + k);356 y = (y * (1 - k) + k);357 // CMY -> RGB: http://www.easyrgb.com/index.php?X=MATH&H=12#text12358 var r = (1 - c);359 var g = (1 - m);360 var b = (1 - y);361 return [r, g, b];362 },363 getRgbBuffer: function DeviceCmykCS_getRgbBuffer(colorBuf, bits) {364 var scale = 1 / ((1 << bits) - 1);365 var length = colorBuf.length / 4;366 var rgbBuf = new Uint8Array(length * 3);367 var rgbBufPos = 0;368 var colorBufPos = 0;369 for (var i = 0; i < length; i++) {370 var cmyk = [];371 for (var j = 0; j < 4; ++j)372 cmyk.push(scale * colorBuf[colorBufPos++]);373 var rgb = this.getRgb(cmyk);374 for (var j = 0; j < 3; ++j)375 rgbBuf[rgbBufPos++] = Math.round(rgb[j] * 255);376 }377 return rgbBuf;378 },379 isDefaultDecode: function DeviceCmykCS_isDefaultDecode(decodeMap) {380 return ColorSpace.isDefaultDecode(decodeMap, this.numComps);381 }382 };383 return DeviceCmykCS;384})();385//386// LabCS: Based on "PDF Reference, Sixth Ed", p.250387//388var LabCS = (function LabCSClosure() {389 function LabCS(whitePoint, blackPoint, range) {390 this.name = 'Lab';391 this.numComps = 3;392 this.defaultColor = [0, 0, 0];393 if (!whitePoint)394 error('WhitePoint missing - required for color space Lab');395 blackPoint = blackPoint || [0, 0, 0];396 range = range || [-100, 100, -100, 100];397 // Translate args to spec variables398 this.XW = whitePoint[0];399 this.YW = whitePoint[1];400 this.ZW = whitePoint[2];401 this.amin = range[0];402 this.amax = range[1];403 this.bmin = range[2];...

Full Screen

Full Screen

gamut.ts

Source:gamut.ts Github

copy

Full Screen

1/* A script converted this file to TypeScript. */2/* tslint:disable */3/*4 * decaffeinate suggestions:5 * DS102: Remove unnecessary code created because of implicit returns6 * DS207: Consider shorter variations of null checks7 * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md8 */9//{info, warn, fail} = require "ut1l/log"10const {11 pow12} = Math;13import rgbM from "./rgb";14import xyzM from "./XYZ";15/*16solveCubic = (a0, a, b, c) -> # see: http://de.wikipedia.org/wiki/Cardanische_Formeln17 * normalize18 a /= a019 b /= a020 c /= a021 * substitute x=z-a/3 => z^3 + p*z + q = 022 p = b - a*a / 323 q = 2*(pow a, 3)/27 - a*b/3 + c24 * calculate dicriminat25 D = (pow p, 3)/27 + q*q/426 if D > 027 D = Math.sqrt D28 ru = -q/2 + D29 rv = -q/2 - D30 if ru < 031 ru = -(pow -ru, 1/3)32 else33 ru = pow ru, 1/334 if rv < 035 rv = -(pow -rv, 1/3)36 else37 rv = pow rv, 1/338 X = ru + rv39 X -= a/340 else if D < 041 ppp = (pow p,3) / 2742 ppp = Math.abs ppp43 ppp = 2 * Math.pow ppp , 1/244 argu = -q/ppp45 phi = Math.acos argu46 phi = phi/347 * alert(phi);48 pp = Math.abs p/349 pp = 2*pow pp, 1/250 X = pp * Math.cos phi51 X -= a/352 else53 fail "D = 0 is not implemented"54 *console.log "solution x = "+X55 *console.log "test: x^3 + a*x^2 + b*x + c = " + ((pow X, 3) + a*X*X + b*X + c)56 info "expect to be 0: " + (X*X*X + a*X*X + b*X + c)57 X58checkSolution = (C, a, b, fy, rgb, nbase, mr, mg, mb) ->59 if C >= 060 X = pow fy + a * C, 361 Z = pow fy + b * C, 362 if not rgb.r?63 rgb.r = nbase[0] * X + nbase[2] * Z + mr64 else info "expected #{rgb.r} == "+ (nbase[0] * X + nbase[2] * Z + mr)65 if not rgb.g?66 rgb.g = nbase[3] * X + nbase[5] * Z + mg67 else info "expected #{rgb.g} == "+ (nbase[3] * X + nbase[5] * Z + mg)68 if not rgb.b?69 rgb.b = nbase[6] * X + nbase[8] * Z + mb70 else info "expected #{rgb.b} == "+ (nbase[6] * X + nbase[8] * Z + mb )71 if rgb.isValid()72 return true73 rgb.r = rgb.g = rgb.b = null74 return false75gammaInv = (rgb, rgbCs) ->76 rgb.r = rgbCs.gammaInv rgb.r77 rgb.g = rgbCs.gammaInv rgb.g78 rgb.b = rgbCs.gammaInv rgb.b79 rgb80*/81class GamutMapping {82 constructor(rgbCs, labCs) {83 /*84 rgbCs.init() # make sure rgb base is initialized85 * store rgb inverse base normalised with lab white point86 a = rgbCs.baseInv87 @nbase = [88 a[0] * @labCs.white.X, a[1] * @labCs.white.Y, a[2] * @labCs.white.Z89 a[3] * @labCs.white.X, a[4] * @labCs.white.Y, a[5] * @labCs.white.Z90 a[6] * @labCs.white.X, a[7] * @labCs.white.Y, a[8] * @labCs.white.Z91 ]92 */93 this.rgbCs = rgbCs;94 this.labCs = labCs;95 }96 LChMaxC(LCh, rgb) {97 // naive binary search implementation98 // TODO: manage correct direct calculation99 let lab, xyz;100 if (rgb == null) { rgb = rgbM(); }101 LCh.C = 0;102 let step = 110;103 let validC = null;104 for (let n = 0; n <= 50; n++) {105 lab = LCh.Lab(lab);106 xyz = this.labCs.XYZ(lab, xyz);107 this.rgbCs.rgb(xyz, rgb);108 if (rgb.isValid()) {109 validC = LCh.C;110 LCh.C += step;111 } else {112 LCh.C -= step;113 }114 step /= 2;115 }116 LCh.C = validC;117 if (validC != null) { // solution found118 return this.rgbCs.rgb((this.labCs.XYZ((LCh.Lab(lab)), xyz)), rgb);119 } else {120 return null;121 }122 }123}124/*125 LChMaxCExp: (LCh, rgb = rgbM.rgb()) ->126 xyz = xyzM.XYZ() # temporary variable127 * valid (r, 0, 0) with given luminance possible?128 r = (pow 16 + LCh.L, 3) / (@labCs.white.Y * 1560896 * @rgbCs.base[3]) # 1560896 = 116^3129 if 0 <= r <= 1 # valid rgb element ?130 r = @rgbCs.gammaInv r # linear rgb -> nonlinear rgb131 _rgb = rgbM.rgb r, 0, 0132 * map to LCh to get hue133 @rgbCs.toXYZ _rgb, xyz134 lab = @labCs.fromXYZ xyz, lab135 lch = lab.LCh lch136 * valid (0, g, 0) with given luminance possible?137 g = (pow 16 + LCh.L, 3) / (@labCs.white.Y * 1560896 * @rgbCs.base[4]) # 1560896 = 116^3138 if 0 <= g <= 1 # valid rgb element ?139 g = @rgbCs.gammaInv g # linear rgb -> nonlinear rgb140 _rgb = rgbM.rgb 0, g, 0141 * map to LCh to get hue142 @rgbCs.toXYZ _rgb, xyz143 lab = @labCs.fromXYZ xyz, lab144 lch = lab.LCh lch145 * valid (0, 0, b) with given luminance possible?146 b = (pow 16 + LCh.L, 3) / (@labCs.white.Y * 1560896 * @rgbCs.base[5]) # 1560896 = 116^3147 if 0 <= b <= 1 # valid rgb element ?148 b = @rgbCs.gammaInv b # linear rgb -> nonlinear rgb149 _rgb = rgbM.rgb 0, 0, b150 * map to LCh to get hue151 @rgbCs.toXYZ _rgb, xyz152 lab = @labCs.fromXYZ xyz, lab153 lch = lab.LCh lch154 else # valid (r, 0, 1) with given luminance possible?155 r = ((pow (16 + LCh.L) / 116, 3) * @labCs.white.Y - @rgbCs.base[5]) / @rgbCs.base[3]156 *lchTest = (@labCs.fromXYZ @rgbCs.toXYZ rgbTest).LCh()157 *lchTest = (@labCs.fromXYZ @rgbCs.toXYZ rgbTest.set 0, 1, 0).LCh()158 *lchTest = (@labCs.fromXYZ @rgbCs.toXYZ rgbTest.set 0, 0, 1).LCh()159 * L and h fixed. maximum C is wanted so that the LCh color is a valid in current rgb color space160 * calculate a,b for chroma 1. Now we need to find the factor for a and b (the chroma)161 a = Math.cos LCh.h162 b = Math.sin LCh.h163 * to XYZ (for now ignore linear case)164 a /= 500165 b /= -200166 * calculate some constant values167 fy = (LCh.L + 16) / 116168 Y = pow(fy, 3)169 mr = @nbase[1] * Y # maximum red value for X / Z params170 mg = @nbase[4] * Y # maximum green value for X / Z params171 mb = @nbase[7] * Y # maximum blue value for X / Z params172 *X = pow(fy + a, 3)173 *Z = pow(fy + b, 3)174 * to linear rgb (maximum value 1)175 *mr = a0 * X + a2 * Z #red176 *mg = a3 * X + a5 * Z #green177 *mb = a6 * X + a8 * Z #blue178 bxr = @nbase[0]179 bzr = @nbase[2]180 bxg = @nbase[3]181 bzg = @nbase[5]182 bxb = @nbase[6]183 bzb = @nbase[8]184 a2 = a*a185 a3 = a2*a186 b2 = b*b187 b3 = b2*b188 fy_3 = 3*fy189 fy2_3 = fy_3*fy190 fy3 = pow fy, 3191 lr = solveCubic bxr*a3 + bzr*b3, fy_3*(bxr*a2 + bzr*b2), fy2_3*(bxr*a + bzr*b), fy3*(bxr+bzr)+mr-1192 rgb.r = 1193 rgb.g = rgb.b = null194 if (checkSolution lr, a, b, fy, rgb, @nbase, mr, mg, mb)195 return gammaInv rgb, @rgbCs196 lg = solveCubic bxg*a3 + bzg*b3, fy_3*(bxg*a2 + bzg*b2), fy2_3*(bxg*a + bzg*b), fy3*(bxg + bzg) + mg-1197 rgb.g = 1198 if (checkSolution lg, a, b, fy, rgb, @nbase, mr, mg, mb)199 return gammaInv rgb, @rgbCs200 lb = solveCubic bxb*a3 + bzb*b3, fy_3*(bxb*a2 + bzb*b2), fy2_3*(bxb*a + bzb*b), fy3*(bxb+bzb)+mb-1201 rgb.b = 1202 if (checkSolution lb, a, b, fy, rgb, @nbase, mr, mg, mb)203 return gammaInv rgb, @rgbCs204 lr0 = solveCubic bxr*a3 + bzr*b3, fy_3*(bxr*a2 + bzr*b), fy2_3*(bxr*a + bzr*b), fy3*(bxr+bzr)+mr205 rgb.r = 0206 if (checkSolution lr0, a, b, fy, rgb, @nbase, mr, mg, mb)207 return gammaInv rgb, @rgbCs208 lg0 = solveCubic bxg*a3 + bzg*b3, fy_3*(bxg*a2 + bzg*b), fy2_3*(bxg*a + bzg*b), fy3*(bxg+bzg)+mg209 rgb.g = 0210 if (checkSolution lg0, a, b, fy, rgb, @nbase, mr, mg, mb)211 return gammaInv rgb, @rgbCs212 lb0 = solveCubic bxb*a3 + bzb*b3, fy_3*(bxb*a2 + bzb*b2), fy2_3*(bxb*a + bzb*b), fy3*(bxb+bzb)+mb213 rgb.b = 0214 if (checkSolution lb0, a, b, fy, rgb, @nbase, mr, mg, mb)215 return gammaInv rgb, @rgbCs216*/...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('wpt');2var wpt = new WebPageTest('www.webpagetest.org');3 if (err) return console.error(err);4 console.log(data);5});6var wpt = require('wpt');7var wpt = new WebPageTest('www.webpagetest.org');8 if (err) return console.error(err);9 console.log(data);10});11var wpt = require('wpt');12var wpt = new WebPageTest('www.webpagetest.org');13 if (err) return console.error(err);14 console.log(data);15});16var wpt = require('wpt');17var wpt = new WebPageTest('www.webpagetest.org');18 if (err) return console.error(err);19 console.log(data);20});21var wpt = require('wpt');22var wpt = new WebPageTest('www.webpagetest.org');23 if (err) return console.error(err);24 console.log(data);25});26var wpt = require('wpt');27var wpt = new WebPageTest('www.webpagetest.org');28 if (err) return console.error(err);29 console.log(data);30});31var wpt = require('wpt');32var wpt = new WebPageTest('www.webpagetest.org');33 if (err) return console.error(err);34 console.log(data);35});

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('./wpt.js');2var fs = require('fs');3var config = JSON.parse(fs.readFileSync('config.json', 'utf8'));4var wpt = new WebPageTest('www.webpagetest.org');5 if (err) return console.error(err);6 console.log(data);7});8var WebPageTest = require('webpagetest');9var wpt = new WebPageTest('www.webpagetest.org');10 if (err) return console.error(err);11 console.log(data);12});

Full Screen

Using AI Code Generation

copy

Full Screen

1exports.lab = Lab.script();2const { describe, it } = exports.lab;3const expect = require('expect.js');4const LabCS = require('lab-cs');5const labCS = new LabCS();6const wpt = require('webpagetest');7const wpt = new WebPageTest('www.webpagetest.org', 'A.12345678901234567890123456789012');8const options = {9};10describe('LabCS', () => {11 it('should return a result', (done) => {12 expect(err).to.be(null);13 expect(result).to.be.an('object');14 done();15 });16 });17});18describe('WPT', () => {19 it('should return a result', (done) => {20 expect(err).to.be(null);21 expect(data).to.be.an('object');22 done();23 });24 });25});

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run wpt automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful