Skip to content

Add tests for Latest-Posts Bock#2060

Merged
chipsnyder merged 2 commits intodevelopfrom
rnmobile/latest-post-tests
Apr 2, 2020
Merged

Add tests for Latest-Posts Bock#2060
chipsnyder merged 2 commits intodevelopfrom
rnmobile/latest-post-tests

Conversation

@chipsnyder
Copy link
Copy Markdown
Contributor

@chipsnyder chipsnyder commented Mar 24, 2020

Adds a device test for latest posts and adds the block to the initial html in order to help catch regressions

To test:
The CI run of the device tests should be enough to validate

PR submission checklist:

  • I have considered adding unit tests where possible.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@chipsnyder chipsnyder added the Testing Anything related to automated tests label Mar 24, 2020
@chipsnyder chipsnyder added this to the 1.25 milestone Mar 24, 2020
@chipsnyder chipsnyder requested a review from geriux March 24, 2020 19:09
@chipsnyder chipsnyder changed the title Add tests for Latest-Posts Bock [In Progress] Add tests for Latest-Posts Bock Mar 24, 2020
@chipsnyder
Copy link
Copy Markdown
Contributor Author

chipsnyder commented Mar 24, 2020

Looks like Android is having trouble finding the element. I think because it needs to scroll. Looking into this now.

@chipsnyder
Copy link
Copy Markdown
Contributor Author

@geriux This is good to go now

@chipsnyder chipsnyder changed the title [In Progress] Add tests for Latest-Posts Bock Add tests for Latest-Posts Bock Mar 25, 2020
Comment on lines +177 to +181
if ( ! await this.driver.hasElementByAccessibilityId( blockName ) ) {
for ( let step = 0; step < 5; step++ ) {
await this.driver.pressKeycode( 20 ); // Press the Down arrow to force a scroll.
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just wondering if you tried to use the swipeDown helpers, like let's say we add an ID to the Bottom Sheet and then swipe down to find the element. What do you think?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I tried using the TouchActions TouchAction().press(...).moveTo(...).release() for some reason I couldn't get it to recognize the touch within the modal. I even tried using it to Click on an already visible view with no luck.

I then took a look at the mobile commands, but swipeDown and scroll aren't supported for Android, so I didn't bother trying those.

I could have been missing something for the touch events, but I would probably need some pair programing there to help figure it out.

Copy link
Copy Markdown
Contributor Author

@chipsnyder chipsnyder Mar 27, 2020

Choose a reason for hiding this comment

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

More specifically this was the example I was working from:

let action = new wd.TouchAction();
action.press({x: 10, y: 10});
action.moveTo({x: 10, y: 100});
action.release();
await action.perform();

http://appium.io/docs/en/commands/interactions/touch/touch-perform/

For the coordinates, I replaced the x with the middle of the screen and set the y to be a few pixels from the bottom of the scroll to a few pixels from the top

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the detailed explanation! Since I'm also new to appium I wanted to investigate a bit but as you mentioned in your findings we are very limited on Android, tried some things with no luck. This makes me realize we should definitely try out Detox. It's kinda crazy we can't swipe 🤯

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for taking the time to explore your other ideas! I was actually hoping one of your ideas worked 😅 this is a bit of a hacky approach haha

@SergioEstevao SergioEstevao modified the milestones: 1.25, 1.26 Mar 31, 2020
@SergioEstevao
Copy link
Copy Markdown
Contributor

@chipsnyder I'm moving this to 1.26, feel free to move it back to 1.25 if this is something that can be considered a regression.

@chipsnyder chipsnyder merged commit 6ff600a into develop Apr 2, 2020
@chipsnyder chipsnyder deleted the rnmobile/latest-post-tests branch April 2, 2020 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Testing Anything related to automated tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants