svelte-native icon indicating copy to clipboard operation
svelte-native copied to clipboard

UI Test Application

Open halfnelson opened this issue 6 years ago • 13 comments

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.

halfnelson avatar Sep 18 '19 22:09 halfnelson

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?

benbot avatar Oct 14 '19 13:10 benbot

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 avatar Oct 14 '19 21:10 halfnelson

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

halfnelson avatar Nov 02 '19 01:11 halfnelson

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.

safaiyeh avatar Dec 15 '19 19:12 safaiyeh

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

halfnelson avatar Dec 23 '19 00:12 halfnelson

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

ghost avatar Dec 28 '19 01:12 ghost

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.

ghost avatar Feb 19 '20 09:02 ghost

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

halfnelson avatar Feb 20 '20 22:02 halfnelson

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

Dariusz-Czepiel avatar Jun 23 '21 21:06 Dariusz-Czepiel

@Dariusz-Czepiel could it be related to this https://github.com/NativeScript/NativeScript/issues/9450?

farfromrefug avatar Jun 29 '21 06:06 farfromrefug

@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

Dariusz-Czepiel avatar Aug 14 '21 21:08 Dariusz-Czepiel

@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).

rbudnar avatar Sep 11 '21 14:09 rbudnar

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

Bow2Jesus avatar Jan 09 '23 16:01 Bow2Jesus