Best JavaScript code snippet using storybook-test-runner
test-storybook.js
Source:test-storybook.js
1#!/usr/bin/env node2//@ts-check3'use strict';4const { execSync } = require('child_process');5const fetch = require('node-fetch');6const canBindToHost = require('can-bind-to-host').default;7const fs = require('fs');8const dedent = require('ts-dedent').default;9const path = require('path');10const tempy = require('tempy');11const semver = require('semver');12const { getCliOptions, getStorybookMetadata } = require('../dist/cjs/util');13const { transformPlaywrightJson } = require('../dist/cjs/playwright/transformPlaywrightJson');14// Do this as the first thing so that any code reading it knows the right env.15process.env.BABEL_ENV = 'test';16process.env.NODE_ENV = 'test';17process.env.PUBLIC_URL = '';18// Makes the script crash on unhandled rejections instead of silently19// ignoring them. In the future, promise rejections that are not handled will20// terminate the Node.js process with a non-zero exit code.21process.on('unhandledRejection', (err) => {22 throw err;23});24const log = (message) => console.log(`[test-storybook] ${message}`);25const error = (message) => console.error(`[test-storybook] ${message}`);26// Clean up tmp files globally in case of control-c27let indexTmpDir;28const cleanup = () => {29 if (indexTmpDir) {30 log(`Cleaning up ${indexTmpDir}`);31 fs.rmSync(indexTmpDir, { recursive: true, force: true });32 }33};34let isWatchMode = false;35async function reportCoverage() {36 if (isWatchMode || process.env.STORYBOOK_COLLECT_COVERAGE !== 'true') {37 return;38 }39 const coverageFolderE2E = path.resolve(process.cwd(), '.nyc_output');40 const coverageFolder = path.resolve(process.cwd(), 'coverage/storybook');41 // in case something goes wrong and .nyc_output does not exist, bail42 if (!fs.existsSync(coverageFolderE2E)) {43 return;44 }45 // if there's no coverage folder, create one46 if (!fs.existsSync(coverageFolder)) {47 fs.mkdirSync(coverageFolder, { recursive: true });48 }49 // move the coverage files from .nyc_output folder (coming from jest-playwright) to coverage, then delete .nyc_output50 fs.renameSync(`${coverageFolderE2E}/coverage.json`, `${coverageFolder}/coverage-storybook.json`);51 fs.rmSync(coverageFolderE2E, { recursive: true });52 // --skip-full in case we only want to show not fully covered code53 // --check-coverage if we want to break if coverage reaches certain threshold54 // .nycrc will be respected for thresholds etc. https://www.npmjs.com/package/nyc#coverage-thresholds55 execSync(`npx nyc report --reporter=text -t ${coverageFolder} --report-dir ${coverageFolder}`, {56 stdio: 'inherit',57 });58}59const onProcessEnd = () => {60 cleanup();61 reportCoverage();62};63process.on('SIGINT', onProcessEnd);64process.on('exit', onProcessEnd);65function sanitizeURL(url) {66 let finalURL = url;67 // prepend URL protocol if not there68 if (finalURL.indexOf('http://') === -1 && finalURL.indexOf('https://') === -1) {69 finalURL = 'http://' + finalURL;70 }71 // remove iframe.html if present72 finalURL = finalURL.replace(/iframe.html\s*$/, '');73 // remove index.html if present74 finalURL = finalURL.replace(/index.html\s*$/, '');75 // add forward slash at the end if not there76 if (finalURL.slice(-1) !== '/') {77 finalURL = finalURL + '/';78 }79 return finalURL;80}81async function executeJestPlaywright(args) {82 // Always prefer jest installed via the test runner. If it's hoisted, it will get it from root node_modules83 const jestPath = path.dirname(84 require.resolve('jest', {85 paths: [path.join(__dirname, '../@storybook/test-runner/node_modules')],86 })87 );88 const jest = require(jestPath);89 let argv = args.slice(2);90 const jestConfigPath = fs.existsSync('test-runner-jest.config.js')91 ? 'test-runner-jest.config.js'92 : path.resolve(__dirname, '../playwright/test-runner-jest.config.js');93 argv.push('--config', jestConfigPath);94 await jest.run(argv);95}96async function checkStorybook(url) {97 try {98 const res = await fetch(url, { method: 'HEAD' });99 if (res.status !== 200) throw new Error(`Unxpected status: ${res.status}`);100 } catch (e) {101 console.error(102 dedent`[test-storybook] It seems that your Storybook instance is not running at: ${url}. Are you sure it's running?103 104 If you're not running Storybook on the default 6006 port or want to run the tests against any custom URL, you can pass the --url flag like so:105 106 yarn test-storybook --url http://localhost:9009107 108 More info at https://github.com/storybookjs/test-runner#getting-started`109 );110 process.exit(1);111 }112}113async function getIndexJson(url) {114 const indexJsonUrl = new URL('index.json', url).toString();115 const storiesJsonUrl = new URL('stories.json', url).toString();116 const [indexRes, storiesRes] = await Promise.all([fetch(indexJsonUrl), fetch(storiesJsonUrl)]);117 if (indexRes.ok) {118 try {119 const json = await indexRes.text();120 return JSON.parse(json);121 } catch (err) {}122 }123 if (storiesRes.ok) {124 try {125 const json = await storiesRes.text();126 return JSON.parse(json);127 } catch (err) {}128 }129 throw new Error(dedent`130 Failed to fetch index data from the project.131 Make sure that either of these URLs are available with valid data in your Storybook:132 ${133 // TODO: switch order once index.json becomes more common than stories.json134 storiesJsonUrl135 }136 ${indexJsonUrl}137 More info: https://github.com/storybookjs/test-runner/blob/main/README.md#indexjson-mode138 `);139}140async function getIndexTempDir(url) {141 let tmpDir;142 try {143 const indexJson = await getIndexJson(url);144 const titleIdToTest = transformPlaywrightJson(indexJson);145 tmpDir = tempy.directory();146 Object.entries(titleIdToTest).forEach(([titleId, test]) => {147 const tmpFile = path.join(tmpDir, `${titleId}.test.js`);148 fs.writeFileSync(tmpFile, test);149 });150 } catch (err) {151 error(err);152 process.exit(1);153 }154 return tmpDir;155}156function ejectConfiguration() {157 const origin = path.resolve(__dirname, '../playwright/test-runner-jest.config.js');158 const destination = path.resolve('test-runner-jest.config.js');159 const fileAlreadyExists = fs.existsSync(destination);160 if (fileAlreadyExists) {161 throw new Error(dedent`Found existing file at:162 163 ${destination}164 165 Please delete it and rerun this command.166 \n`);167 }168 fs.copyFileSync(origin, destination);169 log('Configuration file successfully copied as test-runner-jest.config.js');170}171const main = async () => {172 const { jestOptions, runnerOptions } = getCliOptions();173 if (runnerOptions.eject) {174 ejectConfiguration();175 process.exit(0);176 }177 // set this flag to skip reporting coverage in watch mode178 isWatchMode = jestOptions.watch || jestOptions.watchAll;179 const rawTargetURL = process.env.TARGET_URL || runnerOptions.url || 'http://localhost:6006';180 await checkStorybook(rawTargetURL);181 const targetURL = sanitizeURL(rawTargetURL);182 process.env.TARGET_URL = targetURL;183 if (runnerOptions.coverage) {184 process.env.STORYBOOK_COLLECT_COVERAGE = 'true';185 }186 if (runnerOptions.junit) {187 process.env.STORYBOOK_JUNIT = 'true';188 }189 if (process.env.REFERENCE_URL) {190 process.env.REFERENCE_URL = sanitizeURL(process.env.REFERENCE_URL);191 }192 // Use TEST_BROWSERS if set, otherwise get from --browser option193 if (!process.env.TEST_BROWSERS && runnerOptions.browsers) {194 process.env.TEST_BROWSERS = runnerOptions.browsers.join(',');195 }196 const { hostname } = new URL(targetURL);197 const isLocalStorybookIp = await canBindToHost(hostname);198 const shouldRunIndexJson = runnerOptions.indexJson !== false && !isLocalStorybookIp;199 if (shouldRunIndexJson) {200 log(201 'Detected a remote Storybook URL, running in index json mode. To disable this, run the command again with --no-index-json\n'202 );203 }204 if (runnerOptions.indexJson || shouldRunIndexJson) {205 indexTmpDir = await getIndexTempDir(targetURL);206 process.env.TEST_ROOT = indexTmpDir;207 process.env.TEST_MATCH = '**/*.test.js';208 }209 process.env.STORYBOOK_CONFIG_DIR = runnerOptions.configDir;210 const { storiesPaths, lazyCompilation } = getStorybookMetadata();211 process.env.STORYBOOK_STORIES_PATTERN = storiesPaths;212 if (lazyCompilation && isLocalStorybookIp) {213 log(214 `You're running Storybook with lazy compilation enabled, and will likely cause issues with the test runner locally. Consider disabling 'lazyCompilation' in ${runnerOptions.configDir}/main.js when running 'test-storybook' locally.`215 );216 }217 await executeJestPlaywright(jestOptions);218};...
storybook.ts
Source:storybook.ts
1import path from 'node:path';2import kebabCase from 'lodash.kebabcase';3import { BrowserContext } from 'playwright';4import { readFileSync } from 'fs-extra';5import { ShotItem } from '../types';6import { config } from '../config';7import { getBrowser } from '../utils';8import { log } from '../log';9export type StoryParameters = {10 lostpixel?: {11 disable?: boolean;12 threshold?: number;13 waitBeforeScreenshot?: number;14 };15 viewport?: {16 width?: number;17 height?: number;18 };19 fileName?: string;20};21export type Story = {22 id: string;23 kind: string;24 story: string;25 name?: string;26 title?: string;27 importPath?: string;28 parameters?: StoryParameters & {29 storyshots?: {30 disable?: boolean;31 };32 };33};34interface StorybookClientApi {35 raw?: () => Story[];36 storyStore?: {37 cacheAllCSFFiles: () => Promise<void>;38 };39}40type StoriesJson = {41 v: number;42 stories: Story[];43};44type WindowObject = typeof window & {45 __STORYBOOK_CLIENT_API__: StorybookClientApi;46};47type CrawlerResult = {48 stories: Story[] | undefined;49};50export const getStoryBookUrl = (url: string) => {51 if (52 url.startsWith('http://') ||53 url.startsWith('https://') ||54 url.startsWith('file://')55 ) {56 return url;57 }58 if (url.startsWith('/')) {59 return `file://${url}`;60 }61 return `file://${path.normalize(path.join(process.cwd(), url))}`;62};63export const getIframeUrl = (url: string) =>64 url.endsWith('/') ? `${url}iframe.html` : `${url}/iframe.html`;65export const collectStoriesViaWindowApi = async (66 context: BrowserContext,67 url: string,68 isIframeUrl?: boolean,69) => {70 const page = await context.newPage();71 const iframeUrl = isIframeUrl72 ? getStoryBookUrl(url)73 : getIframeUrl(getStoryBookUrl(url));74 await page.goto(iframeUrl);75 await page.waitForFunction(76 () => (window as WindowObject).__STORYBOOK_CLIENT_API__,77 null,78 {79 timeout: config.timeouts.fetchStories,80 },81 );82 await page.evaluate(async () => {83 const { __STORYBOOK_CLIENT_API__: api } = window as WindowObject;84 if (api.storyStore) {85 await api.storyStore.cacheAllCSFFiles?.();86 }87 });88 const result = await page.evaluate(89 async () =>90 new Promise<CrawlerResult>((resolve) => {91 const parseParameters = <T>(92 parameters: T,93 level = 0,94 ): T | 'UNSUPPORTED_DEPTH' | 'UNSUPPORTED_TYPE' => {95 if (level > 10) {96 return 'UNSUPPORTED_DEPTH';97 }98 if (Array.isArray(parameters)) {99 // @ts-expect-error FIXME100 return parameters.map((value) =>101 parseParameters<unknown>(value, level + 1),102 );103 }104 if (105 typeof parameters === 'string' ||106 typeof parameters === 'number' ||107 typeof parameters === 'boolean' ||108 typeof parameters === 'undefined' ||109 typeof parameters === 'function' ||110 parameters instanceof RegExp ||111 parameters instanceof Date ||112 parameters === null113 ) {114 return parameters;115 }116 if (typeof parameters === 'object' && parameters !== null) {117 // @ts-expect-error FIXME118 // eslint-disable-next-line unicorn/no-array-reduce119 return Object.keys(parameters).reduce<T>((acc, key: keyof T) => {120 // @ts-expect-error FIXME121 acc[key] = parseParameters(parameters[key], level + 1);122 return acc;123 }, {});124 }125 return 'UNSUPPORTED_TYPE';126 };127 const fetchStories = () => {128 const { __STORYBOOK_CLIENT_API__: api } = window as WindowObject;129 if (api.raw) {130 const stories: Story[] = api.raw().map((item) => {131 const parameters = parseParameters(132 item.parameters as Record<string, unknown>,133 ) as Story['parameters'];134 return {135 id: item.id,136 kind: item.kind,137 story: item.story,138 importPath: parameters?.fileName,139 parameters,140 };141 });142 resolve({ stories });143 return;144 }145 resolve({ stories: [] });146 };147 fetchStories();148 }),149 );150 return result;151};152export const collectStoriesViaStoriesJson = async (153 context: BrowserContext,154 url: string,155) => {156 const storiesJsonUrl = url.endsWith('/')157 ? `${url}stories.json`158 : `${url}/stories.json`;159 let storiesJson: StoriesJson;160 if (storiesJsonUrl.startsWith('file://')) {161 try {162 const file = readFileSync(storiesJsonUrl.slice(7));163 storiesJson = JSON.parse(file.toString()) as StoriesJson;164 } catch {165 throw new Error(`Cannot load file ${storiesJsonUrl}`);166 }167 } else {168 const result = await context.request.get(storiesJsonUrl);169 storiesJson = (await result.json()) as StoriesJson;170 }171 if (typeof storiesJson.stories === 'object') {172 return {173 stories: Object.values(storiesJson.stories),174 };175 }176 throw new Error(`Cannot load resource ${storiesJsonUrl}`);177};178export const collectStories = async (url: string) => {179 const browser = await getBrowser().launch();180 const context = await browser.newContext();181 try {182 log('Trying to collect stories via window object');183 const result = await collectStoriesViaWindowApi(context, url);184 await browser.close();185 return result;186 } catch {187 log('Fallback to /stories.json');188 }189 try {190 const result = await collectStoriesViaStoriesJson(context, url);191 await browser.close();192 return result;193 } catch (error: unknown) {194 await browser.close();195 throw error;196 }197};198const generateFilename = (story: Story) =>199 [story.kind, story.story].map((value) => kebabCase(value)).join('--');200const generateBrowserConfig = (story: Story) => {201 const browserConfig = config.configureBrowser?.({202 ...story,203 shotMode: 'storybook',204 });205 if (story.parameters?.viewport && browserConfig) {206 browserConfig.viewport = browserConfig.viewport ?? {207 width: 1280,208 height: 720,209 };210 browserConfig.viewport = {211 ...browserConfig.viewport,212 ...story.parameters.viewport,213 };214 }215 return browserConfig;216};217export const generateStorybookShotItems = (218 baseUrl: string,219 stories: Story[],220): ShotItem[] => {221 const iframeUrl = getIframeUrl(getStoryBookUrl(baseUrl));222 const shotItems = stories223 .map((story) => ({224 ...story,225 shotName: config.shotNameGenerator226 ? config.shotNameGenerator({ ...story, shotMode: 'storybook' })227 : generateFilename(story),228 }))229 .filter((story) => story.parameters?.lostpixel?.disable !== true)230 .filter((story) => story.parameters?.storyshots?.disable !== true)231 .filter((story) =>232 config.filterShot233 ? config.filterShot({ ...story, shotMode: 'storybook' })234 : true,235 )236 .map((story): ShotItem => {237 const fileNameWithExt = `${story.shotName}.png`;238 return {239 shotMode: 'storybook',240 id: story.id,241 shotName: story.shotName,242 importPath: story.importPath,243 url: `${iframeUrl}?id=${story.id}&viewMode=story`,244 filePathBaseline: path.join(config.imagePathBaseline, fileNameWithExt),245 filePathCurrent: path.join(config.imagePathCurrent, fileNameWithExt),246 filePathDifference: path.join(247 config.imagePathDifference,248 fileNameWithExt,249 ),250 browserConfig: generateBrowserConfig(story),251 threshold: story.parameters?.lostpixel?.threshold ?? config.threshold,252 waitBeforeScreenshot:253 story.parameters?.lostpixel?.waitBeforeScreenshot ??254 config.waitBeforeScreenshot,255 };256 });257 return shotItems;...
Using AI Code Generation
1const { storiesJsonUrl } = require('storybook-test-runner');2const { stories } = require(storiesJsonUrl);3const { storiesJson } = require('storybook-test-runner');4const { stories } = storiesJson;5const { stories } = require('storybook-test-runner');6const { stories } = require('./.storybook/storybook-manifest.json');7const { stories } = require('./.storybook/storybook-manifest.js');8const { stories } = require('./.storybook/storybook-manifest.ts');9const { stories } = require('./.storybook/storybook-manifest.tsx');10const { stories } = require('./.storybook/storybook-manifest.mjs');11const { stories } = require('./.storybook/storybook-manifest.cjs');12const { stories } = require('./.storybook/storybook-manifest.json5');13const { stories } = require('./.storybook/storybook-manifest.yml');14const { stories } = require('./.storybook/storybook-manifest.yaml');15const { stories } = require('./.storybook/storybook-manifest.toml');16const { stories } = require('./.storybook/storybook-manifest.ini');17const { stories } = require('./.storybook/storybook-manifest.xml');18const { stories } = require('./.storybook/storybook-manifest.csv');19const { stories } = require('./.storybook/storybook-manifest.tsv');20const { stories } = require('./.storybook/storybook-manifest.ics');21const { stories } = require('./.storybook/storybook-manifest.css');22const { stories } = require('./.storybook/storybook-manifest.scss');
Using AI Code Generation
1const { storiesJsonUrl } = require('storybook-test-runner');2const { stories } = require(storiesJsonUrl);3const { storiesJson } = require('storybook-test-runner');4const { stories } = storiesJson;5const { stories } = require('storybook-test-runner');6const { storybookTestRunner } = require('storybook-test-runner');7const { stories } = storybookTestRunner;8const { storybookTestRunner } = require('storybook-test-runner');9const { stories } = storybookTestRunner;10const { storybookTestRunner } = require('storybook-test-runner');11const { stories } = storybookTestRunner;12const { storybookTestRunner } = require('storybook-test-runner');13const { stories } = storybookTestRunner;14const { storybookTestRunner } = require('storybook-test-runner');15const { stories } = storybookTestRunner;16const { storybookTestRunner } = require('storybook-test-runner');17const { stories } = storybookTestRunner;18const { storybookTestRunner } = require('storybook-test-runner');19const { stories } = storybookTestRunner;20const { storybookTestRunner } = require('storybook-test-runner');21const { stories } = storybookTestRunner;22const { storybookTestRunner } = require('storybook-test-runner');23const { stories } = storybookTestRunner;24const { storybookTestRunner } = require('storybook-test-runner');25const { stories } = storybookTestRunner;26const { storybookTestRunner } = require('storybook-test-runner');
Using AI Code Generation
1import { storiesJsonUrl } from 'storybook-test-runner'2const storybookUrl = storiesJsonUrl()3import { storiesJson } from 'storybook-test-runner'4const stories = storiesJson()5import { storiesHtml } from 'storybook-test-runner'6const stories = storiesHtml()7import { storiesHtmlUrl } from 'storybook-test-runner'8const stories = storiesHtmlUrl()9import { storiesJson } from 'storybook-test-runner'10const stories = storiesJson()11import { storiesJsonUrl } from 'storybook-test-runner'12const stories = storiesJsonUrl()13import { storiesHtml } from 'storybook-test-runner'14const stories = storiesHtml()15import { storiesHtmlUrl } from 'storybook-test-runner'16const stories = storiesHtmlUrl()17import { storiesJson } from 'storybook-test-runner'18const stories = storiesJson()19import { storiesJsonUrl } from 'storybook-test-runner'20const stories = storiesJsonUrl()21import { storiesHtml } from 'storybook-test-runner'22const stories = storiesHtml()23import { storiesHtmlUrl } from 'storybook-test-runner'24const stories = storiesHtmlUrl()25import { storiesJson } from 'storybook-test-runner'26const stories = storiesJson()27import { storiesJsonUrl } from 'storybook-test-runner'28const stories = storiesJsonUrl()29import { storiesHtml } from 'storybook-test-runner'30const stories = storiesHtml()31import { storiesHtmlUrl } from 'storybook-test-runner'32const stories = storiesHtmlUrl()
Using AI Code Generation
1var storybookTestRunner = require('storybook-test-runner');2var storiesJsonUrl = storybookTestRunner.storiesJsonUrl;3var storiesJson = require(storiesJsonUrl);4var storybookTestRunner = require('storybook-test-runner');5storybookTestRunner.runTests();6var storybookTestRunner = require('storybook-test-runner');7var storiesJsonUrl = storybookTestRunner.storiesJsonUrl;8var storiesJson = require(storiesJsonUrl);9var storybookTestRunner = require('storybook-test-runner');10storybookTestRunner.runTests();11var storybookTestRunner = require('storybook-test-runner');12var storiesJsonUrl = storybookTestRunner.storiesJsonUrl;13var storiesJson = require(storiesJsonUrl);14var storybookTestRunner = require('storybook-test-runner');15storybookTestRunner.runTests();16var storybookTestRunner = require('storybook-test-runner');17var storiesJsonUrl = storybookTestRunner.storiesJsonUrl;18var storiesJson = require(storiesJsonUrl);19var storybookTestRunner = require('storybook-test-runner');20storybookTestRunner.runTests();21var storybookTestRunner = require('storybook-test-runner');22var storiesJsonUrl = storybookTestRunner.storiesJsonUrl;23var storiesJson = require(storiesJsonUrl);24var storybookTestRunner = require('storybook-test-runner');25storybookTestRunner.runTests();26var storybookTestRunner = require('storybook-test-runner');27var storiesJsonUrl = storybookTestRunner.storiesJsonUrl;28var storiesJson = require(storiesJsonUrl);
Using AI Code Generation
1const testRunner = require('storybook-test-runner').default;2 .then((stories) => {3 console.log('stories', stories);4 });5const testRunner = require('storybook-test-runner').default;6 .then((stories) => {7 console.log('stories', stories);8 });9const testRunner = require('storybook-test-runner').default;10 .then((stories) => {11 console.log('stories', stories);12 });13const testRunner = require('storybook-test-runner').default;14 .then((stories) => {15 console.log('stories', stories);16 });17const testRunner = require('storybook-test-runner').default;18 .then((stories) => {19 console.log('stories', stories);20 });21const testRunner = require('storybook-test-runner').default;22 .then((stories) => {23 console.log('stories', stories);24 });25const testRunner = require('storybook-test-runner').default;26 .then((stories) => {27 console.log('stories', stories);28 });29const testRunner = require('storybook-test-runner').default;30 .then((stories) =>
Using AI Code Generation
1const storybookTestRunner = require('storybook-test-runner');2const storiesJsonUrl = storybookTestRunner.storiesJsonUrl;3const storiesJson = require(storiesJsonUrl);4console.log(storiesJson);5const storybookTestRunner = require('storybook-test-runner');6const storiesJson = storybookTestRunner.storiesJson;7console.log(storiesJson);8const storybookTestRunner = require('storybook-test-runner');9const storiesJsonUrl = storybookTestRunner.storiesJsonUrl;10const storiesJson = require(storiesJsonUrl);11describe('My Component', () => {12 it('should render correctly', () => {13 const story = storiesJson['My Component']['should render correctly'];14 const storyElement = document.createElement('div');15 storyElement.setAttribute('id', 'story');16 document.body.appendChild(storyElement);17 story();18 expect(document.body.innerHTML).toMatchSnapshot();19 });20});21const storybookTestRunner = require('storybook-test-runner');22const storiesJson = storybookTestRunner.storiesJson;23storiesOf('My Component', module).add('should render correctly', () => {
Using AI Code Generation
1const { storiesJsonUrl } = require('storybook-test-runner');2const { resolve } = require('path');3const url = storiesJsonUrl({4 storybookDir: resolve(__dirname, '../storybook'),5});6fetch(url)7 .then(res => res.json())8 .then(json => {9 console.log(json);10 });11const { storiesJson } = require('storybook-test-runner');12const { resolve } = require('path');13const json = storiesJson({14 storybookDir: resolve(__dirname, '../storybook')15});16console.log(json);17{ "stories": { "Test": { "Test": { "kind": "Test", "story": "Test", "parameters": { "fileName": "test.js", "options": { "selectedPanel": "storybook/tests/panel" } }, "name": "Test", "storyFn": [Function: storyFn], "decorators": [ [Function: withTests], [Function: withInfo] ], "parameters": { "fileName": "test.js", "options": { "selectedPanel": "storybook/tests/panel" } }, "args": {}, "argTypes": {}, "globals": {} } } } }
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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!