generate TestCase

Overview

generate TestCase with Kotlin

UnitTest with Gradle

Usage

1. add maven Repository to build.gradle.kts

repositories {
    maven {
        url = uri("https://maven.pkg.github.com/Kamedon/KTestCaseDSL")
        credentials {
            username = "USER_NAME"
            password = "USER PERSONAL ACCESS TOKEN"
        }
    }
}

2. add dependencies to build.gradle.kts

dependencies {
    implementation("com.kamedon:ktestcasedsl:x.y.z")
}

3. define TestCase

class TestCaseTest {
    @Test
    fun suiteTest() {
        val suite = testSuite("TestSuite 1") {
            case("case1") {
                preCondition {
                    condition("pre-condition-1")
                }
                step("step1-1")
                step("step2-2") {
                    verify("verify1-2-1")
                }
                step("step1-3") {
                    verify("verify1-3-1")
                    verify("verify1-3-2")
                }
                step("step1-4") {
                    verify("verify1-4-1")
                }

                verify("verify-1")
                verify("verify-2")

                postCondition {
                    condition("post-condition-1")
                    condition("post-condition-2")
                }
            }
            case("case2") {
                step("step2-1") {
                    verify("verify2-1-1")
                }
            }
        }

        assertEquals("TestSuite 1", suite.title)
        assertEquals("case1", suite.cases[0].title)
        assertEquals("pre-condition-1", suite.cases[0].preConditions.conditions[0].title)
        assertEquals("step2-2", suite.cases[0].caseSteps[1].title)
        assertEquals("verify1-3-2", suite.cases[0].caseSteps[2].verifies[1].title)
        assertEquals("verify-2", suite.cases[0].verifies[1].title)
        assertEquals("post-condition-2", suite.cases[0].postConditions.conditions[1].title)
        assertEquals("verify2-1-1", suite.cases[1].caseSteps[0].verifies[0].title)
    }
}

4. output TestCase

Output in Any Format you want.

ex: output Markdown

Sample Markdown Extension

fun TestSuite.markdown(): String {
    // ...
}

suite.markdown()

output text

# TestSuite 1
## case1
### PreCondition
- pre-condition-1

### Test Step
1. step1-1

2. step2-2
    - [ ] verify1-2-1

3. step1-3
    - [ ] verify1-3-1
    - [ ] verify1-3-2

4. step1-4
    - [ ] verify1-4-1
### Expected Result
- [ ] verify-1
- [ ] verify-2
### PostCondition
- post-condition-1
- post-condition-2

## case2
### PreCondition

### Test Step
1. step2-1
    - [ ] verify2-1-1
### Expected Result
### PostCondition

Advanced Feature

Add Any Attribute to TestSuite or TestCase

Sample Custom Attribute

You might also like...
Auto-generate the fastest possible Parcelable implementations for Java and Kotlin

This project is deprecated It will still be maintained, but no new features will be added. Please use Parcelize, as it is the official way of generati

Custom ImageView to generate captcha image.
Custom ImageView to generate captcha image.

CaptchaImageView Custom ImageView to generate captcha image. Add CaptchaImageView to your layout test.jinesh.captchaimageviewlib.CaptchaImageView

This library provides advance views for lists and stacks. Some of the views are build on top of RecyclerView and others are written in their own. Annotations are compiled by annotation processor to generate bind classes. DOCS -->
This library provides advance views for lists and stacks. Some of the views are build on top of RecyclerView and others are written in their own. Annotations are compiled by annotation processor to generate bind classes. DOCS --

PlaceHolderView An advance view for lists and stacks Some Implementations Documentation You can find the PlaceHolderView documentation here which has

Android application that allows users to take or import photo of chessboard, recognizes the pieces and generate the Forsyth-Edwards Notation.
Android application that allows users to take or import photo of chessboard, recognizes the pieces and generate the Forsyth-Edwards Notation.

♛ ChessBoard Importer Frontend ♛ Repository for the frontend part of project "Chessboard Importer". The project is realized by the team of 4 students

Qart is Android App that's based on CuteR project. App generate QR code that merge a picture. So the QR code looks more beautiful.
Qart is Android App that's based on CuteR project. App generate QR code that merge a picture. So the QR code looks more beautiful.

Qart is Android App that's based on CuteR project. App generate QR code that merge a picture. So the QR code looks more beautiful.

Generate Mermaid graphs from docker-compose files (in kotlin).
Generate Mermaid graphs from docker-compose files (in kotlin).

docker-compose-viz with Mermaid Generate Mermaid graphs from docker-compose files (in kotlin). Inspired from https://github.com/pmsipilot/docker-compo

Generate inspections from output of executables

tool-to-inspection Template ToDo list Create a new IntelliJ Platform Plugin Template project. Get known with the template documentation. Verify the pl

Generate helper methods for compose navigation using KSP

Compose NavGen Generate helper methods for compose navigation using KSP. 🚧 You can try it now, but it's still under development. 🚧 TODO Support defa

