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

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 9 Aug 2022, 05:43 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
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 9 Aug 2022, 19:16 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 28 Mar 2023, 10:52
      0
      • C Offline
        C Offline
        clanhuth
        wrote on 18 Oct 2022, 09:25 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
        • S SGaist
          9 Aug 2022, 19:16

          Hi,

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

          F Offline
          F Offline
          Furkan
          wrote on 28 Mar 2023, 10:52 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.

          S 1 Reply Last reply 28 Mar 2023, 10:58
          1
          • F Furkan
            28 Mar 2023, 10:52

            @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.

            S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 28 Mar 2023, 10:58 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 31 Mar 2023, 09:01
            0
            • S SGaist
              28 Mar 2023, 10:58

              @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 31 Mar 2023, 09:01 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.

              S 1 Reply Last reply 31 Mar 2023, 19:32
              1
              • F Furkan
                31 Mar 2023, 09:01

                @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.

                S Offline
                S Offline
                SGaist
                Lifetime Qt Champion
                wrote on 31 Mar 2023, 19:32 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 5 Apr 2023, 08:05
                1
                • S SGaist
                  31 Mar 2023, 19:32

                  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 5 Apr 2023, 08:05 last edited by
                  #8

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

                  S 1 Reply Last reply 5 Apr 2023, 20:05
                  0
                  • F Furkan
                    5 Apr 2023, 08:05

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

                    S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 5 Apr 2023, 20:05 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