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
  • Basic Usage
  • Options
  • Examples
  • Related Commands

Was this helpful?

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

scrollUntilVisible

Last updated 1 year ago

Was this helpful?

This is similar to the simple command but will keep scrolling until an element appears in the view hierarchy. Identify the element using a .

Basic Usage

- scrollUntilVisible:
    element:
      text: "some text" # Any selector to identify the element
    speed: 80 # Optional number between 0-100. A higher number means faster scrolling.
    timeout: 10000 # Optional value in milliseconds after which the command fails if it's not found the element. Defaults to 20000ms.
    direction: DOWN # DOWN|UP|LEFT|RIGHT (optional, default: DOWN)
    visibilityPercentage: 100 # 0-100 (optional, default 100) Percentage of element visible in viewport
    centreElement: # Will attempt to centre the element in the viewport

Options

Speed

An optional number between 0 and 100. A higher number means faster scrolling. Defaults to 40.

- scrollUntilVisible:
    element:
      text: "submit"
    speed: 80

Timeout

An optional value in milliseconds. If the target element is not found within the timeout then the command will error. The default value is 20000ms(20 seconds).

- scrollUntilVisible:
    element:
      text: "submit"
    timeout: 30000

Direction

An optional value (DOWN, UP, LEFT or RIGHT) that sets the direction of the scroll. For example, specifying UP will scroll towards the top of the screen.

- scrollUntilVisible:
    element:
      text: "submit"
    direction: UP

Visibility Percentage

An optional value between 0 and 100; default 100. This value determines how much of the element must be visible in the viewport before passing this step.

- scrollUntilVisible:
    element:
      text: "submit"
    visibilityPercentage: 20

Centre Element

A boolean argument (True/False); default False. The test runner will attempt to centre the target element in the centre of the viewport. Useful for visual inspection of test output via screenshots or video.

- scrollUntilVisible:
    element:
      text: "submit"
    centreElement: True

Examples

In this example, the test will scroll down very slowly until half the footer of the page appears. If it does not appear within 60 seconds then the step times out.

- scrollUntilVisible:
    element:
      id: "page-footer"
    visibilityPercentage: 50
    timeout: 60000

Related Commands

scroll

scroll
selector