Game Automation Testing

Introduction


Automated testing is used to its full potential by many companies. Unit tests, Integration tests, UI tests, manual testing and other methods. But for some reason, in such a large area as GameDev, test automation comes down to the fact that builds are transferred to the QA department for manual testing. I’ll try to tell how I develop games, and how I write tests for them.



Of course, there are always exceptions, and in many companies, I hope that every build does go through most of the checks before getting into the QA, and especially to the players. Unfortunately, I was not able to work in such companies, although the selection is small - only 3 companies were replaced during my career. And in each of them the testing was carried out only manually (and in the first there weren’t even testers, do it by force - β€œwhoever did the feature checks it”)



About the game


A few words about the game - the mobile game Dungeon. Heroes wandering through the dungeons, collecting various useful things, completing tasks and pumping these same heroes. The description does not say that the game is complex and it has many different features. But inside, as it usually happens, everything is much more complicated.


Also about the insides of the game is the cocos2d-x-3.17 engine, the development language is C ++. Most tests are Python. Of the third-party tools used are TexturePacker (atlas assembly), Spine (2d skeletal animation), Tiled (tile level editor). This also includes Google Spreadsheets (most of the game data is stored in tables). Target platforms - Android, iOS. Development is underway on OS X / Windows.


The team is small - 2 people. An artist, he is an animator and I am a programmer. There is no game designer, no testers. For the most part, their work has been replaced by generation, tests, and other scripts that help us in the development process. The game is still in development, already 1.5 years. It is developed in free time and this time is limited. Therefore, a lot of additional code is written to minimize any routine work.


List of tests using the game



, , :




(, , )


, cocos2d-x, , (Cocos, CocosStudio, CocosBuilder ). , .


β€” xml. β€” xml. . , . , , , β€” .


, . xml-. , . , . , , / . , Python. , , .



, . , . , . , .


:


  • id
  • , . , . , .

: β€” ID , ; , β€” , .




. , β€” . , . , . , .



, , . , β€” . , β€” .




, , . ( , 80/20 ). β€” , . β€” , . ? β€” , . , , , , , . . , . , .



. Tower Defense, . 100 , 2 , 3 . 10 . , 1-2 . , , . β€” , , .


- , :


  • ( «» //)
  • , β€”
  • , .

, . , . β€” . , .


/ Google-


. , . .


Google- ( )


export_{table}.py . . , . , .


core-


β€” , . , ECS . , , β€” , . , . β€” , (, ).


β€” . 0 β€” . β€” . β€” , . TDD , .



- level- . , . . , , β€” . , , , . . . , , . β€” , . .



β€” , . , . , ( ECS). .


, β€” 5*5 ( , ) . β€” , .





β€” , , , .



UI


, , β€” UI . . , . β€” β€” . β€” - ()/ .


:
<client_testing_commands name="window_settings_and_credits" text="Window settings, credits">
    <sequence repeat_forever="no">
        <commands>
            <CTCommandWaitNode path="/content/title_layer"/>

            <!--   -->
            <CTCommandAudioEnable enabled="yes"/>

            <CTCommandPressButton node_name="bt_settings" />

            <!--    -->
            <CTCommandPressButton window_name="window_settings" name="disable_audio" />
            <CTCommandCheckNode window_name="window_settings" name="enable_audio" visible="yes"/>
            <CTCommandCheckNode window_name="window_settings" name="disable_audio" visible="no"/>
            <CTCommandCheckAudio enabled="no"/>

            <!--    -->
            <CTCommandPressButton window_name="window_settings" name="enable_audio" />
            <CTCommandCheckNode window_name="window_settings" name="enable_audio" visible="no"/>
            <CTCommandCheckNode window_name="window_settings" name="disable_audio" visible="yes"/>
            <CTCommandCheckAudio enabled="yes"/>

            <!--      -->
            <CTCommandPressButton window_name="window_settings" name="credits" />
            <CTCommandPressButton window_name="window_credits" name="close" />

            <!-- ,       -->
            <CTCommandPressButton window_name="window_settings" name="restore_inapps" />
            <CTCommandCheckNode name="spinner" visible="yes"/>

            <!--  -->
            <CTCommandExit />
        </commands>
    </sequence>
</client_testing_commands>

, , , .


:


  • ,
  • , , .
  • CI , .

β€” . . , , . , , . . ( , ) , , , . β€” , . 10-15 .


Git-


. , . , . 5-10 , . , .


include


, include , . , , , include . , , . , . .


code-style


. , , IDE . .



. β€” . (2048 )- . , . β€” , .


Spine


.spine , . cocos2d-x json, . json , . , , . . , .


Firebase TestLab


, apk Firebase TestLab . , OS. Robo-tests , . , . , . β€” .



, , , .. . . . . , .


CI


git-hooks , CI. bitbucket-pipelines. , TeamCity . unit, integration . . , , .



, , , . , , , .


I am pleased to read how games are tested in companies where they still practice this practice.

Source: https://habr.com/ru/post/undefined/


All Articles