How to use drawLabel method in storybook-root

Best JavaScript code snippet using storybook-root

TextAtlasRender.ts

Source:TextAtlasRender.ts Github

copy

Full Screen

1//////////////////////////////////////////////////////////////////////////////////////2//3// Copyright (c) 2014-present, Egret Technology.4// All rights reserved.5// Redistribution and use in source and binary forms, with or without6// modification, are permitted provided that the following conditions are met:7//8// * Redistributions of source code must retain the above copyright9// notice, this list of conditions and the following disclaimer.10// * Redistributions in binary form must reproduce the above copyright11// notice, this list of conditions and the following disclaimer in the12// documentation and/or other materials provided with the distribution.13// * Neither the name of the Egret nor the14// names of its contributors may be used to endorse or promote products15// derived from this software without specific prior written permission.16//17// THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS "AS IS" AND ANY EXPRESS18// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES19// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.20// IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,21// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT22// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,23// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF24// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING25// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,26// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.27//28//////////////////////////////////////////////////////////////////////////////////////29namespace egret.web {30 //测试开关,打开会截住老的字体渲染31 export const textAtlasRenderEnable: boolean = false;32 //测试对象, 先不用singleton的,后续整理代码,就new一个,放在全局的context上做成员变量33 export let __textAtlasRender__: TextAtlasRender = null;34 //不想改TextNode的代码了,先用这种方式实现,以后稳了再改35 export const property_drawLabel: string = 'DrawLabel';36 //开启这个,用textAtlas渲染出来的,都是红字,而且加黑框37 const textAtlasDebug: boolean = false;38 //画一行39 export class DrawLabel extends HashObject {40 //池子,防止反复创建41 private static pool: DrawLabel[] = [];42 //记录初始位置43 public anchorX: number = 0;44 public anchorY: number = 0;45 //要画的字块46 public textBlocks: TextBlock[] = [];47 //清除数据,回池48 private clear(): void {49 this.anchorX = 0;50 this.anchorY = 0;51 this.textBlocks.length = 0; //这个没事,实体在book里面存着52 }53 //池子创建54 public static create(): DrawLabel {55 const pool = DrawLabel.pool;56 if (pool.length === 0) {57 pool.push(new DrawLabel);58 }59 return pool.pop();60 }61 //回池62 public static back(drawLabel: DrawLabel, checkRepeat: boolean): void {63 if (!drawLabel) {64 return;65 }66 const pool = DrawLabel.pool;67 if (checkRepeat && pool.indexOf(drawLabel) >= 0) {68 console.error('DrawLabel.back repeat');69 return;70 }71 drawLabel.clear();72 pool.push(drawLabel);73 }74 }75 //记录样式的76 class StyleInfo extends HashObject {77 //各种记录信息78 public readonly textColor: number;79 public readonly strokeColor: number;80 public readonly size: number;81 public readonly stroke: number;82 public readonly bold: boolean;83 public readonly italic: boolean;84 public readonly fontFamily: string;85 public readonly font: string;86 public readonly format: sys.TextFormat = null;87 public readonly description: string;88 //89 constructor(textNode: sys.TextNode, format: sys.TextFormat) {90 super();91 //debug强制红色92 let saveTextColorForDebug = 0;93 if (textAtlasDebug) {94 saveTextColorForDebug = textNode.textColor;95 textNode.textColor = 0xff0000;96 }97 //存上98 this.textColor = textNode.textColor;99 this.strokeColor = textNode.strokeColor;100 this.size = textNode.size;101 this.stroke = textNode.stroke;102 this.bold = textNode.bold;103 this.italic = textNode.italic;104 this.fontFamily = textNode.fontFamily;105 this.format = format;106 this.font = getFontString(textNode, this.format);107 //描述用于生成hashcode108 const textColor = (!format.textColor ? textNode.textColor : format.textColor);109 const strokeColor = (!format.strokeColor ? textNode.strokeColor : format.strokeColor);110 const stroke = (!format.stroke ? textNode.stroke : format.stroke);111 const size = (!format.size ? textNode.size : format.size);112 //113 this.description = '' + this.font + '-' + size;114 this.description += '-' + toColorString(textColor);115 this.description += '-' + toColorString(strokeColor);116 if (stroke) {117 this.description += '-' + stroke * 2;118 }119 //还原120 if (textAtlasDebug) {121 textNode.textColor = saveTextColorForDebug;122 }123 }124 }125 //测量字体和绘制的126 class CharImageRender extends HashObject {127 //要渲染的字符串128 public char: string = '';129 //StyleInfo130 public styleInfo: StyleInfo = null;131 //生成hashcode的字符串132 public hashCodeString: string = '';133 //字母:style设置行程唯一值134 public charWithStyleHashCode: number = 0;135 //测量实际的size136 public measureWidth: number = 0;137 public measureHeight: number = 0;138 //边缘放大之后的偏移139 public canvasWidthOffset: number = 0;140 public canvasHeightOffset: number = 0;141 //描边的记录142 public stroke2: number = 0;143 //针对中文的加速查找144 private static readonly chineseCharactersRegExp: RegExp = new RegExp("^[\u4E00-\u9FA5]$");145 private static readonly chineseCharacterMeasureFastMap: { [index: string]: number } = {};146 public reset(char: string, styleKey: StyleInfo): CharImageRender {147 this.char = char;148 this.styleInfo = styleKey;149 this.hashCodeString = char + ':' + styleKey.description;150 this.charWithStyleHashCode = NumberUtils.convertStringToHashCode(this.hashCodeString);151 this.canvasWidthOffset = 0;152 this.canvasHeightOffset = 0;153 this.stroke2 = 0;154 return this;155 }156 public measureAndDraw(targetCanvas: HTMLCanvasElement): void {157 const canvas = targetCanvas;158 if (!canvas) {159 return;160 }161 //读取设置162 const text = this.char;163 const format: sys.TextFormat = this.styleInfo.format;164 const textColor = (!format.textColor ? this.styleInfo.textColor : format.textColor);165 const strokeColor = (!format.strokeColor ? this.styleInfo.strokeColor : format.strokeColor);166 const stroke = (!format.stroke ? this.styleInfo.stroke : format.stroke);167 const size = (!format.size ? this.styleInfo.size : format.size);168 //开始测量---------------------------------------169 this.measureWidth = this.measure(text, this.styleInfo, size);170 this.measureHeight = size;//this.styleInfo.size;171 //调整 参考TextField: $getRenderBounds(): Rectangle {172 let canvasWidth = this.measureWidth;173 let canvasHeight = this.measureHeight;174 const _strokeDouble = stroke * 2;175 if (_strokeDouble > 0) {176 canvasWidth += _strokeDouble * 2;177 canvasHeight += _strokeDouble * 2;178 }179 this.stroke2 = _strokeDouble;180 //赋值181 canvas.width = canvasWidth = Math.ceil(canvasWidth) + 2 * 2;182 canvas.height = canvasHeight = Math.ceil(canvasHeight) + 2 * 2;183 this.canvasWidthOffset = (canvas.width - this.measureWidth) / 2;184 this.canvasHeightOffset = (canvas.height - this.measureHeight) / 2;185 //全部保留numberOfPrecision位小数186 const numberOfPrecision = 3;187 const precision = Math.pow(10, numberOfPrecision);188 this.canvasWidthOffset = Math.floor(this.canvasWidthOffset * precision) / precision;189 this.canvasHeightOffset = Math.floor(this.canvasHeightOffset * precision) / precision;190 //再开始绘制---------------------------------------191 const context = egret.sys.getContext2d(canvas);192 context.save();193 context.textAlign = 'center';194 context.textBaseline = 'middle';195 context.lineJoin = 'round';196 context.font = this.styleInfo.font;197 context.fillStyle = toColorString(textColor);198 context.strokeStyle = toColorString(strokeColor);199 context.clearRect(0, 0, canvas.width, canvas.height);200 if (stroke) {201 context.lineWidth = stroke * 2;202 context.strokeText(text, canvas.width / 2, canvas.height / 2);203 }204 context.fillText(text, canvas.width / 2, canvas.height / 2);205 context.restore();206 }207 private measure(text: string, styleKey: StyleInfo, textFlowSize: number): number {208 const isChinese = CharImageRender.chineseCharactersRegExp.test(text);209 if (isChinese) {210 if (CharImageRender.chineseCharacterMeasureFastMap[styleKey.font]) {211 return CharImageRender.chineseCharacterMeasureFastMap[styleKey.font];212 }213 }214 const measureTextWidth = egret.sys.measureText(text, styleKey.fontFamily, textFlowSize || styleKey.size, styleKey.bold, styleKey.italic);215 if (isChinese) {216 CharImageRender.chineseCharacterMeasureFastMap[styleKey.font] = measureTextWidth;217 }218 return measureTextWidth;219 }220 }221 //对外的类222 export class TextAtlasRender extends HashObject {223 private readonly book: Book = null;224 private readonly charImageRender: CharImageRender = new CharImageRender;225 private readonly textBlockMap: { [index: number]: TextBlock } = {};226 private _canvas: HTMLCanvasElement = null;227 private readonly textAtlasTextureCache: WebGLTexture[] = [];228 private readonly webglRenderContext: WebGLRenderContext = null;229 //230 constructor(webglRenderContext: WebGLRenderContext, maxSize: number, border: number) {231 super();232 this.webglRenderContext = webglRenderContext;233 this.book = new Book(maxSize, border);234 }235 //分析textNode,把数据提取出来,然后给textNode挂上渲染的信息236 public static analysisTextNodeAndFlushDrawLabel(textNode: sys.TextNode): void {237 if (!textNode) {238 return;239 }240 if (!__textAtlasRender__) {241 //创建,后续会转移给WebGLRenderContext242 const webglcontext = egret.web.WebGLRenderContext.getInstance(0, 0);243 //初期先512,因为不会大规模batch, 老项目最好不要直接使用这个,少数几个总变内容的TextField可以用,所以先不用$maxTextureSize244 __textAtlasRender__ = new TextAtlasRender(webglcontext, textAtlasDebug ? 512 : 512/*webglcontext.$maxTextureSize*/, textAtlasDebug ? 12 : 1);245 }246 //清除命令247 textNode[property_drawLabel] = textNode[property_drawLabel] || [];248 let drawLabels = textNode[property_drawLabel] as DrawLabel[];249 for (const drawLabel of drawLabels) {250 //还回去251 DrawLabel.back(drawLabel, false);252 }253 drawLabels.length = 0;254 //重新装填255 const offset = 4;256 const drawData = textNode.drawData;257 let anchorX = 0;258 let anchorY = 0;259 let labelString = '';260 let labelFormat: sys.TextFormat = {};261 let resultAsRenderTextBlocks: TextBlock[] = [];262 for (let i = 0, length = drawData.length; i < length; i += offset) {263 anchorX = drawData[i + 0] as number;264 anchorY = drawData[i + 1] as number;265 labelString = drawData[i + 2] as string;266 labelFormat = drawData[i + 3] as sys.TextFormat || {};267 resultAsRenderTextBlocks.length = 0;268 //提取数据269 __textAtlasRender__.convertLabelStringToTextAtlas(labelString, new StyleInfo(textNode, labelFormat), resultAsRenderTextBlocks);270 //pool创建 + 添加命令271 const drawLabel = DrawLabel.create();272 drawLabel.anchorX = anchorX;273 drawLabel.anchorY = anchorY;274 drawLabel.textBlocks = [].concat(resultAsRenderTextBlocks);275 drawLabels.push(drawLabel);276 }277 }278 //字符串转化成为TextBlock279 private convertLabelStringToTextAtlas(labelstring: string, styleKey: StyleInfo, resultAsRenderTextBlocks: TextBlock[]): void {280 const canvas = this.canvas;281 const charImageRender = this.charImageRender;282 const textBlockMap = this.textBlockMap;283 for (const char of labelstring) {284 //不反复创建285 charImageRender.reset(char, styleKey);286 if (textBlockMap[charImageRender.charWithStyleHashCode]) {287 //检查重复288 resultAsRenderTextBlocks.push(textBlockMap[charImageRender.charWithStyleHashCode]);289 continue;290 }291 //画到到canvas292 charImageRender.measureAndDraw(canvas);293 //创建新的文字块294 const txtBlock = this.book.createTextBlock(char,295 canvas.width, canvas.height,296 charImageRender.measureWidth, charImageRender.measureHeight,297 charImageRender.canvasWidthOffset, charImageRender.canvasHeightOffset,298 charImageRender.stroke2);299 if (!txtBlock) {300 continue;301 }302 //需要绘制303 resultAsRenderTextBlocks.push(txtBlock);304 //记录快速查找305 textBlockMap[charImageRender.charWithStyleHashCode] = txtBlock;306 //生成纹理307 const page = txtBlock.page;308 if (!page.webGLTexture) {309 page.webGLTexture = this.createTextTextureAtlas(page.pageWidth, page.pageHeight, textAtlasDebug);310 }311 const gl = this.webglRenderContext.context;312 page.webGLTexture[glContext] = gl;313 gl.bindTexture(gl.TEXTURE_2D, page.webGLTexture);314 gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);315 page.webGLTexture[UNPACK_PREMULTIPLY_ALPHA_WEBGL] = true;316 gl.texSubImage2D(gl.TEXTURE_2D, 0, txtBlock.subImageOffsetX, txtBlock.subImageOffsetY, gl.RGBA, gl.UNSIGNED_BYTE, canvas);317 gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);318 319 }320 }321 //给一个page创建一个纹理322 private createTextTextureAtlas(width: number, height: number, debug: boolean): WebGLTexture {323 let texture: WebGLTexture = null;324 if (debug) {325 //做一个黑底子的,方便调试代码326 const canvas = egret.sys.createCanvas(width, width);327 const context = egret.sys.getContext2d(canvas);328 context.fillStyle = 'black';329 context.fillRect(0, 0, width, width);330 texture = egret.sys.createTexture(this.webglRenderContext, canvas);331 }332 else {333 //真的334 texture = egret.sys._createTexture(this.webglRenderContext, width, height, null);335 }336 if (texture) {337 //存起来,未来可以删除,或者查看338 this.textAtlasTextureCache.push(texture);339 }340 return texture;341 }342 //给CharImageRender用的canvas343 private get canvas(): HTMLCanvasElement {344 if (!this._canvas) {345 //就用默认体积24346 this._canvas = egret.sys.createCanvas(24, 24);347 }348 return this._canvas;349 }350 }...

