Moropo
RoadmapTerms
  • Welcome to Moropo
  • Quick Start
  • Uploading your app
    • Producing an Android Build
    • Producing an iOS Build
    • Uploading Your Build To Moropo
  • Creating Tests
    • Using the Test Creator
    • Test Configuration
    • Test Step Commands
      • addMedia
      • assertNotVisible
      • assertTrue
      • assertVisible
      • back (Android only)
      • clearKeychain (iOS Only)
      • clearState
      • copyTextFrom
      • doubleTapOn
      • eraseText
      • evalScript
      • extendedWaitUntil
      • hideKeyboard
      • inputRandomEmail
      • inputRandomNumber
      • inputRandomPersonName
      • inputRandomText
      • inputText
      • launchApp
      • longPressOn
      • openLink
      • pasteText
      • pressKey
      • repeat
      • runFlow
      • runScript
      • scroll
      • scrollUntilVisible
      • setLocation
      • startRecording
      • stopApp
      • stopRecording
      • swipe
      • takeScreenshot
      • tapOn
      • travel
      • waitForAnimationToEnd
    • Test Step Selectors
    • Importing From Maestro
    • Environment Variables
      • ${BUNDLEID}
      • ${EXPORELEASECHANNEL}
      • ${MOROPO_TEST_EMAIL}
      • ${MOROPO_EMAIL_URL}
    • Advanced Use Cases
      • JavaScript
      • Conditionals
      • Network Connection
      • Drag and Drop
  • Running Tests
    • Manually Trigger a Test Run
    • Scheduling a Test Run
    • Tags
    • Supported Devices
    • Test Execution Limits
    • Flakiness Tolerance & Retries
  • CI Integration
    • Initial CI Setup In Moropo
    • GitHub Action
    • Moropo API
      • Branches
      • Builds
      • Test Runs
      • Tests
  • Test Results
    • Results Explorer
    • Slack Reporting
    • Email Reporting
  • App Frameworks
    • Flutter
    • React Native
  • Guides
    • React Native Expo
    • Access Emails During A Test Flow
    • Git workflow using Moropo API
  • Infrastructure
    • IP Addresses
  • Security
    • Services Infrastructure
    • Security Best Practices
Powered by GitBook
On this page
  • Options
  • Using the direction shortcut
  • Setting swipe speed
  • Specifying start and end coordinates
  • Specifying a start element using 'from'
  • Related Commands

Was this helpful?

Edit on GitHub
  1. Creating Tests
  2. Test Step Commands

swipe

Last updated 1 year ago

Was this helpful?

This command allows you to mimic movement across a touch screen. This is useful for swiping components such as cards, carousels and bottom sheets.

Note: to move around a screen, you may prefer the command.

Options

Using the direction shortcut

For simple swipes, simply pass a direction:

⬆️ UP - swipes up from the centre of the screen to the top of the screen.

⬇️ DOWN - swipes down from the centre of the screen to the bottom of the screen

⬅️ LEFT - swipes from right to left of the screen

➡️ RIGHT - swipes from left to right of the screen

For example:

- swipe:
    direction: DOWN

Setting swipe speed

By default, the test runner will perform the swipe over 400 ms. That's the time it takes to get from start to end.

However, you may specify a custom speed (in milliseconds) using the duration command. For example, if you wanted to test a slow 2-second swipe:

- swipe:
    direction: RIGHT
    duration: 2000

Specifying start and end coordinates

If you need more control, you can tell the runner to use specific coordinates.

For example, with percentage-based coordinates:

- swipe:
    start: 80%,80%  #bottom right
    end: 20%,20%    #top left

Or using pixel-based coordinates:

- swipe:
    start: 400,220  #middle right
    end: 100,220    #middle left

NB: avoid pixel-based if possible as they don't translate to other screen sizes/viewports

Specifying a start element using 'from'

- swipe:
     from:
       text: "swipe from this text"
     direction: DOWN
- swipe:
     from:
       text: "swipe from this text"
     end: 50%,10%

Related Commands

scroll

scrollUntilVisible

If you need to target a specific view or component with your swipe command, then you can specify a starting using the from option.

For example, paired with the :

Or with the :

scroll
selector
direction shortcut
end coordinate