NativeScript / NativeScript/nativescript-cli

Add ability to test UI widgets

Open
#2,774 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature unit testing
Dominant language
JavaScript
Stars
1.1k
Forks
204
Avg merge
1d 9h
Merged PRs (30d)
8

Description

From @PeterStaev on April 23, 2016 9:57

From what I see currently it is not possible to test UI widgets. I tried to parse a widget with builder.parse or just create a new object inside the test and set up properties/bindings but both approaches do not initialize the widget fully (i.e. on android the _createUI function is not called, on iOS onLoaded event is never fired). Would be great if we can add tests for UI widgets (especially for people developing UI plugins :))

Copied from original issue: NativeScript/nativescript-unit-test-runner#9

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by investigating the unit-test handling around builder.parse and direct widget creation, focusing on the Android _createUI path and the iOS onLoaded event mentioned in the report. Determine how widget lifecycle initialization should be exercised in tests, and consider the work complete when UI widgets can be instantiated and their platform-specific initialization is testable on both platforms.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
mobile
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.