Open uniquejava opened 2 years ago
Update: I managed to identify the text on toast message with appium OCR plugin, but it's a little overkill
// only if we can find the toast element by its accessibilityLabel like we do for username and password
// const message = await $('~toastMessage').getText();
// expect(message).toBe('Wrong ID or Password');
// workaround: use ocr to take a screenshot and recognize the text
await driver.ocrWaitForTextDisplayed('Wrong ID or Password', {
androidRectangles: {
top: 1012,
left: 259,
right: 834,
bottom: 1164,
},
timeout: 5000,
});
Can you create a PR for this issue?
Can you create a PR for this issue?
Hello, thank you for your response, later I found that it's a general appium issue for absolutely positioned views
, not a issue from your plugin.
I got it from here: https://petrlz63.medium.com/appium-tips-for-react-native-apps-d869d68921db
Avoid position=”absolute” for container's views
There is a problem that appium doesn’t see elements inside absolutely positioned views. So you can’t interact with. [Learn more](http://www.wswebcreation.nl/clicking-on-an-element-with-appium-that-cant-be-found-in-the-ui-tree/).
Also using ocr is not that bad for our app, so feel free to close this issue.
Hello, dear component author,
We are testing our app with appium, we can set a accessiblityLabel for any element and use it in our test script. However, I found that even if I set it for this custom toast component, it's not able to be located.
Any idea? I'd just like to verify the toast message in my test script.
Test script:
Component code: