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

UI Test Application #54

Open
halfnelson opened this issue Sep 18, 2019 · 13 comments
Open

UI Test Application #54

halfnelson opened this issue Sep 18, 2019 · 13 comments
Labels
help wanted Extra attention is needed

Comments

@halfnelson
Copy link
Owner

Nativescript Vue and Angular have a full test application that contains an instance of each supported component. We should add a complete test application for use with e2e tests and to help ensure that new versions of Nativescript or Svelte don't break us.

@benbot
Copy link
Contributor

benbot commented Oct 14, 2019

Is there anything like Enzyme that we can use to test nativescript applications autonomously? Or would we just have a kitchen sink app that will sort of be manually tested to see if anything breaks?

@halfnelson
Copy link
Owner Author

Gday benbot, there is a supported end to end tool for nativescript https://docs.nativescript.org/tooling/testing/end-to-end-testing/getting-started which we should use. I think in theory we can change the app in the demo folder so we can use this tool

@halfnelson halfnelson added help wanted Extra attention is needed and removed Hacktoberfest labels Oct 29, 2019
@halfnelson
Copy link
Owner Author

I have updated the demo project to a format that can contain a page per widget for e2e testing and updated the code in the project to the latest unit test runner

@safaiyeh
Copy link

safaiyeh commented Dec 15, 2019

I'm a fan of React Native's RNTester. They have a list view of each component's page and the properties to test. Would we want something like this? https://github.com/facebook/react-native/tree/master/RNTester

I am up to take on creating the tester app and create the base tests for each component. And iterate off that to test each property.

@halfnelson
Copy link
Owner Author

I think nativescript has a preferred end2end test tool "Appium" https://www.nativescript.org/blog/whats-new-with-nativescript-dev-appium.
And I think an app that showcases each of the widgets is ideal for that use case. We have the beginnings of one in the demo folder https://github.com/halfnelson/svelte-native/tree/master/demo/app
currently it only contains examples of listView and tabs since these seem to be the most troublesome components atm. It would be great to have that fleshed out and used as the basis of automated tests

@ghost
Copy link

ghost commented Dec 28, 2019

Your idea is to have an app that renders all SvelteNative components and lets Appium execute tests on each of the defined components?

@ghost
Copy link

ghost commented Feb 19, 2020

In the recent The NativeScript Show -Episode 2 a new testing approach using Detox was briefly introduced. In the next episode the guys wanna show some more in-depth details.

@halfnelson
Copy link
Owner Author

sounds good, I haven't even started on getting appium integrated, so if detox is smoother, that would be sweet.

@Dariusz-Czepiel
Copy link

Dariusz-Czepiel commented Jun 23, 2021

I got detox to work with svelte-native but there are issues with selectors.
Currently you can not get elements by.id or by.label. No matter if I set automatedText, accessibilityLabel or testID it can't find the element. Maybe an issue with how those attributes get passed to Nativescript? Or just an issue with Detox?
It does work with by.text and by.type
I am open to help with this

@farfromrefug
Copy link
Collaborator

@Dariusz-Czepiel could it be related to this NativeScript/NativeScript#9450?

@Dariusz-Czepiel
Copy link

@farfromrefug I applied the fix from there and now it works with by.label and testID attribute on elements!
I can post a gist if someone is interested or I can try to update the docs with the info @halfnelson

@rbudnar
Copy link

rbudnar commented Sep 11, 2021

@Dariusz-Czepiel I'd love to see your gist. I had trouble getting the solution posted by @rigor789 here in angular. I ended up modifying it to look like what was put in the PR to add in testID support (but closed, not merged).

@Bow2Jesus
Copy link

Why not create a similar approach to the one used for testing Angular / Nativescript applications? (https://v7.docs.nativescript.org/angular/tooling/testing/testing)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

7 participants