Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. QA Tools
  3. Test Center
  4. How to run qml TestCase
QtWS25 Last Chance

How to run qml TestCase

Scheduled Pinned Locked Moved Solved Test Center
9 Posts 4 Posters 2.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Deyan
    wrote on last edited by
    #1

    Hi,
    I didn't find documentation of the topic. In web there are much talks about qmltestrunner? What is the appropriate way to run the qml tests in your official opinion?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      I would start by the Qt Quick Test chapter in Qt's documentation.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      F 1 Reply Last reply
      0
      • C Offline
        C Offline
        clanhuth
        wrote on last edited by
        #3

        @Deyan said in How to run qml TestCase:

        qmltestrunner

        Hi,

        SGaist already pointed to a resource that helps clarifying what qmltestrunner is.

        If however, you plan to do GUI testing of your QML application, then Squish GUI Tester would be the right tool.

        And finally, Squish Test Center (which this area of the forum is about) is a tool for collecting and analyzing reports from Squish GUI Tester, Squish Coco, etc.

        Best regards,
        Clemens Anhuth

        1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          I would start by the Qt Quick Test chapter in Qt's documentation.

          F Offline
          F Offline
          Furkan
          wrote on last edited by
          #4

          @SGaist Hi. When I try to use "quick_test_main" macro in my "main.cpp", I have an redefinition error. I change my main function's input to void. This change solve that arror but I want to use argc and argv. What should I do in that situation.

          SGaistS 1 Reply Last reply
          1
          • F Furkan

            @SGaist Hi. When I try to use "quick_test_main" macro in my "main.cpp", I have an redefinition error. I change my main function's input to void. This change solve that arror but I want to use argc and argv. What should I do in that situation.

            SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @Furkan Depending on what you need to do, it seems that QUICK_TEST_MAIN_WITH_SETUP is what you would need.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            F 1 Reply Last reply
            0
            • SGaistS SGaist

              @Furkan Depending on what you need to do, it seems that QUICK_TEST_MAIN_WITH_SETUP is what you would need.

              F Offline
              F Offline
              Furkan
              wrote on last edited by
              #6

              @SGaist Firstly, thank you for your advice. I have one question about that macro. There isn't any explanation about "Setup" function. What should be my point of view while writing this function?

              I have one more question about "TestCase". Is there any change to write that without any c++ file? I have a problem in "compare" qml function.

              SGaistS 1 Reply Last reply
              1
              • F Furkan

                @SGaist Firstly, thank you for your advice. I have one question about that macro. There isn't any explanation about "Setup" function. What should be my point of view while writing this function?

                I have one more question about "TestCase". Is there any change to write that without any c++ file? I have a problem in "compare" qml function.

                SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                The documentation is a bit lacking indeed. Setup is not a function but an object that you need to implement. There are three functions called (if you implemented them):

                • applicationAvailable
                • qmlEngineAvailable
                • cleanupTestCase

                I am unsure about what you are asking with regard to "TestCase". There's no need for anything more than to modify the main.cpp to do your custom initialization.

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                F 1 Reply Last reply
                1
                • SGaistS SGaist

                  The documentation is a bit lacking indeed. Setup is not a function but an object that you need to implement. There are three functions called (if you implemented them):

                  • applicationAvailable
                  • qmlEngineAvailable
                  • cleanupTestCase

                  I am unsure about what you are asking with regard to "TestCase". There's no need for anything more than to modify the main.cpp to do your custom initialization.

                  F Offline
                  F Offline
                  Furkan
                  wrote on last edited by
                  #8

                  @SGaist I helped a lot. Thanks for your help.

                  SGaistS 1 Reply Last reply
                  0
                  • F Furkan

                    @SGaist I helped a lot. Thanks for your help.

                    SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    The documentation has been updated.

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved