Skip to content

Commit 0423445

Browse files
authored
feat: deep linking (#691)
1 parent 632fe30 commit 0423445

File tree

15 files changed

+1814
-1456
lines changed

15 files changed

+1814
-1456
lines changed
Lines changed: 291 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,291 @@
1+
appId: host.exp.Exponent
2+
name: Take screenshots of all Storybook stories
3+
---
4+
- stopApp: host.exp.Exponent
5+
6+
# Story 0
7+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=actionexample-actions--basic'
8+
- waitForAnimationToEnd
9+
- assertVisible:
10+
id: 'actionexample-actions--basic'
11+
- takeScreenshot: '.maestro/screenshots/ActionExample-Actions---Basic'
12+
13+
# Story 1
14+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=actionexample-actions--another-action'
15+
- waitForAnimationToEnd
16+
- assertVisible:
17+
id: 'actionexample-actions--another-action'
18+
- takeScreenshot: '.maestro/screenshots/ActionExample-Actions---Another-Action'
19+
20+
# Story 2
21+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=backgroundexample-backgroundcsf--basic'
22+
- waitForAnimationToEnd
23+
- assertVisible:
24+
id: 'backgroundexample-backgroundcsf--basic'
25+
- takeScreenshot: '.maestro/screenshots/BackgroundExample-BackgroundCsf---Basic'
26+
27+
# Story 3
28+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=controlexamples-array--basic'
29+
- waitForAnimationToEnd
30+
- assertVisible:
31+
id: 'controlexamples-array--basic'
32+
- takeScreenshot: '.maestro/screenshots/ControlExamples-Array---Basic'
33+
34+
# Story 4
35+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=controlexamples-boolean--basic'
36+
- waitForAnimationToEnd
37+
- assertVisible:
38+
id: 'controlexamples-boolean--basic'
39+
- takeScreenshot: '.maestro/screenshots/ControlExamples-Boolean---Basic'
40+
41+
# Story 5
42+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=controlexamples-boolean--on'
43+
- waitForAnimationToEnd
44+
- assertVisible:
45+
id: 'controlexamples-boolean--on'
46+
- takeScreenshot: '.maestro/screenshots/ControlExamples-Boolean---On'
47+
48+
# Story 6
49+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=controlexamples-color--color-example'
50+
- waitForAnimationToEnd
51+
- assertVisible:
52+
id: 'controlexamples-color--color-example'
53+
- takeScreenshot: '.maestro/screenshots/ControlExamples-Color---Color-Example'
54+
55+
# Story 7
56+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=controlexamples-controlexample--example'
57+
- waitForAnimationToEnd
58+
- assertVisible:
59+
id: 'controlexamples-controlexample--example'
60+
- takeScreenshot: '.maestro/screenshots/ControlExamples-ControlExample---Example'
61+
62+
# Story 8
63+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=controlexamples-date--basic'
64+
- waitForAnimationToEnd
65+
- assertVisible:
66+
id: 'controlexamples-date--basic'
67+
- takeScreenshot: '.maestro/screenshots/ControlExamples-Date---Basic'
68+
69+
# Story 9
70+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=controlexamples-number--basic'
71+
- waitForAnimationToEnd
72+
- assertVisible:
73+
id: 'controlexamples-number--basic'
74+
- takeScreenshot: '.maestro/screenshots/ControlExamples-Number---Basic'
75+
76+
# Story 10
77+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=controlexamples-number--range'
78+
- waitForAnimationToEnd
79+
- assertVisible:
80+
id: 'controlexamples-number--range'
81+
- takeScreenshot: '.maestro/screenshots/ControlExamples-Number---Range'
82+
83+
# Story 11
84+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=controlexamples-object--basic'
85+
- waitForAnimationToEnd
86+
- assertVisible:
87+
id: 'controlexamples-object--basic'
88+
- takeScreenshot: '.maestro/screenshots/ControlExamples-Object---Basic'
89+
90+
# Story 12
91+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=controlexamples-radio--basic'
92+
- waitForAnimationToEnd
93+
- assertVisible:
94+
id: 'controlexamples-radio--basic'
95+
- takeScreenshot: '.maestro/screenshots/ControlExamples-Radio---Basic'
96+
97+
# Story 13
98+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=controlexamples-reproductions-selectwithnumber--basic'
99+
- waitForAnimationToEnd
100+
- assertVisible:
101+
id: 'controlexamples-reproductions-selectwithnumber--basic'
102+
- takeScreenshot: '.maestro/screenshots/ControlExamples-Reproductions-SelectWithNumber---Basic'
103+
104+
# Story 14
105+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=controlexamples-select--basic'
106+
- waitForAnimationToEnd
107+
- assertVisible:
108+
id: 'controlexamples-select--basic'
109+
- takeScreenshot: '.maestro/screenshots/ControlExamples-Select---Basic'
110+
111+
# Story 15
112+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=controlexamples-select--with-labels'
113+
- waitForAnimationToEnd
114+
- assertVisible:
115+
id: 'controlexamples-select--with-labels'
116+
- takeScreenshot: '.maestro/screenshots/ControlExamples-Select---With-Labels'
117+
118+
# Story 16
119+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=controlexamples-select--with-mapping'
120+
- waitForAnimationToEnd
121+
- assertVisible:
122+
id: 'controlexamples-select--with-mapping'
123+
- takeScreenshot: '.maestro/screenshots/ControlExamples-Select---With-Mapping'
124+
125+
# Story 17
126+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=controlexamples-text--basic'
127+
- waitForAnimationToEnd
128+
- assertVisible:
129+
id: 'controlexamples-text--basic'
130+
- takeScreenshot: '.maestro/screenshots/ControlExamples-Text---Basic'
131+
132+
# Story 18
133+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=controlexamples-webcompatibility--undefined'
134+
- waitForAnimationToEnd
135+
- assertVisible:
136+
id: 'controlexamples-webcompatibility--undefined'
137+
- takeScreenshot: '.maestro/screenshots/ControlExamples-WebCompatibility---Undefined'
138+
139+
# Story 19
140+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=controlexamples-webcompatibility--defined'
141+
- waitForAnimationToEnd
142+
- assertVisible:
143+
id: 'controlexamples-webcompatibility--defined'
144+
- takeScreenshot: '.maestro/screenshots/ControlExamples-WebCompatibility---Defined'
145+
146+
# Story 20
147+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=deepcontrols--basic'
148+
- waitForAnimationToEnd
149+
- assertVisible:
150+
id: 'deepcontrols--basic'
151+
- takeScreenshot: '.maestro/screenshots/DeepControls---Basic'
152+
153+
# Story 21
154+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=inputexample-textinput--basic'
155+
- waitForAnimationToEnd
156+
- assertVisible:
157+
id: 'inputexample-textinput--basic'
158+
- takeScreenshot: '.maestro/screenshots/InputExample-TextInput---Basic'
159+
160+
# Story 22
161+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=interactionexample--static'
162+
- waitForAnimationToEnd
163+
- assertVisible:
164+
id: 'interactionexample--static'
165+
- takeScreenshot: '.maestro/screenshots/InteractionExample---Static'
166+
167+
# Story 23
168+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=interactionexample--touchable'
169+
- waitForAnimationToEnd
170+
- assertVisible:
171+
id: 'interactionexample--touchable'
172+
- takeScreenshot: '.maestro/screenshots/InteractionExample---Touchable'
173+
174+
# Story 24
175+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=interactionexample--scrolling'
176+
- waitForAnimationToEnd
177+
- assertVisible:
178+
id: 'interactionexample--scrolling'
179+
- takeScreenshot: '.maestro/screenshots/InteractionExample---Scrolling'
180+
181+
# Story 25
182+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=nestingexample-chatmessage--message-first'
183+
- waitForAnimationToEnd
184+
- assertVisible:
185+
id: 'nestingexample-chatmessage--message-first'
186+
- takeScreenshot: '.maestro/screenshots/NestingExample-ChatMessage---Message-First'
187+
188+
# Story 26
189+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=nestingexample-chatmessage--message-second'
190+
- waitForAnimationToEnd
191+
- assertVisible:
192+
id: 'nestingexample-chatmessage--message-second'
193+
- takeScreenshot: '.maestro/screenshots/NestingExample-ChatMessage---Message-Second'
194+
195+
# Story 27
196+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=nestingexample-message-bubble--first'
197+
- waitForAnimationToEnd
198+
- assertVisible:
199+
id: 'nestingexample-message-bubble--first'
200+
- takeScreenshot: '.maestro/screenshots/NestingExample-Message-bubble---First'
201+
202+
# Story 28
203+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=nestingexample-message-bubble--second'
204+
- waitForAnimationToEnd
205+
- assertVisible:
206+
id: 'nestingexample-message-bubble--second'
207+
- takeScreenshot: '.maestro/screenshots/NestingExample-Message-bubble---Second-Story'
208+
209+
# Story 29
210+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=nestingexample-message-bubble-a-very-long-name-for-a-title-that-just-keeps-going-and-going--first'
211+
- waitForAnimationToEnd
212+
- assertVisible:
213+
id: 'nestingexample-message-bubble-a-very-long-name-for-a-title-that-just-keeps-going-and-going--first'
214+
- takeScreenshot: '.maestro/screenshots/NestingExample-Message-bubble-a-very-long-name-for-a-title-that-just-keeps-going-and-going---First'
215+
216+
# Story 30
217+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=nestingexample-message-bubble-a-very-long-name-for-a-title-that-just-keeps-going-and-going--second'
218+
- waitForAnimationToEnd
219+
- assertVisible:
220+
id: 'nestingexample-message-bubble-a-very-long-name-for-a-title-that-just-keeps-going-and-going--second'
221+
- takeScreenshot: '.maestro/screenshots/NestingExample-Message-bubble-a-very-long-name-for-a-title-that-just-keeps-going-and-going---Second-Story'
222+
223+
# Story 31
224+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=nestingexample-messageinput--basic'
225+
- waitForAnimationToEnd
226+
- assertVisible:
227+
id: 'nestingexample-messageinput--basic'
228+
- takeScreenshot: '.maestro/screenshots/NestingExample-MessageInput---Basic'
229+
230+
# Story 32
231+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=nestingexample-message-reactions--message-one'
232+
- waitForAnimationToEnd
233+
- assertVisible:
234+
id: 'nestingexample-message-reactions--message-one'
235+
- takeScreenshot: '.maestro/screenshots/NestingExample-Message-Reactions---Message-One'
236+
237+
# Story 33
238+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=nestingexample-message-reactions--message-two'
239+
- waitForAnimationToEnd
240+
- assertVisible:
241+
id: 'nestingexample-message-reactions--message-two'
242+
- takeScreenshot: '.maestro/screenshots/NestingExample-Message-Reactions---Message-Two'
243+
244+
# Story 34
245+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=notesexample--notes-example'
246+
- waitForAnimationToEnd
247+
- assertVisible:
248+
id: 'notesexample--notes-example'
249+
- takeScreenshot: '.maestro/screenshots/NotesExample---Notes-Example'
250+
251+
# Story 35
252+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=safeareaexample-safeareainside--basic'
253+
- waitForAnimationToEnd
254+
- assertVisible:
255+
id: 'safeareaexample-safeareainside--basic'
256+
- takeScreenshot: '.maestro/screenshots/SafeAreaExample-SafeAreaInside---Basic'
257+
258+
# Story 36
259+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=safeareaexample-safeareainside--list-basic'
260+
- waitForAnimationToEnd
261+
- assertVisible:
262+
id: 'safeareaexample-safeareainside--list-basic'
263+
- takeScreenshot: '.maestro/screenshots/SafeAreaExample-SafeAreaInside---List-Basic'
264+
265+
# Story 37
266+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=safeareaexample-safeareaoutside--basic'
267+
- waitForAnimationToEnd
268+
- assertVisible:
269+
id: 'safeareaexample-safeareaoutside--basic'
270+
- takeScreenshot: '.maestro/screenshots/SafeAreaExample-SafeAreaOutside---Basic'
271+
272+
# Story 38
273+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=safeareaexample-safeareaoutside--list-basic'
274+
- waitForAnimationToEnd
275+
- assertVisible:
276+
id: 'safeareaexample-safeareaoutside--list-basic'
277+
- takeScreenshot: '.maestro/screenshots/SafeAreaExample-SafeAreaOutside---List-Basic'
278+
279+
# Story 39
280+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=safeareaexample-usablearea--safe-area'
281+
- waitForAnimationToEnd
282+
- assertVisible:
283+
id: 'safeareaexample-usablearea--safe-area'
284+
- takeScreenshot: '.maestro/screenshots/SafeAreaExample-UsableArea---Safe-Area'
285+
286+
# Story 40
287+
- openLink: 'exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=safeareaexample-usablearea--no-safe-area'
288+
- waitForAnimationToEnd
289+
- assertVisible:
290+
id: 'safeareaexample-usablearea--no-safe-area'
291+
- takeScreenshot: '.maestro/screenshots/SafeAreaExample-UsableArea---No-Safe-Area'

examples/expo-example/.storybook-web/main.ts

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,27 @@
1-
import type { StorybookConfig } from '@storybook/react-webpack5';
1+
import type { StorybookConfig } from '@storybook/react-native-web-vite';
22
import { join, dirname } from 'path';
3-
/**
4-
* This function is used to resolve the absolute path of a package.
5-
* It is needed in projects that use Yarn PnP or are set up within a monorepo.
6-
*/
7-
function getAbsolutePath(value) {
8-
return dirname(require.resolve(join(value, 'package.json')));
9-
}
103

114
type ServerStorybookConfig = StorybookConfig & {
125
reactNativeServerOptions: { host: string; port: number };
136
};
147

158
const main: ServerStorybookConfig = {
169
stories: ['../components/**/*.stories.?(ts|tsx|js|jsx)'],
10+
1711
addons: [
18-
getAbsolutePath('@storybook/addon-webpack5-compiler-babel'),
19-
getAbsolutePath('@storybook/addon-essentials'),
20-
getAbsolutePath('@storybook/addon-interactions'),
21-
'@storybook/addon-react-native-web',
12+
'@storybook/addon-essentials',
13+
'@storybook/addon-interactions',
2214
// note why does this break with get absolute?
2315
'@storybook/addon-react-native-server',
2416
'storybook-addon-deep-controls',
2517
],
18+
19+
framework: {
20+
name: '@storybook/react-native-web-vite',
21+
options: {},
22+
},
23+
2624
// logLevel: 'debug',
27-
framework: getAbsolutePath('@storybook/react-webpack5'),
2825

2926
reactNativeServerOptions: {
3027
host: 'localhost',

examples/expo-example/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Try this:
2+
`npx uri-scheme open "exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=controlexamples-boolean--basic" --ios`
3+
or this:
4+
`npx uri-scheme open "exp://127.0.0.1:8081/--/?STORYBOOK_STORY_ID=controlexamples-controlexample--example" --ios`

0 commit comments

Comments
 (0)