Skip to content

Commit e702245

Browse files
authored
test: add tests for recent bugs (#474)
# Summary + wrote tests for fixes in PRs: 405, 424, 462, 430, 428 + added button "Max|Base" in test screen. In "Base" state it behaves just as before, with the same height, in "Max" the input is allowed to be a lot bigger(in terms of height). Useful in some tests where we have more text. + modals now in test screen avoid keyboard, so Maestro is able to click on inputs, buttons in them. This keyboard avoiding functionality is implemented in `ModalShell` which is then used by all modal components. + added tests ids to modal inputs and buttons ## Test Plan Run `yarn test:e2e` and verify that tests pass. Also we should run `yarn test:e2e --update-screenshots` and see if any screenshots were altered, this is because as of right now Maestro has a bug, where it does not fail when baseline image and newly capture have different dimensions. ## Screenshots / Videos EnrichedInput is allowed to be a lot bigger in "Max" mode. <img width="519" height="1009" alt="Screenshot 2026-03-09 at 15 52 04" src="https://github.com/user-attachments/assets/1d74f4ad-ad79-4e27-8bf9-c1708336e15f" /> Modals now in test screen avoid keyboard, so all the buttons and fields are accessible by Maestro. <img width="519" height="1009" alt="Screenshot 2026-03-09 at 15 54 22" src="https://github.com/user-attachments/assets/4c675cfd-842e-418e-859d-f8858a5384a8" /> ## Compatibility | OS | Implemented | | ------- | :---------: | | iOS | ✅ | | Android | ✅ |
1 parent 2638469 commit e702245

28 files changed

Lines changed: 426 additions & 109 deletions

.maestro/assets/sample_image.jpg

12.8 KB
Loading
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
appId: swmansion.enriched.example
2+
---
3+
# PR #424 - fix(iOS): drawing image in proper place
4+
# Verifies that an image inserted between paragraphs stays in the correct
5+
# position and does not shift when text is typed around it.
6+
- launchApp
7+
8+
- tapOn:
9+
id: "toggle-screen-button"
10+
11+
- tapOn:
12+
id: "size-max-button"
13+
14+
- tapOn:
15+
id: "editor-input"
16+
17+
- inputText: "Paragraph one"
18+
- pressKey: Enter
19+
- pressKey: Enter
20+
21+
- inputText: "Paragraph two"
22+
23+
- tapOn:
24+
id: "editor-input"
25+
point: "50%,50%"
26+
27+
# cursor is now on the blank second line
28+
29+
- runFlow:
30+
file: "../subflows/insert_image.yaml"
31+
32+
- runFlow:
33+
file: "../subflows/capture_or_assert_screenshot.yaml"
34+
env:
35+
SCREENSHOT_NAME: "image_position_stability_before_typing"
36+
37+
- tapOn:
38+
id: "editor-input"
39+
point: "50%,50%"
40+
- inputText: "Paragraph in the middle"
41+
42+
- runFlow:
43+
file: "../subflows/capture_or_assert_screenshot.yaml"
44+
env:
45+
SCREENSHOT_NAME: "image_position_stability_after_typing"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
appId: swmansion.enriched.example
2+
---
3+
# PR #462 - fix(android): parsing initial HTML
4+
# Verifies that setting an HTML defaultValue with headings renders correctly
5+
# without duplicate or extra tags being inserted.
6+
- launchApp
7+
8+
- tapOn:
9+
id: "toggle-screen-button"
10+
11+
- runFlow:
12+
file: "../subflows/set_editor_value.yaml"
13+
env:
14+
VALUE: "<html><h1>Hello</h1><h2>World</h2><p>!!!</p></html>"
15+
16+
- tapOn:
17+
id: "size-max-button"
18+
19+
- runFlow:
20+
file: "../subflows/capture_or_assert_screenshot.yaml"
21+
env:
22+
SCREENSHOT_NAME: "initial_html_parsing"
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
appId: swmansion.enriched.example
2+
---
3+
# "PR #405 - fix(ios): mention parsing"
4+
# Verifies that mentions with single-quoted HTML attributes are parsed and styled correctly.
5+
6+
- launchApp
7+
8+
- tapOn:
9+
id: "toggle-screen-button"
10+
11+
- runFlow:
12+
file: "../subflows/set_editor_value.yaml"
13+
env:
14+
VALUE: "<mention text='@John Doe' indicator='@' id='1' type='user'>@John Doe</mention>"
15+
16+
- runFlow:
17+
file: "../subflows/capture_or_assert_screenshot.yaml"
18+
env:
19+
SCREENSHOT_NAME: "mention_parsing_single_quoted_attributes"
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
appId: swmansion.enriched.example
2+
---
3+
# PR #430 - fix(Android): removing paragraph styles
4+
# Verifies that backspacing text from a line in a code block does not strip
5+
# paragraph styles from the remaining lines.
6+
- launchApp
7+
8+
- tapOn:
9+
id: "toggle-screen-button"
10+
11+
- tapOn:
12+
id: "editor-input"
13+
14+
- tapOn:
15+
id: "toolbar-quote"
16+
17+
- inputText: "A"
18+
- pressKey: Enter
19+
- inputText: "B"
20+
- pressKey: Enter
21+
- inputText: "C"
22+
23+
# Tap on the second line
24+
- tapOn:
25+
id: "editor-input"
26+
point: "40%,50%"
27+
28+
# Clear second line
29+
- pressKey: Backspace
30+
- pressKey: Backspace
31+
32+
- runFlow:
33+
file: "../subflows/capture_or_assert_screenshot.yaml"
34+
env:
35+
SCREENSHOT_NAME: "paragraph_style_after_removal"
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
appId: swmansion.enriched.example
2+
---
3+
# PR #428 - fix(android): merging and splitting paragraph styles Verifies that
4+
# toggling off a paragraph style on one line does not affect the style of
5+
# adjacent lines
6+
- launchApp
7+
8+
- tapOn:
9+
id: "toggle-screen-button"
10+
11+
- tapOn:
12+
id: "editor-input"
13+
14+
- tapOn:
15+
id: "toolbar-quote"
16+
17+
- inputText: "1"
18+
- pressKey: Enter
19+
- inputText: "2"
20+
- pressKey: Enter
21+
- inputText: "3"
22+
23+
# Tap on the second line
24+
- tapOn:
25+
id: "editor-input"
26+
point: "40%,50%"
27+
28+
- tapOn:
29+
id: "toolbar-quote"
30+
31+
- runFlow:
32+
file: "../subflows/capture_or_assert_screenshot.yaml"
33+
env:
34+
SCREENSHOT_NAME: "paragraph_style_toggle"
203 KB
Loading
197 KB
Loading
23.3 KB
Loading
5.44 KB
Loading

0 commit comments

Comments
 (0)