@@ -241,16 +241,16 @@ You can automatically generate Maestro test files from your stories:
241241``` typescript
242242// scripts/generate-maestro-tests.ts
243243import { writeFileSync , mkdirSync } from ' fs' ;
244- import { join } from ' path' ;
244+ import path from ' path' ;
245245
246246const run = async () => {
247247 const { buildIndex } = await import (' storybook/internal/core-server' );
248248 const index = await buildIndex ({
249- configDir: join (__dirname , ' ../.rnstorybook' ),
249+ configDir: path . join (__dirname , ' ../.rnstorybook' ),
250250 });
251251
252252 // Ensure .maestro directory exists
253- const maestroDir = join (__dirname , ' ../.maestro' );
253+ const maestroDir = path . join (__dirname , ' ../.maestro' );
254254 mkdirSync (maestroDir , { recursive: true });
255255
256256 // Generate Maestro test file content
@@ -262,7 +262,8 @@ const run = async () => {
262262 }));
263263
264264 const appId = ' host.exp.Exponent' ; // Replace with your actual app ID if different
265- const uriScheme = ' exp' ;
265+
266+ const baseUri = ' exp://127.0.0.1:8081/--/' ; // Replace with your actual base URI if different
266267
267268 const maestroContent = ` appId: ${appId }
268269name: Take screenshots of all Storybook stories
@@ -272,7 +273,7 @@ name: Take screenshots of all Storybook stories
272273${stories
273274 .map (
274275 (story ) => ` # Story ${story .name }
275- - openLink: '${uriScheme }://127.0.0.1:8081/--/ ?STORYBOOK_STORY_ID=${story .id }'
276+ - openLink: '${baseUri } ?STORYBOOK_STORY_ID=${story .id }'
276277- waitForAnimationToEnd
277278- assertVisible:
278279 id: '${story .id }'
@@ -282,7 +283,7 @@ ${stories
282283 .join (' \n ' )} ` ;
283284
284285 // Write the Maestro test file
285- const maestroTestPath = join (maestroDir , ' storybook-screenshots.yaml' );
286+ const maestroTestPath = path . join (maestroDir , ' storybook-screenshots.yaml' );
286287 writeFileSync (maestroTestPath , maestroContent );
287288
288289 console .log (' Generated Maestro test file at:' , maestroTestPath );
0 commit comments