A small tool to help you generate android projects that have a base code.

Volt Project A small tool to help you generate android projects that have a base code. Usage Change project in base directory. python volt-gen.py pac

Annotation proccessor for generate public observers
Annotation proccessor for generate public observers

Anzidcodogen Annotation proccessor for generate public observers Supported annotation PublicSharedFlow, PublicLiveData, InternalSharedFlow, InternalLi

Generate a JSON bookmarks document from a GitHub user

Github to bookmarks This little webapp will generate a JSON bookmarks document from a GitHub user. This is intended to be used with bbt. An instance i

A project aiming to generate KMP declarations from several library versions

kotlin-ketchup A project aiming to generate KMP declarations from several library versions LICENSE Apache 2.0. See ./LICENSE in this repository See th

Used to generate the template code of GetX framework
Used to generate the template code of GetX framework

Language: English | 中文简体 statement some fast code snippet prompt come from getx-snippets-intelliJ Description install Plugin effect Take a look at the

A Kotlin library used to analyse discrete Markov chains, in order to generate plausible sequences

Markov Markov is a Kotlin library used to analyse discrete Markov chains, in order to generate plausible sequences. Using This project is still under

Auto-pipeline: a source code generator, it will generate your component's pipeline

auto-pipeline 🚀 auto-pipeline is a source code generator, it will generate your

This program will read from your android application string.xml file and generate translated strings.xml files in your preferred languages using google sheet.
This program will read from your android application string.xml file and generate translated strings.xml files in your preferred languages using google sheet.

Localize your application content This program will read from your application string.xml file and generate translated strings.xml files in your prefe

This is a Kotlin multiplatform template project used to generate and deploy a natively compiled AWS lambda function using the custom runtime.
This is a Kotlin multiplatform template project used to generate and deploy a natively compiled AWS lambda function using the custom runtime.

Overview This is a Kotlin multiplatform template project used to generate and deploy a natively compiled AWS Lambda function using a custom runtime. U

FizzBuzzKotlin - A function fizzBuzz to generate a list of string based on the input number

FizzBuzzKotlin write a function fizzBuzz to generate a list of string based on t

Svg-to-compose-intellij - A simple Android Studio plugin to generate Jetpack Compose ImageVector icons

svg-to-compose-intellij A simple Android Studio plugin to generate Jetpack Compo

Releases(0.6.0)
Owner
kamedon
kamedon
A small tool to help you generate android projects that have a base code.

Volt Project A small tool to help you generate android projects that have a base code. Usage Change project in base directory. python volt-gen.py <pac

Victor Varenik 3 Feb 2, 2022
Generate MVVM-UseCase-Api-DI feature packages with 1 click

Android MVVM Generator Pre-requisites Project assumes that you use Hilt, Retrofit, Kotlin, Flows, Jetpack ViewModel and MVVM with UseCase layer. Impor

Talha Hasan Zia 16 Dec 10, 2022
Generate data-view-binding adapters of android recycler view.

Items 这个库可以为 Android 的 RecyclerView 生成基于 Data-View-Binding 的 Adapter。 对比其他一些类似的开源库,它有以下的一些优势: 更好的拓展性。这个库不需要你继承特定的 Adapter 或 ViewHolder 类,你可以继承任何第三方提供的

nekocode 253 Nov 11, 2022
:sound: [Android Library] Easily generate pure audio tone of any frequency in android

Android library to easily generate audio tone in android. Generating pure tone of an specific frequency was never that easy. ZenTone does all the heav

Nishant Srivastava 102 Dec 19, 2022
A tool to generate Android ContentProviders.

Android ContentProvider Generator (acpg) A tool to generate Android ContentProviders. It takes a set of entity (a.k.a "table") definitions as the inpu

Benoit Lubek 623 Dec 13, 2022
🚀Plugin for Android Studio And IntelliJ Idea to generate Kotlin data class code from JSON text ( Json to Kotlin )

JsonToKotlinClass Hi, Welcome! This is a plugin to generate Kotlin data class from JSON string, in another word, a plugin that converts JSON string to

Seal 2.8k Jan 3, 2023
Android library to generate image avatar from the first letter of a username. Letter avatar like Gmail Android best practice

AvatarImageGenerator Generate first letter avatar Image like gmail's contact avatar. It generates an drawable that can be be set to an ImageView. Inst

Korir Amos 61 Sep 25, 2022
💫 A Gradle Plugin to generate your networking code from Swagger

Swagger Gradle Codegen A Gradle plugin to generate networking code from a Swagger spec file. This plugin wraps swagger-codegen, and exposes a configur

Yelp.com 399 Nov 28, 2022
Simple library to generate and view PDF in Android

PDFCreatorAndroid Simple library to generate and view PDF in Android A simple library to create and view PDF with zero dependency Or native code. Add

Tej Pratap Singh 234 Dec 11, 2022