|
| 1 | +appId: com.react-native-reanimated-carousel.example |
| 2 | +name: Loop Mode - Wrapping Navigation |
| 3 | +--- |
| 4 | + |
| 5 | +# Navigate to E2E test page |
| 6 | +- runFlow: helpers/navigate-to-e2e.yaml |
| 7 | + |
| 8 | +# Verify loop is ON by default |
| 9 | +- assertVisible: "Loop: ON" |
| 10 | + |
| 11 | +# === Test: Swipe RIGHT from slide 0 should wrap to last slide === |
| 12 | + |
| 13 | +- swipe: |
| 14 | + start: "20%, 30%" |
| 15 | + end: "80%, 30%" |
| 16 | + duration: 400 |
| 17 | + |
| 18 | +- waitForAnimationToEnd: |
| 19 | + timeout: 3000 |
| 20 | + |
| 21 | +# With 6 items and loop ON, swiping right from 0 wraps to slide 5 |
| 22 | +- assertVisible: "Slide 5" |
| 23 | +- assertVisible: "Current Index: 5" |
| 24 | + |
| 25 | +# === Test: Swipe LEFT to go back to slide 0 (wrapping forward) === |
| 26 | + |
| 27 | +- swipe: |
| 28 | + start: "80%, 30%" |
| 29 | + end: "20%, 30%" |
| 30 | + duration: 400 |
| 31 | + |
| 32 | +- waitForAnimationToEnd: |
| 33 | + timeout: 3000 |
| 34 | + |
| 35 | +- assertVisible: "Slide 0" |
| 36 | +- assertVisible: "Current Index: 0" |
| 37 | + |
| 38 | +# === Test: Navigate to last slide and wrap forward === |
| 39 | + |
| 40 | +# Go to slide 5 via button |
| 41 | +- tapOn: |
| 42 | + id: "btn-goto-5" |
| 43 | + |
| 44 | +- waitForAnimationToEnd: |
| 45 | + timeout: 3000 |
| 46 | + |
| 47 | +- assertVisible: "Current Index: 5" |
| 48 | + |
| 49 | +# Swipe LEFT from slide 5 should wrap to slide 0 |
| 50 | +- swipe: |
| 51 | + start: "80%, 30%" |
| 52 | + end: "20%, 30%" |
| 53 | + duration: 400 |
| 54 | + |
| 55 | +- waitForAnimationToEnd: |
| 56 | + timeout: 3000 |
| 57 | + |
| 58 | +- assertVisible: "Slide 0" |
| 59 | +- assertVisible: "Current Index: 0" |
| 60 | + |
| 61 | +# === Test: Continuous loop - swipe through all slides === |
| 62 | + |
| 63 | +- swipe: |
| 64 | + start: "80%, 30%" |
| 65 | + end: "20%, 30%" |
| 66 | + duration: 400 |
| 67 | +- waitForAnimationToEnd: |
| 68 | + timeout: 3000 |
| 69 | +- assertVisible: "Current Index: 1" |
| 70 | + |
| 71 | +- swipe: |
| 72 | + start: "80%, 30%" |
| 73 | + end: "20%, 30%" |
| 74 | + duration: 400 |
| 75 | +- waitForAnimationToEnd: |
| 76 | + timeout: 3000 |
| 77 | +- assertVisible: "Current Index: 2" |
| 78 | + |
| 79 | +- swipe: |
| 80 | + start: "80%, 30%" |
| 81 | + end: "20%, 30%" |
| 82 | + duration: 400 |
| 83 | +- waitForAnimationToEnd: |
| 84 | + timeout: 3000 |
| 85 | +- assertVisible: "Current Index: 3" |
| 86 | + |
| 87 | +- swipe: |
| 88 | + start: "80%, 30%" |
| 89 | + end: "20%, 30%" |
| 90 | + duration: 400 |
| 91 | +- waitForAnimationToEnd: |
| 92 | + timeout: 3000 |
| 93 | +- assertVisible: "Current Index: 4" |
| 94 | + |
| 95 | +- swipe: |
| 96 | + start: "80%, 30%" |
| 97 | + end: "20%, 30%" |
| 98 | + duration: 400 |
| 99 | +- waitForAnimationToEnd: |
| 100 | + timeout: 3000 |
| 101 | +- assertVisible: "Current Index: 5" |
| 102 | + |
| 103 | +# One more swipe wraps back to 0 |
| 104 | +- swipe: |
| 105 | + start: "80%, 30%" |
| 106 | + end: "20%, 30%" |
| 107 | + duration: 400 |
| 108 | +- waitForAnimationToEnd: |
| 109 | + timeout: 3000 |
| 110 | +- assertVisible: "Current Index: 0" |
0 commit comments