Skip to content
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

Closed
wants to merge 5 commits into from

Conversation

jasodhara
Copy link

Added a function to handle compose element interaction for swipe using composetestingapi "PerformTouchInput".

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Aug 29, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

@@ -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.*
Copy link
Contributor

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

@mykola-mokhnach
Copy link
Contributor

Please sign the CLA and update the corresponding section of README with the updated list of supported Compose methods

@jasodhara
Copy link
Author

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
@mykola-mokhnach mykola-mokhnach changed the title Mobile swipe support added for Compose elements feat: Add mobile swipe support for Compose elements Sep 5, 2022
@@ -0,0 +1,3 @@
# Default ignored files
/shelf/
Copy link
Contributor

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

Copy link
Author

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.

Copy link
Contributor

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

README.md Outdated Show resolved Hide resolved
else -> throw InvalidArgumentException("Direction cannot be ${params.direction}")
}
} else{
throw InvalidArgumentException("Must provide direction to swipe to :up,down,right,left")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider using require instead

Copy link
Author

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

@mykola-mokhnach
Copy link
Contributor

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"}
Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please format the line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants