Working with Lightning apps¶
Lightning is a JavaScript framework for building TV apps. It is a bit special, because it does not use DOM to render user interface, instead rendering your app into a canvas HTML element. It takes a few extra steps while preparing the setup, so that Suitest is able to inspect and assert on user interface elements.
Building the app¶
Suitest requires Lightning's inspector to be ON in order to work with user interface elements. Make sure
that inspector property is set to true in your Platform settings.
Note, that Lightning includes inspector only to developer build of your application, i.e. when you build it with
command lng build. In case you want to test a distribution build (lng dist), you would need to include
the Lightning inspector library manually.
Instrumenting the app¶
There are no extra steps in instrumentation process for Lightning apps. Just follow the steps according the platform you are building your app for:
- Android HTML-based apps
- Apple iOS HTML-based apps
- HbbTV/Freeview Play apps
- HTML-based apps
- LG webOS apps
- PlayStation 4/5 apps
- Samsung Tizen apps
- Sky apps
- VIDAA apps
- Vizio apps
- Websites
- Xbox (One, Series X/S) HTML-based apps
- Xfinity / Xumo TV / XClass TV apps
Limitations¶
Suitest supports grabbing properties from the default Lightning Textures, such as Rectangle, Image or Text. However, there is no way for us to inspect custom textures, as those are implementation-specific.
Suitest is able to get:
top,left,width,height,opacityandz indexproperties of any element, including when transformation or animation is applied.text contentsandtext colorproperties of the elements defined with Text texture.imageandimage loading stateproperties of the elements defined with Image texture.background colorproperty of the elements defined with Rectangle texture. Top left corner color is used for gradients.- all video properties, as Lightning is using HTML5 video player for the playback.
Properties that Suitest does not fetch:
border style,border colorandborder widthproperties always return default values (none,rgba(0, 0, 0, 0)and0respectively).class,hrefandvalueproperties are always empty, as they do not have a counterpart props in Lightning.idattribute is equal to Lightning element ID. It's usually a number and is assigned dynamically, so you can't use it as a stable identifier for your tests.
You can also use matches JS type of assertion in case you need to assert on some custom value of your Lightning element.
