Git Product home page Git Product logo

unit-and-ui-testing-kotlin's Introduction

Unit and Ui testing using Kotlin

Description

The following is a project that uses Kotlin and has unit and ui tests written in Kotlin

Contents

Setup Steps

To setup Android for espresso tests, go to the app/build.gradle and add the following and then sync the gradle.

androidTestImplementation 'androidx.test:rules:1.1.1'
androidTestImplementation 'androidx.test.ext:truth:1.1.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'

Update the AndroidManifest.xml.

<activity android:name=".SecondActivity"
    android:parentActivityName=".MainActivity"/>

Tools

  • Fastlane
  • Github Actions

How to run the project locally

To run the unit tests locally.

./gradlew testdebugUnitTest

To run the ui tests locally, but first we need an emulator to be open.

./gradlew connectedCheck

Helpful resources

The following link provides an intro on how you can use Kotlin with Android including the Java examples.

A good guide for writing espresso tests in Kotlin.

Another guide on how to write espresso tests in Kotlin

Guide for how to use Fastlane to run tests.

A helpful guide for how to use Intents in Kotlin, plus how to avoid using set setOnClickListener.

unit-and-ui-testing-kotlin's People

Contributors

dependabot[bot] avatar jprendy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.