Using UbuntuTestCase as a root item hides its contents

Bug #1436091 reported by Tim Peeters
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
ubuntu-ui-toolkit (Ubuntu)
Confirmed
Wishlist
Unassigned
ubuntu-ui-toolkit (Ubuntu RTM)
New
Undecided
Unassigned

Bug Description

If you run a test qml app with launcher, and the root item is an UbuntuTestCase, the contents will not show. This is not a problem with tests that have an Item as root and the UbuntuTestCase embedded inside that, like this example:

import QtQuick 2.2
import Ubuntu.Components 1.1
import Ubuntu.Test 1.0

//UbuntuTestCase { // use this instead of Item, and the contents shows blank
Item {
    width: units.gu(50)
    height: units.gu(80)

    MainView {
        anchors.fill: parent

        useDeprecatedToolbar: false

        Page {
            title: "Test"
            Rectangle {
                anchors.centerIn: parent
                width: 100
                height: 100
                color: "green"
            }
        }
    }

    UbuntuTestCase {
        // write your tests here
    }
}

However, if you remove the root Item and replace it by the commented-out UbuntuTestCase (the UbuntuTestCase that is embedded can then be removed, but it makes no difference in this case), then none of the contents (the MainView with a Page and Rectangle) will be visible in the window opened by launcher.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ubuntu-ui-toolkit (Ubuntu):
status: New → Confirmed
Cris Dywan (kalikiana)
Changed in ubuntu-ui-toolkit (Ubuntu):
importance: Undecided → Critical
assignee: nobody → Christian Dywan (kalikiana)
Revision history for this message
Tim Peeters (tpeeters) wrote :

It may be related that TestCase is not visible. This is how it is implemented:

Item {
    id: testCase
    visible: false
...

Revision history for this message
Tim Peeters (tpeeters) wrote :

Perhaps it should not be visible, and it is not a bug but a feature that needs to be documented.

Cris Dywan (kalikiana)
Changed in ubuntu-ui-toolkit (Ubuntu):
importance: Critical → Medium
Cris Dywan (kalikiana)
Changed in ubuntu-ui-toolkit (Ubuntu):
assignee: Christian Dywan (kalikiana) → nobody
importance: Medium → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.