All Projects → AirtestProject → PocoUnit

AirtestProject / PocoUnit

Licence: Apache-2.0 license
Unittest framework for test automation

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to PocoUnit

Pyrequest
接口自动化项目
Stars: ✭ 135 (+164.71%)
Mutual labels:  unittest
Go Carpet
go-carpet - show test coverage in terminal for Go source files
Stars: ✭ 210 (+311.76%)
Mutual labels:  unittest
dumbmutate
Simple mutation-testing
Stars: ✭ 32 (-37.25%)
Mutual labels:  unittest
Expekt
BDD assertion library for Kotlin
Stars: ✭ 163 (+219.61%)
Mutual labels:  unittest
Django Mock Queries
A library for mocking django queryset functions in memory for testing
Stars: ✭ 187 (+266.67%)
Mutual labels:  unittest
Datatest
Tools for test driven data-wrangling and data validation.
Stars: ✭ 238 (+366.67%)
Mutual labels:  unittest
Miniredis
Pure Go Redis server for Go unittests
Stars: ✭ 1,907 (+3639.22%)
Mutual labels:  unittest
c-project-template
A C project template with Makefile, command line options parsing, unittest using cmocka and valgrind
Stars: ✭ 97 (+90.2%)
Mutual labels:  unittest
Python Unittest Tutorial
Python3 tutorial - unittest module - PyMOTW
Stars: ✭ 190 (+272.55%)
Mutual labels:  unittest
JMemoryBuddy
No description or website provided.
Stars: ✭ 44 (-13.73%)
Mutual labels:  unittest
Ploop
Prototype Lua object-oriented program system, with many modern features like attribute, overload, etc. For Lua 5.1 or above, include luajit
Stars: ✭ 163 (+219.61%)
Mutual labels:  unittest
Wechatvideocourse
《微信公众号+小程序快速开发》视频教程课件及代码
Stars: ✭ 185 (+262.75%)
Mutual labels:  unittest
FineCodeCoverage
Visualize unit test code coverage easily for free in Visual Studio Community Edition (and other editions too)
Stars: ✭ 391 (+666.67%)
Mutual labels:  unittest
Kotlinmvparchitecture
Clean MVP Architecture with Dagger2 + Retrofit2 + Mockito + Fresco + EasiestGenericRecyclerAdapter using Kotlin. Added Unit Tests(Kotlin Tests)!
Stars: ✭ 143 (+180.39%)
Mutual labels:  unittest
laziest
Work in Progress: Package that trying to generate unit tests from code
Stars: ✭ 18 (-64.71%)
Mutual labels:  unittest
Javascript Testing Best Practices
📗🌐 🚢 Comprehensive and exhaustive JavaScript & Node.js testing best practices (August 2021)
Stars: ✭ 13,976 (+27303.92%)
Mutual labels:  unittest
Fake Xrm Easy
The testing framework for Dynamics CRM and Dynamics 365 which runs on an In-Memory context and deals with mocks or fakes for you
Stars: ✭ 216 (+323.53%)
Mutual labels:  unittest
examplejs
A tool for converting example code into test cases
Stars: ✭ 44 (-13.73%)
Mutual labels:  unittest
HTMLTestRunner
Modern style test report based on unittest framework.
Stars: ✭ 128 (+150.98%)
Mutual labels:  unittest
elm-doctest
doctest runner against Elm-lang source files
Stars: ✭ 13 (-74.51%)
Mutual labels:  unittest

PocoUnit (unittest framework for poco)

pocounit

如需构建自动化工程项目,请直接使用 my-testflow

可配合airtest和poco使用的单元测试框架。规范了脚本编写的格式,提供流式日志(stream log)记录服务,然后可以使用 PocoResultPlayer 将运行的内容回放。

Installation

pip install pocounit

用法

首先需要继承基类PocoTestCase实现项目组自己的MyBaseTestCase,在MyBaseTestCase预处理中将需要用到的对象准备好(包括实例化hunter和poco和动作捕捉),以后在其余用例中继承MyBaseTestCase即可。

基本用法可参考一下代码模板。

# coding=utf-8

from pocounit.case import PocoTestCase
from pocounit.addons.poco.action_tracking import ActionTracker

from poco.drivers.unity3d import UnityPoco


class MyBaseTestCase(PocoTestCase):
    @classmethod
    def setUpClass(cls):
        super(MyBaseTestCase, cls).setUpClass()
        cls.poco = UnityPoco()

        # 启用动作捕捉(action tracker)
        action_tracker = ActionTracker(cls.poco)
        cls.register_addon(action_tracker)

然后可以开始编写自己的testcase

# coding=utf8

from ... import MyBaseTestCase


# 一个文件里建议就只有一个TestCase
# 一个Case做的事情尽量简单,不要把一大串操作都放到一起
class MyTestCase(MyBaseTestCase):
    def setUp(self):
        # 可以调用一些前置条件指令和预处理指令
        pass

    # 函数名就是这个,用其他名字无效
    def runTest(self):
        # 普通语句跟原来一样
        self.poco(text='角色').click()

        # 断言语句跟python unittest写法一模一样
        self.assertTrue(self.poco(text='最大生命').wait(3).exists(), "看到了最大生命")

        self.poco('btn_close').click()
        self.poco('movetouch_panel').offspring('point_img').swipe('up')

    def tearDown(self):
        # 如果没有清场操作,这个函数就不用写出来
        pass

    # 不要写以test开头的函数,除非你知道会发生什么
    # def test_xxx():
    #     pass


if __name__ in '__main__':
    import pocounit
    pocounit.main()
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].