This repository provides a set of tests focused on automating common mobile gestures using Appium for mobile app testing, that includes gestures like taps, swipes, scrolls, drag-and-drop, and zoom using the ApiDemos app.
- Mobile Gestures Overview
- Scrolling
- Swiping
- Drag and Drop
- Sliding Seek Bar
- Zoom In and Out
- Running the Tests
- Install Appium Server.
- Install Appium Inspector.
- ApiDemos-debug.apk file.
- Set up a virtual or real Android device for testing.
Mobile gestures simulate user interactions on touch devices like smartphones and tablets. These interactions include:
- Tap: Quick touch, similar to a mouse click.
- Long Press: Touch and hold an element.
- Swipe: Move your finger across the screen to scroll or switch views.
- Scroll: Navigate content that extends beyond the screen's view.
- Drag and Drop: Move an object by dragging and releasing it.
- Zoom In/Out: Use two fingers to change zoom levels.
- Automate scrolling actions using Appium Inspector.
- Write the ScrollToText method to scroll until the text "Lists" is found.
- Click on Lists and verify that " Single choice list" is displayed.
- Automate swipe gestures using Appium Inspector.
- Use Selenium's Actions class to simulate swiping.
- Click and hold on the first image, move by an offset, and release.
- Verify that the third image is visible.
- Automate drag and drop gestures.
- Use By.Id to find the draggable and drop target elements.
- Use JavaScript actions to drag and drop the first red dot over the second one.
- Verify that the "Dropped!" message is displayed.
- Automate sliding actions for a seek bar.
- Use Appium Inspector's Coordinates Mode to get the precise sliding coordinates.
- Slide the seek bar to a specific value and assert the value is displayed.
- Write MoveSeekBarWithInspectorCoordinates method to slide the bar from the start to the end coordinates.
- Verify the displayed value matches the expected result.
- Use Appium Inspector to create a zoom-in gesture and execute it.
- Zoom out using similar steps.
- Use the saved gesture to zoom in and out at specific coordinates on the WebView.
Contributions are welcome! If you have any improvements or bug fixes, feel free to open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
For any questions or suggestions, please open an issue in the repository.