GithubHelp home page GithubHelp logo

shahid-lt / karate_wf Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vishnukdas/karate_wf

0.0 0.0 0.0 68.4 MB

Shell 0.04% JavaScript 58.97% Java 0.41% Scala 0.21% CSS 7.51% HTML 32.06% Gherkin 0.80%

karate_wf's Introduction

Overview

This is a self-contained project that is great for training or demo-ing all capabilities of Karate. It includes an app that has a working front-end UI and back-end API. Examples of API tests, API performance tests, API mocks and Web-Browser automation are included.

An 8 minute video ideal for beginners can be found here. Karate Kick Start - The TODO Sample and Demo Project. No programming or automation experience is required.

A longer video (20 minutes) which is a good introduction to Karate uses demos in this project and can be an additional reference: API Testing with Karate.

Use the official Karate IDE plugins for the best developer experience:

Instructions

You can use GitHub Codespaces to open this project directly in your browswer ! The default image includes Java and Maven, so you can skip the "Prerequisites" section below and go directly to Verify Setup. Make sure you install the Karate extension for Visual Studio Code in your Codespace. The Karate extension for VS Code can also be run in a Docker based devcontainer.

Prerequisites

Get Source Code

  • open a terminal in a folder in which karate-todo will be created
  • enter the following command: git clone https://github.com/karatelabs/karate-todo.git

If you don't have Git installed, you can download the source code as a ZIP file and extract it. The folder you get may be called karate-todo-main, so just re-name it to karate-todo.

Verify Setup

Open a terminal in the directory called karate-todo.

If the following command runs the ApiTest fine, you are all set:

Windows Linux / Mac
mvnw clean test ./mvnw clean test

Running karate-todo

In the commands below, mvn will work if you have Maven installed. Else replace it with ./mvnw or mvnw like shown above to use the Maven wrapper.

Now you can run the LocalRunner class as JUnit test. You can do this from an IDE that has Java support.

Or from the command-line:

mvn clean test -Dtest=LocalRunner

Now you should see the front-end at http://localhost:9826

To stop, just kill the process or stop the Java process from the IDE.

Running Tests

After the app has been started on localhost:9826, you can run tests.

One of the easiest ways to run tests, recommended for non-programmers or teams that are not familiar with Java, is to use Visual Studio Code.

There are more tests and examples in this project, but the following are the simplest ones to get started with:

API Test

Documentation: Karate API Testing

UI Test

Documentation: Karate UI Testing

API Mock

Documentation: Karate API Mocks

API Performance Test

To run performance test (after the app has been started on localhost):

mvn test -P gatling

The above command uses Maven and has to be run on the command-line. The entry point is perf/TodoSimulation.scala. The Maven pom.xml has a <profile> called gatling, which sets up the performance test and the karate-gatling dependency.

Documentation: Karate API Performance Testing

karate_wf's People

Contributors

ptrthomas avatar vishnukdas 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.