Skip to content

Commit

Permalink
release 0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JakimLi committed May 10, 2019
1 parent 001fa4d commit 7666322
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 13 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Lightweight API testing tool based on cucumber JVM
Introduction
------------

Pandaria is a DSL written based on cucumber JVM to simplify the HTTP API testing, everything with cucumber still works.
Pandaria is a DSL written based on cucumber JVM to simplify the HTTP/Graphql API testing, everything with cucumber still works.
Using pandaria you don't need to learn programming

[中文介绍](README_zh.md)
Expand Down Expand Up @@ -91,7 +91,7 @@ More [Usage](doc/usage.md)

Latest Release
--------------
* 0.2.8
* 0.3.0

See [Release Notes](doc/release_notes.md)

Expand Down Expand Up @@ -119,19 +119,19 @@ dependencies {
<dependency>
<groupId>com.github.jakimli.pandaria</groupId>
<artifactId>pandaria-core</artifactId>
<version>0.2.8</version>
<version>0.3.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.jakimli.pandaria</groupId>
<artifactId>pandaria-db</artifactId>
<version>0.2.8</version>
<version>0.3.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.jakimli.pandaria</groupId>
<artifactId>pandaria-mongo</artifactId>
<version>0.2.8</version>
<version>0.3.0</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
12 changes: 6 additions & 6 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ SELECT NAME, AGE FROM USERS
dependencies {
testCompile(
"io.cucumber:cucumber-junit:4.0.0",
'com.github.jakimli.pandaria:pandaria-core:0.2.8',
'com.github.jakimli.pandaria:pandaria-db:0.2.8',
'com.github.jakimli.pandaria:pandaria-mongo:0.2.8'
'com.github.jakimli.pandaria:pandaria-core:0.3.0',
'com.github.jakimli.pandaria:pandaria-db:0.3.0',
'com.github.jakimli.pandaria:pandaria-mongo:0.3.0'
)
}
```
Expand All @@ -106,19 +106,19 @@ dependencies {
<dependency>
<groupId>com.github.jakimli.pandaria</groupId>
<artifactId>pandaria-core</artifactId>
<version>0.2.8</version>
<version>0.3.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.jakimli.pandaria</groupId>
<artifactId>pandaria-db</artifactId>
<version>0.2.8</version>
<version>0.3.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.jakimli.pandaria</groupId>
<artifactId>pandaria-mongo</artifactId>
<version>0.2.8</version>
<version>0.3.0</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apply plugin: 'java'

allprojects {
group = 'com.github.jakimli.pandaria'
version = '0.2.8'
version = '0.3.0'
}

allprojects {
Expand Down
7 changes: 6 additions & 1 deletion doc/release_notes.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
Release 0.2.8 (2019-01-29) Latest
Release 0.3.0 (2019-05-11) Latest
=================================
Graphql Test
* Support graphql query and mutation

Release 0.2.8 (2019-01-29)
=================================
Variables
---------
Expand Down
82 changes: 82 additions & 0 deletions doc/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ Table of Contents
* [Upload file](#upload-file)
* [HTTPS](#https)
* [Proxy](#proxy)

* [Graphql Test](#graphql-test)
* [query](#query)
* [mutation](#mutation)
* [variables](#varaibles)
* [operationName](#operation-name)

* [Database Operations](#database-operations)
* [Queries](#queries)
Expand Down Expand Up @@ -457,6 +463,82 @@ Java system properties are used for HTTP(S) proxy. e.g, below is how to add it u
```


Graphql Test
-------------
@since 0.3.0

Pandaria support graphql testing over HTTP, currenty query and mutation are supported.

### Query
```gherkin
Scenario: basic query without specify operation name
* graphql:
"""
query bookById($id: String){
book(id: $id) {
title
isbn
author {
name
}
}
}
"""
* variables:
"""
{
"id": "1"
}
"""
* send
* verify: '$.data.book.title'='CSS Designer Guide'
* verify: '$.data.book.isbn'='ISBN01123'
* verify: '$.data.book.author.name'='someone'
```
You can send a graphql query and verify the returning data. variables are optional.

Or you can put the query and variables in file as usual.
```gherkin
* graphql: query_book_by_id.graphql
* variables: css_designer_guide.id.json
* send
* verify: '$.data.book.title'='CSS Designer Guide'
* verify: '$.data.book.isbn'='ISBN01123'
* verify: '$.data.book.author.name'='someone'
```

### Mutation
Usage of mutation similar with query, just replace the query with mutation.

### Variables
Variable is optional.
```gherkin
* variables:
"""
{
"id": "1"
}
* variables: css_designer_guide.id.json
```

### Operation Name
If multiple operations presented in one single request, operation name is required by graphql server.
it's optional when single operation presented in single request.

```gherkin
Scenario: query with operation name
* graphql: query_book_by_id.graphql
* variables: css_designer_guide.id.json
* operation: bookById
* send
* verify: '$.data.book.title'='CSS Designer Guide'
* verify: '$.data.book.isbn'='ISBN01123'
* verify: '$.data.book.author.name'='someone'
```


Database Operations
-------------------
You can directly use sql to operate on database, pandaria use spring jdbc, you need to configure your datasource
Expand Down

0 comments on commit 7666322

Please sign in to comment.