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
  • Use the dragAndDrop runScript step
  • Supported parameters

Was this helpful?

Edit on GitHub
  1. Creating Tests
  2. Advanced Use Cases

Drag and Drop

Last updated 1 year ago

Was this helpful?

This feature is currently in Beta for Android Only.

Occasionally, you may need to long-press and drag an item to move it across the screen.

Use the dragAndDrop runScript step

Trigger using the runScript command.

Copy this snippet to try it your tests:

- longPressOn:
    point: '50%,38%'
- tapOn:
    text: 'Widgets'
- tapOn:
    text: 'Chrome'
- runScript:
    file: './moropo.js'
    env:
      command: 'dragAndDrop'
      above: 'Chrome search'
      end: '40%,40%'

Supported parameters

from - A text identifier from the app hierarchy. Moropo will drag from the center of this element.

above - Use instead of 'from'. This will select a point 120 pixels above the text identifier. This is useful for dragging an Android widget.

end - The drop location as a percentage-based coordinate (.e.g. 40%,40%).

duration - The number of milliseconds to drag action takes (defaults to 1000)

Need more parameters for your use case? Drop us a message, and we'll extend the API.

Example of dragging an Android widget on to the home screen