Skip to content

Latest commit

 

History

History
51 lines (31 loc) · 1.69 KB

how-to-write-tests.md

File metadata and controls

51 lines (31 loc) · 1.69 KB

How to write tests

source code for test cases

src/test/java/org.nervos.ckb

create a new test case

read doc for more details.

include new test case to TestNG config file

for example:

<suite name="CKB System Testing" parallel="tests" thread-count="1">
    <test name="JSONRPC API Tests" preserve-order="true" verbose="2">
         <classes>
             <class name="org.nervos.ckb.function.jsonrpcapicase.BlockNumber"/>
         </classes>
    </test/>
</suite>

TestNG config file

systemTest.xml

The XML file is using to config the Test Suite name and test cases for each Test Group.

You can also define new groups inside XML and specify additional details in attributes, such as whether to run the tests in parallel, how many threads to use, whether you are running JUnit tests, etc...

By default, TestNG will run your tests in the order they are found in the XML file. If you want the classes and methods listed in this file to be run in an unpredictable order, set the preserve-order attribute to false.

Read doc for more details about config file.

Refs

Assertions