Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-50514

Mixing TestCases with and without "when: windowShown" in one file skips TestCases or hangs

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P4: Low
    • Resolution: Unresolved
    • Affects Version/s: 5.5.0
    • Fix Version/s: None
    • Component/s: Testing: QuickTest
    • Labels:
      None
    • Environment:
      Tested on OS X 10.11.2

      Description

      Given "tst_FirstTest.qml":

      import QtQuick 2.5
      import QtTest 1.1
      
      Item {
          implicitWidth: 124
          implicitHeight: 116
      
          TestCase {
              name: "C"
              function test_3() {}
          }
      
          TestCase {
              name: "B"
              when: windowShown
              function test_2() {}
          }
      
          TestCase {
              name: "A"
              function test_1() {}
          }
      }
      

      If run with qmltestrunner, it'll skip TestCase B:

      PASS   : qmltestrunner::A::initTestCase()
      PASS   : qmltestrunner::A::test_1()
      PASS   : qmltestrunner::A::cleanupTestCase()
      PASS   : qmltestrunner::C::initTestCase()
      PASS   : qmltestrunner::C::test_3()
      PASS   : qmltestrunner::C::cleanupTestCase()
      

      Setting all or none TestCase(s) to "when: windowShown" is fine.

      If another test file is run after this one, TestCase B hangs. To reproduce save the attached files and run qmltestrunner on their folder.

      One workaround would be to not have more than one TestCase in one file, but the documentation explicitly states that "Multiple TestCase types can be supplied.".

        Attachments

        1. tst_FirstTest.qml
          0.3 kB
        2. tst_SecondTest.qml
          0.1 kB

        Gerrit Reviews Web Panel

        Error rendering 'com.meetme.plugins.jira.gerrit-plugin:gerritreviewsmodule'. Please contact your Jira administrators.

          Activity

            People

            • Assignee:
              qt.team.quick.subscriptions Qt Quick and Widgets Team
              Reporter:
              mlitauer Martin Litauer
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:

                Gerrit Reviews Side Panel

                Error rendering 'com.meetme.plugins.jira.gerrit-plugin:gerrit-reviews-side-panel'. Please contact your Jira administrators.