Skip to content

Commit f8d440c

Browse files
test: add e2e tests for customStyle font
1 parent 669d954 commit f8d440c

5 files changed

Lines changed: 149 additions & 1 deletion

File tree

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
appId: swmansion.enriched.example
2+
---
3+
# Validates custom font size and font family on plain text, inline styles, and paragraph styles.
4+
- launchApp
5+
6+
- tapOn:
7+
id: 'toggle-screen-button'
8+
9+
- tapOn:
10+
id: 'editor-input'
11+
12+
# Section 1: Plain text with custom fonts
13+
14+
- tapOn:
15+
id: 'toolbar-font-size'
16+
- tapOn:
17+
id: 'font-size-24'
18+
- inputText: '24px plain'
19+
- tapOn:
20+
id: 'toolbar-font-size'
21+
- tapOn:
22+
id: 'font-size-clear'
23+
- inputText: ' '
24+
25+
- tapOn:
26+
id: 'toolbar-font-family'
27+
- tapOn:
28+
id: 'font-family-Nunito-Bold'
29+
- inputText: 'Bold family'
30+
- tapOn:
31+
id: 'toolbar-font-family'
32+
- tapOn:
33+
id: 'font-family-clear'
34+
- inputText: ' '
35+
36+
- tapOn:
37+
id: 'toolbar-font-size'
38+
- tapOn:
39+
id: 'font-size-32'
40+
- tapOn:
41+
id: 'toolbar-font-family'
42+
- tapOn:
43+
id: 'font-family-Courier'
44+
- inputText: '32 Courier'
45+
- tapOn:
46+
id: 'toolbar-font-size'
47+
- tapOn:
48+
id: 'font-size-clear'
49+
- tapOn:
50+
id: 'toolbar-font-family'
51+
- tapOn:
52+
id: 'font-family-clear'
53+
- inputText: ' '
54+
55+
# Section 2: Inline styles + custom fonts
56+
57+
- tapOn:
58+
id: 'toolbar-bold'
59+
- tapOn:
60+
id: 'toolbar-font-size'
61+
- tapOn:
62+
id: 'font-size-20'
63+
- inputText: 'Bold 20px'
64+
- tapOn:
65+
id: 'toolbar-bold'
66+
- tapOn:
67+
id: 'toolbar-font-size'
68+
- tapOn:
69+
id: 'font-size-clear'
70+
- inputText: ' '
71+
72+
- tapOn:
73+
id: 'toolbar-italic'
74+
- tapOn:
75+
id: 'toolbar-font-family'
76+
- tapOn:
77+
id: 'font-family-Nunito-Italic'
78+
- inputText: 'Italic family'
79+
- tapOn:
80+
id: 'toolbar-italic'
81+
- tapOn:
82+
id: 'toolbar-font-family'
83+
- tapOn:
84+
id: 'font-family-clear'
85+
- inputText: ' '
86+
87+
- tapOn:
88+
id: 'toolbar-inline-code'
89+
- tapOn:
90+
id: 'toolbar-font-family'
91+
- tapOn:
92+
id: 'font-family-CascadiaCode-Bold'
93+
- inputText: 'Code bold'
94+
- tapOn:
95+
id: 'toolbar-inline-code'
96+
- tapOn:
97+
id: 'toolbar-font-family'
98+
- tapOn:
99+
id: 'font-family-clear'
100+
- inputText: ' '
101+
- pressKey: Enter
102+
103+
# Section 3: Paragraph styles + custom fonts
104+
105+
- tapOn:
106+
id: 'toolbar-quote'
107+
- tapOn:
108+
id: 'toolbar-font-family'
109+
- tapOn:
110+
id: 'font-family-CascadiaCode-Regular'
111+
- inputText: 'Quote code family'
112+
- tapOn:
113+
id: 'toolbar-font-family'
114+
- tapOn:
115+
id: 'font-family-clear'
116+
117+
- runFlow:
118+
file: '../subflows/capture_or_assert_screenshot.yaml'
119+
env:
120+
SCREENSHOT_NAME: 'custom_style_fonts'
40.4 KB
Loading
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
appId: swmansion.enriched.example
2+
---
3+
# Validates that custom style fonts are displayed correctly
4+
- launchApp
5+
6+
- tapOn:
7+
id: 'toggle-screen-button'
8+
9+
- tapOn:
10+
id: 'toggle-enriched-text-screen-button'
11+
12+
- runFlow:
13+
file: '../subflows/set_enriched_text_value.yaml'
14+
env:
15+
VALUE: >
16+
<html>
17+
<p>Regular family</p>
18+
<p><span style="font-size: 24px;">24px plain</span></p>
19+
<p><span style="font-family: Nunito-Bold;">Bold family</span></p>
20+
<p><span style="font-size: 32px; font-family: Courier;">32 Courier</span></p>
21+
<p><b><span style="font-size: 20px;">Bold 20px</span></b> <i><span style="font-family: Nunito-Italic;">Italic family</span></i> <code><span style="font-family: CascadiaCode-Bold;">Code bold</span></code></p>
22+
<h5><span style="font-size: 40px;">H5 40px</span></h5>
23+
<blockquote><p><span style="font-family: CascadiaCode-Regular;">Quote code family</span></p></blockquote>
24+
</html>
25+
26+
- runFlow:
27+
file: '../subflows/capture_or_assert_screenshot.yaml'
28+
env:
29+
SCREENSHOT_NAME: 'custom_style_fonts_visual'
63.8 KB
Loading

apps/example/src/components/Toolbar.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ const COLORS = [
4141
const FONT_SIZES = [12, 16, 20, 24, 28, 32, 36, 40];
4242

4343
const FONT_FAMILIES = [
44-
{ label: 'Regular', value: 'Nunito-Regular' },
4544
{ label: 'Bold', value: 'Nunito-Bold' },
4645
{ label: 'Italic', value: 'Nunito-Italic' },
4746
{ label: 'Code', value: 'CascadiaCode-Regular' },

0 commit comments

Comments
 (0)