Full Screen

Full Screen

sketch.js

Source:sketch.js Github

copy

Full Screen

...43}44function draw() {45 // console.log(f1X);46 background(color("lightgrey"));47 drawLabel("F₁ = " + f1.toFixed(2) + " N", 25, 50, color("red"));48 drawLabel("F₂ = " + f2.toFixed(2) + " N", 650, 50, color("blue"));49 drawLabel("a₁ = " + a1.toFixed(2) + " m", 25, 80, color("darkorange"));50 drawLabel("a₂ = " + a2.toFixed(2) + " m", 650, 80, color("blueviolet"));51 drawLabel("M₁ = 500 N.m", 25, 110, color("black"));52 drawLabel("M₂ = 500 N.m", 650, 110, color("black"));53 drawLabel("F₁", 380, 50, color("black"), 22);54 drawLabel(".", 405, 50, color("black"), 26);55 drawLabel("a₁", 420, 50, color("black"), 22);56 drawLabel("=", 450, 50, color("black"), 22);57 drawLabel("F₂", 475, 50, color("black"), 22);58 drawLabel(".", 500, 50, color("black"), 26);59 drawLabel("a₂", 515, 50, color("black"), 22);60 drawLabel("M₁", 420, 80, color("black"), 22);61 drawLabel("=", 450, 80, color("black"), 22);62 drawLabel("M₂", 470, 80, color("black"), 22);63 drawLabel("Adam Hrouda © 2021", 700, 580, color("black"), 18);64 fill(color("black"));65 noStroke();66 rectMode(CENTER);67 rect(ww/2, wh/2 + 120, 600, 15);68 fill(color("black"))69 ellipse(ww/2, wh/2 + 150, 50);70 // drawArrow(createVector(50, 50), createVector(0, 100), 0);71 var f1Arr = new Arrow(f1X(), 380, f1L(), color("red"));72 f1Arr.draw();73 var f2Arr = new Arrow(f2X(), 380, f2L(), color("blue"));74 f2Arr.draw();75 noFill();76 stroke(color("black"));77 strokeWeight(1);78 rect(460, 58, 220, 70);79 stroke(color("darkorange"));80 strokeWeight(3);81 fill(color("darkorange"));82 line(f1X(), wh/2 + 120, 450, wh/2 + 120);83 stroke(color("blueviolet"));84 strokeWeight(3);85 fill(color("blueviolet"));86 line(f2X(), wh/2 + 120, 450, wh/2 + 120);87}88function drawLabel(string, x, y, c, s=22) {89 noStroke();90 textSize(s);91 fill(c);92 text(string, x, y);93}94function updateA1(subtract) {95 var diff = a1%aClickChng;96 a1-=diff;97 if (subtract) {98 if(a1 > 0.5) a1 = a1-aClickChng99 }100 else {101 if(a1 < 5) a1 = a1+aClickChng102 }...

Full Screen

Full Screen

createLoadingScreen.js

Source:createLoadingScreen.js Github

copy

Full Screen

2 var loadingScene = new enchant.Scene();3 loadingScene.backgroundColor = "#FEEC62";45 // "ちょっとまってね"の描画6 drawLabel(4, 247, 1024, 116, "ちょっとまってね", "gray", "112px", loadingScene);7 drawLabel(0, 250, 1024, 116, "ちょっとまってね", "black", "112px", loadingScene);89 // "♪"の描画10 drawLabel(162, 400, 100, 100, "♪", "#ED1A3D", "96px", loadingScene);11 drawLabel(262, 400, 100, 100, "♪", "#F15A22", "96px", loadingScene);12 drawLabel(362, 400, 100, 100, "♪", "#FFD400", "96px", loadingScene);13 drawLabel(462, 400, 100, 100, "♪", "#008000", "96px", loadingScene);14 drawLabel(562, 400, 100, 100, "♪", "#0067C0", "96px", loadingScene);15 drawLabel(662, 400, 100, 100, "♪", "#234794", "96px", loadingScene);16 drawLabel(762, 400, 100, 100, "♪", "#A757A8", "96px", loadingScene);1718 // "じゅんびちゅう"の描画19 drawLabel(0, 520, 1024, 68, "じゅんびちゅう", "gray", "64px", loadingScene);2021 // 進行度パーセンテージの描画22 var progressLabel = new enchant.Label();23 progressLabel.text = 0 + "%";24 progressLabel.textAlign = "center";25 progressLabel.color = "gray";26 progressLabel.font = "64px Paratino";27 progressLabel.width = 1024;28 progressLabel.height = 68;29 progressLabel.x = 0;30 progressLabel.y = 590;31 loadingScene.addChild(progressLabel);3233 // リソースファイルを1つ読み込む度に実行される ...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1import { drawLabel } from 'storybook-root';2drawLabel('Hello World');3module.exports = {4};5module.exports = (baseConfig, env, defaultConfig) => {6 defaultConfig.resolve.alias['storybook-root'] = path.resolve(__dirname, '../');7 return defaultConfig;8};9{10 "compilerOptions": {11 "paths": {12 }13 },14}

Full Screen

Using AI Code Generation

copy

Full Screen

1import { drawLabel } from 'storybook-root';2drawLabel('Hello World');3export const drawLabel = (text) => {4 console.log(text);5};6{7}8{9 "devDependencies": {10 }11}

Full Screen

Using AI Code Generation

copy

Full Screen

1import { drawLabel } from 'storybook-root';2drawLabel('Hello World');3import { storiesOf } from '@storybook/react';4import React from 'react';5export const drawLabel = (text) => storiesOf('Label', module)6 .add('Label', () => <label>{text}</label>);7import { configure } from '@storybook/react';8configure(require.context('../src', true, /\.stories\.js$/), module);9import { drawLabel } from 'storybook-root';10drawLabel('Hello World');11import { storiesOf } from '@storybook/react';12import React from 'react';13export const drawLabel = (text) => storiesOf('Label', module)14 .add('Label', () => <label>{text}</label>);

Full Screen

Using AI Code Generation

copy

Full Screen

1import { drawLabel } from 'storybook-root';2drawLabel('Hello World!');3import { drawLabel } from 'storybook-label';4export { drawLabel };5export function drawLabel(text) {6}7{8}9{10 "dependencies": {11 }12}

Full Screen

Using AI Code Generation

copy

Full Screen

1var storybookRoot = require('storybook-root');2var myLabel = storybookRoot.drawLabel("Hello World");3Ti.API.info(myLabel.text);4#import "StoryboardRootModule.h"5#import "TiApp.h"6#import "TiHost.h"7#import "TiRootViewController.h"8#import "TiUtils.h"9-(id)moduleGUID10{11 return @"6f4b6a4d-9b3a-4a0a-a1c7-df6f2b7e2a6a";12}13-(NSString*)moduleId14{15 return @"storybook-root";16}17-(void)startup18{19 [super startup];20 NSLog(@"[DEBUG] %@ loaded",self);21}22-(TiUIView*)drawLabel:(id)args23{24 UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 200, 200)];25 [label setText:[args objectAtIndex:0]];26 return [[[TiUIView alloc] initWithView:label] autorelease];27}28package ti.storybook.root;29import org.appcelerator.kroll.KrollModule;30import org.appcelerator.kroll.annotations.Kroll;31import org.appcelerator.titanium.TiApplication;32import org.appcelerator.titanium.TiC;33import org.appcelerator.titanium.TiContext;34import org.appcelerator.titanium.TiUIView;35import org.appcelerator.titanium.util.TiConvert;36import org.appcelerator.titanium.view.TiUIView;37import android.app.Activity;38import android.os.Bundle;39import android.util.Log

Full Screen

Using AI Code Generation

copy

Full Screen

1import { drawLabel } from 'storybook-root';2drawLabel('Hello World');3import { drawLabel } from 'storybook-root';4describe('drawLabel', () => {5 it('should draw label', () => {6 spyOn(document, 'getElementById').and.returnValue({7 });8 drawLabel('Hello World');9 expect(document.getElementById).toHaveBeenCalledWith('label');10 expect(document.getElementById().innerHTML).toEqual('Hello World');11 });12});

Full Screen

Using AI Code Generation

copy

Full Screen

1if (typeof window !== 'undefined') {2 window.drawLabel = drawLabel;3 window.drawLabel('test');4}5if (typeof window !== 'undefined') {6 window.drawLabel = drawLabel;7 window.drawLabel('test');8}9import React from 'react';10import { shallow } from 'enzyme';11import { drawLabel } from '../storybook-root/preview';12describe('CustomComponent', () => {13 it('should draw label', () => {14 const wrapper = shallow(<CustomComponent />);15 drawLabel();16 });17});

Full Screen

Using AI Code Generation

copy

Full Screen

1import { drawLabel } from 'storybook-root'2export default function test() {3 drawLabel('test', 'test')4}5import { configure } from '@storybook/react'6import { addDecorator } from '@storybook/react'7import { withTests } from '@storybook/addon-jest'8import results from '../.jest-test-results.json'9import { withInfo } from '@storybook/addon-info'10import { withKnobs } from '@storybook/addon-knobs'11import { withA11y } from '@storybook/addon-a11y'12import { withConsole } from '@storybook/addon-console'13import '../src/index.css'14addDecorator(15 withTests({16 })17addDecorator((storyFn, context) => withConsole()(storyFn)(context))18addDecorator(withKnobs)19addDecorator(withInfo)20addDecorator(withA11y)21configure(require.context('../src', true, /\.stories\.js$/), module)22const path = require('path')23const webpack = require('webpack')24module.exports = ({ config }) => {25 config.plugins.push(26 new webpack.NormalModuleReplacementPlugin(27 path.resolve(__dirname, '../src/components/Label/Label.js')28}29{30 "snapshot": {

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 storybook-root 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