-
-
Notifications
You must be signed in to change notification settings - Fork 27
Localization testing with appium mocha #260
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
Comments
My struggles to do localization tests continues today and i hope someone can share some light in my currently dark and unimaginative thought process. I've got this label on a page If i do this on a textfield and i insert some text using the |
In light of this new blog entry from Nativescript i thought i'd try once more to get appium and Nativescript working with textual elements. Appium: 1.16.0 I've isolated the issue enough to conclude it's not something that's wrong with my previous implementation. Creating the default template using Is this really intentional and if so what is the best practice to test textual elements? This is quite troublesome, not only for localization testing but also if dynamic text is used anywhere in your app! For the sake of clarity i've added a screenshot of the main-page.xml, the e2e.specc generated when adding the appium package and the result. ANY help would be appreciated or we have to find some other solution to test with. |
Hi @schnapzz, I've been having the exact issue as you. I don't know why other people aren't having this issue as well because it seems like a huge impediment if you cannot check text values on iOS. Have you happen to find any work-arounds since your most recent update by chance? |
Hi @keerl, |
Apparently this is a known problem, but there hasn't been anything that I know of to fix it. https://stackoverflow.com/questions/54797434/nativescript-dev-appium-uielement-text-uielement-getattributevalue-ret I did find a work-around though. Anywhere I'm trying to read/check the text value of a label, I bind the automationText property to the exact same value as the text. I can then just search for the text I want using findElementByAutomationText() and that will give me the UIElement I want with that text if it exists. |
Hi.
I'm currently trying to figure out a good way to test localization of an app and have some trouble accessing the label text of a button UIElement after i've accessed the element by automation text. After accessing the button UIElement i'm only able to get the automationText to test against.
It's my first time doing any form of testing with nativescript, appium and mocha and i might go about it completely wrong and if so advise would be much appreciated.
What i'm testing on
iPad simulator (9.7 inch) with OS v. 12.4
node v10.16.3
npm v6.9.0
{N} v. 6.0.1
runtimes v 6.0.1
nativescript-localize for i18n localization
I've followed setup instructions and found some issues here where people hadn't installed carthage, which i've installed.
A simple test looks something like this
const daDK = require(dk.default.json); // localization file for danish const changeUserButton = await driver.findElementByAutomationText('changeUserButton'); expect(await changeUserButton.text()).to.be.equal(daDK.user.change_user);
Doing a log of the
await changeUserButton.text()
retreives the automationText where it should have been Skift Bruger.I've also tried to access elements in different way ie. with findElementByXPath and findElementByText (though i've read text is only android).
Any suggestions as to solve this?
The text was updated successfully, but these errors were encountered: