Cocos Creator from the "beginners guide" to "automated testing"

The new framework guiding hand, automated testing framework, look at a video:
Cocos Creator from the "beginners guide" to "automated testing"
Click here to watch video

Preview Online Experience http://example.creator-star.cn/demo-ui-autorun

Note that on a computer in order to experience the preview function to automatically boot!

Shawn started just to complete beginners guide function points, while the boot code required to do non-*** style, try zero interference on the game code.

Step 1. Instruction

When the guide frame is completed, the configuration found low efficiency guided non-project non-programmers programmers, difficult to use, so the added step instructions mechanism in the guide frame, the guide arranged as much as possible of JSON, instead of JS .

The step of directing the instruction is a function written by a programmer, such as Shawn instructions have been provided in the guide frame 3:

  • Positioning command node: The node positioning, hollow mask, event interceptor
  • Finger command prompt: On the basis of positioning instruction adds animated finger tips
  • Text command prompt: display one or more lines of text tips

The following configuration is a finger command, prompts the user to click on a button:

{
    desc:'点击主界面主页按钮',
    command: { cmd:'finger', args:'Home > main_btns > btn_home' },
    delayTime: 0.5,
}

You can own gaming business needs, design their own command, for example:

{
    desc: '确认网络推送建筑数据为木材厂',
    command: {
        cmd: guide.command.WATCH_PUSH,
        pushType: Push.BUILDING
    },
    onPushData: function (data) {
        //建筑状态为已完成,建筑为木材厂
        return data.status === 4 &&
               data.BUILDING_CID === ConstantCid.BuildingCid.WOOD;
    }
}

A guide disposed above Shawn SLG project, instructions WATCH_PUSH, push data server for monitoring, parameters are meant Push.BUILDING building data, building data as long as server push, step onPushData response function will, by data parameter, do condition determination instruction returns true task is completed.

2. Automated Guided

Boot configuration problem is resolved, they found low test efficiency guidance, to start over every time. So in thinking, the ability to make their own computer to perform the boot process it? Of course it is possible!

Constantly surprises, the browser on the computer simulation by way of a mouse click, Shawn realizes automatic guide function, let Shawn suddenly discovered a new continent between - automated testing!

3. Process recording and playback

Boot Configuration testing process is not it? By computer boot configuration command to do repetitive things, this can save a lot of time testers, especially to do regression testing, testers machinery, numb to take the game most of the functions are performed several times, think about all that pain.

Thus thought, the click operation node sequentially recorded, one output reprocessing, two automatic guided directly playback +, can greatly reduce the difficulty boot configuration, more importantly, it is not a simple function of the guide, but software test automation!

Recall that once the work, the test team to study automated testing, how much to pay time and cost but the results are often far from satisfactory! Shawn careless move can hope to help more game testers and businesses to save time, reduce costs, and of course there are many worthy framework to guide improvement, we look forward to your participation and grow together!
Here Insert Picture Description
Shawn's Chat manuscript has been completed, to meet with you in accordance with the rules of this station released July 23, is now doing a final check to check the contents of this tutorial guide contains details of implementation and automatic guidance, including the following:

  • Node localization
  • Masking display
  • Stop and touch release event
  • Positioning command to achieve
  • Animation finger command to achieve
  • Text command prompt realization
  • Source code analysis framework to guide
  • Automated Guided achieve
  • Process recording and playback to achieve
  • Pilot testing the prototype tool

Shawn wish is to help more Cocos Creator beginners quick start to help companies reduce development costs, do valuable things! Shawn offline while also providing guidance services, or business partners who are interested can add my micro letter: z6346289.

Follow me on micro-channel public number "Kui Teer Planet", "juvenile Kui Teer", my article on the public starting number, thank you for reading, we would like to grow together!
Here Insert Picture Description

Guess you like

Origin blog.51cto.com/14459992/2422099