QField icon indicating copy to clipboard operation
QField copied to clipboard

Test and refactor FeatureForm

Open mohsenD98 opened this issue 1 week ago • 1 comments

Initial: some tests and refactoring.

  1. Remove some registrations that cause warnings and are never used.
  2. Add test QML files to executable in CMake; this makes us see them in Qtcreator and navigate through them with Ctrl+K.
  3. Remove stringUtilities and use StringUtils.

Second: Test Case for FeatureForm

This pull request adds three test cases to verify the functionality of the FeatureForm component.

The tests cover three different scenarios:

  • Test_00_featureForm: Verifies that the feature form is properly initialized and displays the expected data for an Apiary layer with id 64.
  • Test_01_featureForm: Verifies that the feature form is properly initialized and displays the expected data for a Field layer with id 39.
  • Test_02_featureForm: Verifies that the feature form is properly initialized and displays the expected data for a Tracks layer with id 1.

Each test case checks the following aspects of the feature form:

Toolbar visibility
Title label text
Tab row presence and content
Field repeater item content and behavior
Attribute editor loader values and behavior

The tests use various methods to verify these aspects, including compare statements to check for equality and Utils.findChildren to locate UI elements.

mohsenD98 avatar Jun 27 '24 17:06 mohsenD98