|
| 1 | +appId: swmansion.enriched.example |
| 2 | +--- |
| 3 | +# Test maxLength behavior: typing, native copy/paste, and HTML imperative setting |
| 4 | +- launchApp |
| 5 | + |
| 6 | +- tapOn: |
| 7 | + id: 'toggle-screen-button' |
| 8 | + |
| 9 | +# 1. Press the button to set maxLength to 10 |
| 10 | +- tapOn: |
| 11 | + id: 'max-length-10-button' |
| 12 | + |
| 13 | +- tapOn: |
| 14 | + id: 'editor-input' |
| 15 | + |
| 16 | +# 2. Write 1234567890, try to write more. The extra '123' should be rejected. |
| 17 | +- inputText: '1234567890' |
| 18 | +- inputText: '123' |
| 19 | + |
| 20 | +- runFlow: |
| 21 | + file: '../subflows/capture_or_assert_screenshot.yaml' |
| 22 | + env: |
| 23 | + SCREENSHOT_NAME: 'maxlength_typing_limit' |
| 24 | + |
| 25 | +# 3. Remove 4 characters to have '123456', select it, copy, and paste at the end. |
| 26 | +- tapOn: |
| 27 | + id: 'editor-input' |
| 28 | + point: '50%, 50%' |
| 29 | + |
| 30 | +- pressKey: backspace |
| 31 | +- pressKey: backspace |
| 32 | +- pressKey: backspace |
| 33 | +- pressKey: backspace |
| 34 | + |
| 35 | +- doubleTapOn: |
| 36 | + id: 'editor-input' |
| 37 | + point: '10%, 30%' |
| 38 | + |
| 39 | +- tapOn: |
| 40 | + text: 'Copy' |
| 41 | + |
| 42 | +- tapOn: |
| 43 | + id: 'editor-input' |
| 44 | + point: '50%, 30%' |
| 45 | + |
| 46 | +- longPressOn: |
| 47 | + id: 'editor-input' |
| 48 | + point: '50%, 30%' |
| 49 | + |
| 50 | +- tapOn: |
| 51 | + text: 'Paste' |
| 52 | + |
| 53 | +- runFlow: |
| 54 | + file: '../subflows/capture_or_assert_screenshot.yaml' |
| 55 | + env: |
| 56 | + SCREENSHOT_NAME: 'maxlength_paste_limit' |
| 57 | + |
| 58 | +# 4. Set inputs value as `123456 <a>some longer link</a>`, style should be present on remaining text |
| 59 | +- runFlow: |
| 60 | + file: '../subflows/set_editor_value.yaml' |
| 61 | + env: |
| 62 | + VALUE: '<p>123456 <a href="https://swmansion.com">some longer link</a></p>' |
| 63 | + |
| 64 | +- runFlow: |
| 65 | + file: '../subflows/capture_or_assert_screenshot.yaml' |
| 66 | + env: |
| 67 | + SCREENSHOT_NAME: 'maxlength_link_kept' |
| 68 | + |
| 69 | +# 5. Set inputs value as `123456 <mention>John Doe</mention>`, style should be stripped |
| 70 | +- runFlow: |
| 71 | + file: '../subflows/set_editor_value.yaml' |
| 72 | + env: |
| 73 | + VALUE: '<p>12345 <mention text="@John Doe" indicator="@">@John Doe</mention></p>' |
| 74 | + |
| 75 | +- runFlow: |
| 76 | + file: '../subflows/capture_or_assert_screenshot.yaml' |
| 77 | + env: |
| 78 | + SCREENSHOT_NAME: 'maxlength_mention_stripped' |
0 commit comments