-
-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add mobile swipe support for Compose elements #811
Conversation
@@ -19,6 +19,11 @@ package io.appium.espressoserver.lib.handlers | |||
import androidx.test.espresso.UiController | |||
import androidx.test.espresso.action.GeneralSwipeAction | |||
import androidx.test.espresso.action.ViewActions.* | |||
import androidx.compose.ui.test.onNodeWithTag | |||
import androidx.compose.ui.test.performTouchInput | |||
import androidx.compose.ui.test.* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to avoid star import
espresso-server/app/src/androidTest/java/io/appium/espressoserver/lib/handlers/MobileSwipe.kt
Show resolved
Hide resolved
espresso-server/app/src/androidTest/java/io/appium/espressoserver/lib/handlers/MobileSwipe.kt
Show resolved
Hide resolved
espresso-server/app/src/androidTest/java/io/appium/espressoserver/lib/handlers/MobileSwipe.kt
Outdated
Show resolved
Hide resolved
Please sign the CLA and update the corresponding section of README with the updated list of supported Compose methods |
thanks @mykola-mokhnach I will update as per above suggestion and submit another pull request |
imported specific class instead of star import removed and added empty line where needed added exception when direction is not provided
imported specific class instead of star import removed and added empty line where needed added exception when direction is not provided added .idea to .gitignore folder
@@ -0,0 +1,3 @@ | |||
# Default ignored files | |||
/shelf/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the .idea folder should not be included
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was mentioned in a previous comment to add .idea folder to .gitignore.Can you please reconfirm if you are asking to remove the .idea that I added from .gitignore file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is ok that the .idea item has been added to the .gitignore
It is only necessary now to untrack the corresponding files from it because they were added to the initial commit
else -> throw InvalidArgumentException("Direction cannot be ${params.direction}") | ||
} | ||
} else{ | ||
throw InvalidArgumentException("Must provide direction to swipe to :up,down,right,left") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider using require instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
used the require instead of line 94
also it looks like functional tests are not quite happy with the changes |
// Get a reference to the compose node | ||
val nodeInteractions = getNodeInteractionById(params.elementId) | ||
|
||
require((param.direction !=null){"Must provide direction to swipe to :up,down,right,left"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Must provide direction to swipe to: up, down, right, left
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you could generate available direction names automatically from enum items
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please format the line
Added a function to handle compose element interaction for swipe using composetestingapi "PerformTouchInput".