Working with Lightning apps¶
Building the app¶
Suitest requires Lightning's inspector to be ON in order to work with user interface elements. Make sure
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
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
- HbbTV / Freeview Play apps
- HTML based apps
- LG webOS apps
- Samsung Tizen apps
- PlayStation 4 apps
- Xbox One HTML-based apps
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:
z indexproperties of any element, including when transformation or animation is applied.
text colorproperties of the elements defined with Text texture.
image 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 widthproperties always return default values (
rgb(0, 0, 0)and
valueproperties 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.