Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge #1

Merged
merged 377 commits into from
Jul 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
377 commits
Select commit Hold shift + click to select a range
41af4a2
webauto: this is big, we have friendly locators
ptrthomas Aug 18, 2019
cf58a4f
webauto: move finder & mouse to interfaces
ptrthomas Aug 19, 2019
bc3dbcc
adjust maven profile for ui in hope that it works
ptrthomas Aug 19, 2019
49014f9
Revert "Add afterFeature and beforeFeature hooks, RunnerBuilder"
Aug 19, 2019
37ea814
Merge branch 'develop' of https://github.com/intuit/karate into develop
Aug 19, 2019
7bdc7c8
Junit4 can run tests in parallel
Aug 19, 2019
1b8132b
improve zip based on feedback and doc
ptrthomas Aug 19, 2019
7aacaec
more doc updates based on feedback
ptrthomas Aug 19, 2019
1302d89
implemented waitForText() short-cut
ptrthomas Aug 19, 2019
0da4f41
webauto: decided to rename waitForText() and waitForEnabled()
ptrthomas Aug 20, 2019
cb905bd
Merge pull request #871 from pshrm/develop
ptrthomas Aug 20, 2019
2a77323
Revert "Merge pull request #871 from pshrm/develop"
ptrthomas Aug 20, 2019
9b46178
slight improve to timeline view tooltips
ptrthomas Aug 20, 2019
baf0cf9
additional tweak for #826 replaces #863
ptrthomas Aug 20, 2019
ae2d9e4
unified cli for karate core somewhat #827
ptrthomas Aug 20, 2019
47080fc
default to proper karate runner system always
ptrthomas Aug 20, 2019
383d081
fix bugs with cli runner and switch netty fatjar to runner builder #827
ptrthomas Aug 21, 2019
823e670
big improvement to intellij ide support
ptrthomas Aug 21, 2019
f9cd239
webauto: decided to use 1 based indexing for friendly locators
ptrthomas Aug 21, 2019
649e64c
thats what happens when you dont run the local tests
ptrthomas Aug 21, 2019
9ecb2b7
webauto: focus() breaks on fancy input fields, fixed
ptrthomas Aug 21, 2019
cdd799c
hooks expanded for all cases, beforeAll() afterAll()
ptrthomas Aug 21, 2019
4c978d3
webauto: improve target api design
ptrthomas Aug 22, 2019
c42b6cd
webauto: handle cookie failure in web-driver
ptrthomas Aug 22, 2019
13624d6
fix for focus() js and chrome cookie error routine
ptrthomas Aug 22, 2019
ef7318c
some long pending call vs read doc
ptrthomas Aug 23, 2019
0f2ab89
minor cosmetic readme tweak
ptrthomas Aug 23, 2019
9820d66
added a couple more crazy examples
ptrthomas Aug 23, 2019
00a6abf
webauto: reduce intensity of friendly locator search
ptrthomas Aug 23, 2019
08cccb8
gracefully fail if browser / input field type
ptrthomas Aug 23, 2019
51496d4
webauto: implemented waitForResultCount()
ptrthomas Aug 24, 2019
f0e5765
better error message if relative path does not exist
ptrthomas Aug 24, 2019
ae80214
draft version of vscode debug adapter protocol implementation
ptrthomas Aug 26, 2019
8869e89
move debug server test to junit so that karate-apache is on cp
ptrthomas Aug 26, 2019
a90e8e5
Add resources methods to the Builder
celcius112 Aug 27, 2019
ab77312
Merge pull request #880 from celcius112/develop
ptrthomas Aug 27, 2019
74e9207
vscode debug server start option
ptrthomas Aug 28, 2019
9fd55bc
Merge branch 'develop' of https://github.com/intuit/karate into develop
ptrthomas Aug 28, 2019
0b378a3
minor loggin changes to debug server
ptrthomas Aug 28, 2019
49007a2
use of waitForResultCount
ptrthomas Aug 28, 2019
3baed07
debug adapter decoder bad logic fixed
ptrthomas Aug 29, 2019
2e55fae
debug server now supports called features
ptrthomas Aug 29, 2019
fcf1940
get build to work on windows and clean up
ptrthomas Aug 29, 2019
9b1ff72
refactor / cleanup to prev commit ref #751
ptrthomas Aug 29, 2019
06a1d35
debug adapter protocol: implemented repl evaluate and step-back
ptrthomas Aug 30, 2019
e59bdf9
debug server: hot reload of code works
ptrthomas Aug 30, 2019
2b12ad7
tweak to fileutils for absolute file paths
ptrthomas Aug 30, 2019
5ffca1d
debug: another breakthrough - we can debug parallel threads
ptrthomas Sep 1, 2019
02c01fe
cleanup for prev commit
ptrthomas Sep 1, 2019
c148951
standalone jar cli error stack trace trimmed
ptrthomas Sep 2, 2019
5c5add5
debug server proper optimization of netty decoder
ptrthomas Sep 3, 2019
fbf2f9d
improve prev commit even more
ptrthomas Sep 3, 2019
5df19b3
some license headers were missing, added
ptrthomas Sep 3, 2019
2f723a3
fix relative path resolution, no more weird ///
ptrthomas Sep 4, 2019
9d3e43c
wip distributed testing capability
ptrthomas Sep 8, 2019
7c72c5f
jobdist: wip continues
ptrthomas Sep 8, 2019
a777b97
jobdist: reports aggregation working after scale-out
ptrthomas Sep 9, 2019
228b71f
distjob: wip ui test videos can be retrieved
ptrthomas Sep 9, 2019
4806204
distjob: ironed out most issues with workflow
ptrthomas Sep 9, 2019
09a0cdc
distjob: wip proven to work on jenkins + kubernetes
ptrthomas Sep 11, 2019
f1405e8
distjob: improvements, video embed
ptrthomas Sep 11, 2019
81f2349
fix bad bugs in job / exec
ptrthomas Sep 11, 2019
34e6154
fix nasty bug with nested call with driver
ptrthomas Sep 12, 2019
3979654
intro beforeStart and afterStop for driver config
ptrthomas Sep 12, 2019
1ae237a
fix step out in debug server
ptrthomas Sep 12, 2019
d37c025
improve / simplify fat-docker build
ptrthomas Sep 13, 2019
132b9a9
always wait for browser / driver port even if not starting
ptrthomas Sep 13, 2019
31354a1
no report for empty features
ptrthomas Sep 14, 2019
7adb1bf
fixed debug npe for background steps
ptrthomas Sep 14, 2019
938c0f2
screen recording for mobile automation
babusekaran Sep 15, 2019
362ba2f
distjob: bullet-proofing and some testing
ptrthomas Sep 15, 2019
4f82ec0
improve timeline html tooltip
ptrthomas Sep 16, 2019
2ed8a6b
debug: log message for hot reload implemented
ptrthomas Sep 16, 2019
11f9186
debug: improve user feedback
ptrthomas Sep 16, 2019
507deae
debug: improve log for prev commit
ptrthomas Sep 16, 2019
115689d
debug: try system exit for clean stop
ptrthomas Sep 16, 2019
c38ad9b
added appium api to readme doc
babusekaran Sep 16, 2019
0b4f852
review changes https://github.com/intuit/karate/pull/895
babusekaran Sep 16, 2019
6f339c1
Merge pull request #895 from babusekaran/appium_screen_recording
ptrthomas Sep 16, 2019
40edcc0
distjob: lot of fixes and bulletproofing saving work
ptrthomas Sep 16, 2019
7db4e30
update release process after 0.9.5.RC2
ptrthomas Sep 16, 2019
1e7fdef
adding back the simple jobserver test it is needed
ptrthomas Sep 17, 2019
2aa9cf9
fixed bugs in debug server
ptrthomas Sep 18, 2019
52d8393
fix for debug and maven class paths
ptrthomas Sep 18, 2019
f9e6340
decided to do the right thing and change driver scripts() to scriptAll()
ptrthomas Sep 18, 2019
1bfca87
debug support should work for gradle now
ptrthomas Sep 18, 2019
0286564
adding local docker demo runner
ptrthomas Sep 18, 2019
e086d34
driver is auto passed to called features
ptrthomas Sep 19, 2019
a39280e
lower-case-headers applies only to keys not values
ptrthomas Sep 19, 2019
44f2cb0
one line change makes jdk12 compile work for 8 runtime
ptrthomas Sep 20, 2019
d4936c1
attempt windows fix for paths with spaces
ptrthomas Sep 20, 2019
f045213
attempt fix for windows single feature debug session
ptrthomas Sep 20, 2019
57c669b
introducing scriptAll() that takes 3rd filter-predicate arg
ptrthomas Sep 21, 2019
439fa91
renamed findAll() to locateAll() and intro locate()
ptrthomas Sep 21, 2019
8a40a1f
added 3rd delay arg to driver input api
ptrthomas Sep 21, 2019
fdbc8a2
for sake of debugger, driver element to be stringify-able
ptrthomas Sep 21, 2019
039ae9f
classpath from jar was not working in some cases
ptrthomas Sep 23, 2019
a303ca5
minor doc updates before rc3
ptrthomas Sep 25, 2019
3c4b843
big change: we have killed the karate ui
ptrthomas Sep 25, 2019
609c841
doc updates since we killed the karate-ui
ptrthomas Sep 25, 2019
a60eb0a
changes for https://github.com/intuit/karate/issues/903
babusekaran Sep 25, 2019
d513082
Merge pull request #904 from babusekaran/embedsfromhooks
ptrthomas Sep 25, 2019
2683e1f
doc updates
ptrthomas Sep 25, 2019
2431cf6
one more doc tweak
ptrthomas Sep 25, 2019
fd6c0b4
ci can be normal openjdk now
ptrthomas Sep 26, 2019
2151c4a
ci mvn cache, and goodbye karate-ui
ptrthomas Sep 26, 2019
e223803
some doc edits, and to test ci
ptrthomas Sep 26, 2019
2c77903
improve contributor guides
ptrthomas Sep 26, 2019
b634e2c
wip: working on distributed gatling support
ptrthomas Sep 27, 2019
0ebb877
readme edits
ptrthomas Sep 28, 2019
c60c1fc
distributed job server working for gatling, todo test docker
ptrthomas Sep 29, 2019
a8e7586
job executor now will ping server with a heartbeat every 15 seconds
ptrthomas Sep 30, 2019
7b5438f
ignore examples jar files
ptrthomas Sep 30, 2019
9ddf122
add hot reload functionnality for mock server
benjaminqc Oct 1, 2019
bb3ed91
multipart/form-data endpoint success from REST client but fails in Ka…
Nishant-sehgal Oct 3, 2019
e3f0c26
minor edit for driver.title readme
ptrthomas Oct 3, 2019
8a080bf
make sure docker container has deps pre-loaded for gatling
ptrthomas Oct 4, 2019
09c8375
Merge pull request #914 from Nishant-sehgal/develop
ptrthomas Oct 4, 2019
b4ee8db
rebrand to karate ui, and added link to readme
ptrthomas Oct 7, 2019
9abcaf4
change file change handler to use Jave Watchservice instead of a slee…
benjaminqc Oct 7, 2019
1b39f26
implemented local address support for gatling
ptrthomas Oct 7, 2019
45bc4f1
added missing highlight() to element / finder api
ptrthomas Oct 8, 2019
a1e5b99
Merge pull request #909 from benjaminqc/feature/server_hot_reload
ptrthomas Oct 9, 2019
8988b15
code cleanup after #909
ptrthomas Oct 9, 2019
138874d
set type so that it does not create work dir with name null
ptrthomas Oct 9, 2019
33e0ada
HACKTOBERFEST-match != fails with two integers
Oct 10, 2019
e46cd7c
Merge pull request #918 from TamannaBhasin27/hacktoberfest-match-ne
ptrthomas Oct 11, 2019
538d674
fire change event for js based select-box twiddling
ptrthomas Oct 17, 2019
0f90dbe
added retry chained to finder / element
ptrthomas Oct 18, 2019
52f3a60
doc edits
ptrthomas Oct 20, 2019
f07e39b
MockSpringMvcServlet issue for @ControllerAdvice NoHandlerFoundException
Nishant-sehgal Oct 20, 2019
24e3ae8
Merge pull request #931 from Nishant-sehgal/develop
ptrthomas Oct 21, 2019
9d27729
code cleanup after #931
ptrthomas Oct 21, 2019
a3373ce
Update consumer-driven-contracts to spring boot 2
Oct 21, 2019
b77f292
Merge pull request #932 from man007yadav/develop
ptrthomas Oct 21, 2019
52a0b46
making correction to #932
ptrthomas Oct 21, 2019
a3dd838
update supervisord command to be the correct path for google-chrome
BadgerOps Oct 22, 2019
b6b87d1
Update Chrome.java
Oct 24, 2019
d68fb5a
Update Chrome.java
Oct 24, 2019
66d60d7
Update Chrome.java
Oct 24, 2019
bb2ba63
Merge pull request #937 from sivachithambaram/develop
ptrthomas Oct 24, 2019
06acbae
Merge pull request #934 from BadgerOps/bugfix/update_linux_chrome_path
ptrthomas Oct 24, 2019
7d7e8db
fix gatling value copy edge case ref #936
ptrthomas Oct 25, 2019
b212736
minor code cleanup
ptrthomas Oct 25, 2019
04818e2
Fix formatting in pages site
ghostwriternr Nov 1, 2019
7b0f3a2
Merge pull request #952 from ghostwriternr/fix-driver-types-docs
ptrthomas Nov 1, 2019
a36c030
Fix formatting in pages site
ghostwriternr Nov 1, 2019
8f52b28
escape intellij magic log strings #954
Nov 7, 2019
8119b54
escape intellij magic log strings #954
Nov 7, 2019
e73c8d7
Merge branch 'develop' of https://github.com/intuit/karate into develop
ptrthomas Nov 7, 2019
2d4d228
gatling url pattern bug
ptrthomas Nov 7, 2019
9baf19a
release tweaks for 0.9.5.RC4
ptrthomas Nov 7, 2019
4c64923
edge case syntax error should not hang tests #959
ptrthomas Nov 9, 2019
dd7c5a5
safer impl for #959
ptrthomas Nov 11, 2019
2dca6af
finally, solution for custom masking of http headers / payloads in lo…
ptrthomas Nov 15, 2019
028efac
doc edits minor
ptrthomas Nov 15, 2019
0d5cff9
http log masking for jersey also #699
ptrthomas Nov 16, 2019
c9b56d6
fix for #970 and replace #973
ptrthomas Nov 23, 2019
34ae1be
some doc / typo edits
ptrthomas Nov 29, 2019
0a011d8
dynamic scenario outline pre-scenario vars deep-copy was losing js fu…
ptrthomas Dec 3, 2019
0fbe197
error handling for #967
ptrthomas Dec 6, 2019
6e2e224
updating docs
ptrthomas Dec 6, 2019
b09cc72
dont auto-close driver in called scenarios #969
ptrthomas Dec 7, 2019
f2b00f4
implemented tags support in karate-gatling #968
ptrthomas Dec 7, 2019
0aeefb6
attempt to fix #924 but doesnt seem to work
ptrthomas Dec 7, 2019
a296d5c
updated docs to use Runner.path() builder API
ptrthomas Dec 8, 2019
deda89b
edit release process cheatsheet
ptrthomas Dec 8, 2019
193f5bc
edge case for regex combined with array fuzzy #988
ptrthomas Dec 9, 2019
58a4001
junit 5 should fail if no features found #989
ptrthomas Dec 9, 2019
54fb6eb
update doc for #989
ptrthomas Dec 9, 2019
022dc7a
edit readme for examples/jobserver
ptrthomas Dec 9, 2019
000fcf6
add getPrevResponse() to scenario-context for advanced hook use-cases
ptrthomas Dec 9, 2019
1f78553
better xpath for wildcard with index #993
ptrthomas Dec 12, 2019
c7b7522
of all the times you commit without testing #993
ptrthomas Dec 12, 2019
415ce50
doc edits and archetype sync for junit 5
ptrthomas Dec 15, 2019
1ca3232
multipart streams will be re-readable for retry until #999
ptrthomas Dec 15, 2019
501e705
[break] implemented configure abortedStepsShouldPass #755
ptrthomas Dec 15, 2019
53189f2
implemented driver poll for port configurable #990
ptrthomas Dec 15, 2019
692cab6
implemented mock headerContains() #997
ptrthomas Dec 15, 2019
3bf5bea
improve code for #755
ptrthomas Dec 16, 2019
acbc2ba
Add support for optional body in Postman convert
Celeo Dec 19, 2019
11165fd
log collection for dynamic scenario outline #1003
ptrthomas Dec 20, 2019
490a0c3
Merge pull request #1005 from Celeo/postman_import_changes
ptrthomas Dec 20, 2019
e0e494a
input stream special handling in json embedded expressions #1009
ptrthomas Dec 29, 2019
64b9105
doc edits and import cleanups
ptrthomas Dec 29, 2019
3ed8eda
Add logic for Postman import on netty CLI
Celeo Dec 30, 2019
407a27c
Include tests
Celeo Dec 30, 2019
64bc5df
Merge pull request #1011 from Celeo/issue_1008
ptrthomas Dec 31, 2019
832a72c
fix build after #1011
ptrthomas Dec 31, 2019
d75b9cd
wip - introducing [karate-robot]
ptrthomas Jan 5, 2020
f3977ee
[robot] keyword to init robot + config similar to [driver]
ptrthomas Jan 7, 2020
113b2d0
[robot] working on image matching, introed region concept
ptrthomas Jan 8, 2020
3b1ecc8
[robot] simple flow works
ptrthomas Jan 9, 2020
59c5edb
[robot] wip find by image even when scale is not 1:1
ptrthomas Jan 12, 2020
89f42c4
some places in docs / examples to use enhanced scenario outline
ptrthomas Jan 12, 2020
9049d29
support headless flag for firefox
paaco Jan 14, 2020
fa01579
Merge pull request #1018 from paaco/firefox-headless
ptrthomas Jan 14, 2020
6952756
Update documentation
paaco Jan 14, 2020
2b60d15
Update documentation
paaco Jan 14, 2020
ded55bb
Merge pull request #1020 from paaco/firefox-headless
ptrthomas Jan 14, 2020
70ee486
[robot] wip relaxing the image find threshold slightly
ptrthomas Jan 16, 2020
15aeb81
synchronized getFreePort to avoid duplicate port assignments
paaco Jan 16, 2020
9fcd4ce
skip unnecessary window close on quit
paaco Jan 16, 2020
88b8918
Merge pull request #1023 from paaco/firefox-parallel
ptrthomas Jan 16, 2020
dac24dc
configure header / cookies now reflect in http-request-builder #1025
ptrthomas Jan 18, 2020
17d309f
Always add 'alwaysMatch' block to capabilities
Jan 21, 2020
7bc9693
Merge pull request #1028 from paaco/develop
ptrthomas Jan 21, 2020
95dcb79
make some readme section more clear
ptrthomas Jan 24, 2020
b1c91c7
improve readme
ptrthomas Jan 25, 2020
d5e07e2
fixed bugs in ui demo scripts
ptrthomas Jan 25, 2020
736360e
cucumber tables will now appear in report json / html report #1035
ptrthomas Jan 25, 2020
03de6ce
Support acceptInsecureCerts in driver options
paaco Jan 28, 2020
1a1afa1
Updated README with acceptInsecureCerts
paaco Jan 28, 2020
513e8c2
Merge pull request #1037 from paaco/develop
ptrthomas Jan 28, 2020
db6b06b
simplify w3c webdriver capabilties #924
ptrthomas Jan 28, 2020
4fbf704
improve upon prev commit #924
ptrthomas Jan 28, 2020
4dc0dfa
improve edit upon prev commit #924
ptrthomas Jan 28, 2020
805bd4a
update w3c capabilities handling #924
ptrthomas Jan 28, 2020
088fcc9
always use w3c driver capabilities alwaysMatch #924
ptrthomas Jan 28, 2020
e999409
update ui web examples
ptrthomas Jan 29, 2020
62c064c
upgrade apache httpclient version
ptrthomas Jan 29, 2020
ea2832b
karate can now use a remote webdriver instance
ptrthomas Jan 29, 2020
ba49bcd
minor doc edits
ptrthomas Jan 29, 2020
8d8894d
confirmed to work with aws device farm and selenium grid standalone
ptrthomas Jan 30, 2020
da06b90
fixed doc typo update
ptrthomas Jan 30, 2020
de327c9
refactored webdriver implementation
ptrthomas Jan 31, 2020
43e200c
fixed gaps in winappdriver demo
ptrthomas Jan 31, 2020
46f7766
improve stabilize ui infra
ptrthomas Jan 31, 2020
055c657
ie driver wip
ptrthomas Feb 1, 2020
f4c510e
iedriver tested and working fine
ptrthomas Feb 1, 2020
45c68d7
added doc for iedriver
ptrthomas Feb 1, 2020
19a951a
more logical refactoring of ui driver packages
ptrthomas Feb 1, 2020
7bdd1a5
added simple skeleton for testing / replicating karate ui issues
ptrthomas Feb 4, 2020
18480f1
null in dynamic scenario outline cell causes npe #1045
ptrthomas Feb 9, 2020
9fc1c13
updated docs to point to external example
ptrthomas Feb 11, 2020
f2c6cb6
fix link in prev commit
ptrthomas Feb 11, 2020
bb4fa21
fix link in prev commit 2
ptrthomas Feb 11, 2020
4f60ad6
ok last try for the readme tweak
ptrthomas Feb 11, 2020
5394b4f
defensive coding for #1047
ptrthomas Feb 12, 2020
81140fb
upgrade jersey version
ptrthomas Feb 13, 2020
7b7ae8c
update docs
ptrthomas Feb 13, 2020
8c26a64
[warn] karate.log() now pretty prints
ptrthomas Feb 14, 2020
d2b430e
karate-robot ready for (experimental) release
ptrthomas Feb 15, 2020
8bb111f
prep doc for release wip
ptrthomas Feb 16, 2020
74aeb26
update doc release wip
ptrthomas Feb 16, 2020
a29c310
doc edit wip
ptrthomas Feb 16, 2020
a6ab132
prep release 0.9.5 final
ptrthomas Feb 16, 2020
6de466b
release 0.9.5
ptrthomas Feb 16, 2020
293d0b5
Bump netty.version from 4.1.37.Final to 4.1.50.Final in /karate-core
dependabot[bot] Jun 15, 2020
37722bd
Merge pull request #1176 from intuit/dependabot/maven/karate-core/net…
ptrthomas Jun 16, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
26 changes: 8 additions & 18 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
# Contribution Guidelines

First of all, thanks for thinking of contributing to this project. :smile:
First of all, thank you for your interest in contributing to this project !

- Before sending a Pull Request, please make sure that you have had a discussion with the project admins.
- If a relevant issue already exists, discuss on the issue and make sure that the admins are okay with your approach
- If no relevant issue exists, open a new issue and discuss
* Before submitting a [Pull Request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests) (PR), please make sure that you have had a discussion with the project-leads
* If a [relevant issue](https://github.com/intuit/karate/issues) already exists, have a discussion within that issue (by commenting) - and make sure that the project-leads are okay with your approach
* If no relevant issue exists, please [open a new issue](https://github.com/intuit/karate/issues) to start a discussion
* Please proceed with a PR only *after* the project admins or owners are okay with your approach. We don't want you to spend time and effort working on something - only to find out later that it was not aligned with how the project developers were thinking about it !
* You can refer to the [Developer Guide](https://github.com/intuit/karate/wiki/Developer-Guide) for information on how to build and test the project on your local / developer machine
* **IMPORTANT**: Submit your PR(s) against the [`develop`](https://github.com/intuit/karate/tree/develop) branch of this repository

Please proceed with a Pull Request only after the project admins or owners are okay with your approach. It'd be sad if your Pull Request (and your hard work) isn't accepted just because it isn't ideologically compatible.

- Install the required dependencies.
- Install Git so that you can clone and later submit a PR for this project.
- Install Java JDK (>= 1.8.0_112) installed, from [this link](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html).
- Install Eclipse from [this link](http://www.eclipse.org/downloads/).
- (optional) Install Maven from [this link](http://maven.apache.org), if you need to build the project from the command-line.

- Have some issue with setting up the project?
- [How to open the project in Eclipse as a Maven project?](https://stackoverflow.com/a/36242422/143475)
- [Maven is not able to install the dependencies behind proxy!]()
- Not listed here? Kindly search on Google / Stack Overflow. If you don't find a solution, feel free to open up a new issue in the issue tracker and maybe subsequently add it here.

- Send in your Pull Request(s) to the `develop` branch of this repository.
If you are interested in project road-map items that you can potentially contribute to, please refer to the [Project Board](https://github.com/intuit/karate/projects/3).
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### Description

Thanks for contributing this Pull Request. Make sure that you send in this Pull Request to the `develop` branch of this repository, add a brief description, and tag the relevant issue(s) and PR(s) below.
Thanks for contributing this Pull Request. Make sure that you submit this Pull Request against the `develop` branch of this repository, add a brief description, and tag the relevant issue(s) and PR(s) below.

- Relevant Issues : (compulsory)
- Relevant PRs : (optional)
Expand Down
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,22 @@ target/
.project
.settings
.classpath
.vscode
*.iml
build/
bin/
.gradle
gradle
gradlew
gradlew.*
dependency-reduced-pom.xml
examples/zip-release/*.jar
karate-demo/activemq-data/
karate-demo/*.pem
karate-demo/*.jks
karate-demo/*.der
karate-netty/*.pem
karate-netty/*.jks
karate-netty/*.der
karate-junit4/src/test/java/com/intuit/karate/junit4/dev

14 changes: 5 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
language: java
cache:
directories:
- "$HOME/.m2"
jdk:
- oraclejdk8
sudo: false
addons:
apt:
packages:
- oracle-java8-installer
install: true
script: mvn install -P pre-release -Dmaven.javadoc.skip=true -B -V

- openjdk8
script: mvn install -P pre-release -Dmaven.javadoc.skip=true -B -V -Djavacpp.platform=linux-x86_64
328 changes: 238 additions & 90 deletions README.md

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions examples/consumer-driven-contracts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.DS_Store
target/

22 changes: 22 additions & 0 deletions examples/consumer-driven-contracts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Karate Consumer Driven Contracts Demo

## References
This is a simplified version of the [example in the Karate test-doubles documentation](https://github.com/intuit/karate/tree/master/karate-netty#consumer-provider-example) - with JMS / queues removed and simplified to be a stand-alone maven project.

Also see [The World's Smallest Microservice](https://www.linkedin.com/pulse/worlds-smallest-micro-service-peter-thomas/).

## Instructions
* clone the project
* `mvn clean test`

## Main Artifacts
| File | Description | Comment |
| ---- | ----------- | ------- |
| [PaymentService.java](payment-producer/src/main/java/payment/producer/PaymentService.java) | Producer | A very simple [Spring Boot](https://spring.io/projects/spring-boot) app / REST service |
| [payment-contract.feature](payment-producer/src/test/java/payment/producer/contract/payment-contract.feature) | Contract + Functional Test | [Karate](https://github.com/intuit/karate) API test |
| [PaymentContractTest.java](payment-producer/src/test/java/payment/producer/contract/PaymentContractTest.java) | Producer Integration Test | JUnit runner for the above |
| [payment-mock.feature](payment-producer/src/test/java/payment/producer/mock/payment-mock.feature) | Mock / Stub | [Karate mock](https://github.com/intuit/karate/tree/master/karate-netty) that *perfectly* simulates the Producer ! |
| [PaymentContractAgainstMockTest.java](payment-producer/src/test/java/payment/producer/mock/PaymentContractAgainstMockTest.java) | Verify that the Mock is as per Contract | JUnit runner that points `payment-contract.feature` --> `payment-mock.feature` |
| [Consumer.java](payment-consumer/src/main/java/payment/consumer/Consumer.java) | Consumer | A simple Java app that calls the Producer to do some work |
| [ConsumerIntegrationTest.java](payment-consumer/src/test/java/payment/consumer/ConsumerIntegrationTest.java) | Consumer Integration Test | A JUnit *full* integration test, using the *real* Consumer and Producer |
| [ConsumerIntegrationAgainstMockTest.java](payment-consumer/src/test/java/payment/consumer/ConsumerIntegrationAgainstMockTest.java) | Consumer Integration Test but using the Mock | Like the above but using the mock Producer |
27 changes: 27 additions & 0 deletions examples/consumer-driven-contracts/payment-consumer/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.intuit.karate.examples</groupId>
<artifactId>examples-cdc</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>

<artifactId>examples-cdc-consumer</artifactId>
<packaging>jar</packaging>

<dependencies>
<dependency>
<groupId>com.intuit.karate.examples</groupId>
<artifactId>examples-cdc-producer</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.5</version>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package payment.consumer;

import com.intuit.karate.FileUtils;
import com.intuit.karate.JsonUtils;
import java.net.HttpURLConnection;
import java.net.URL;
import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import payment.producer.Payment;

/**
*
* @author pthomas3
*/
public class Consumer {

private static final Logger logger = LoggerFactory.getLogger(Consumer.class);

private final String paymentServiceUrl;

public Consumer(String paymentServiceUrl) {
this.paymentServiceUrl = paymentServiceUrl;
}

private HttpURLConnection getConnection(String path) throws Exception {
URL url = new URL(paymentServiceUrl + path);
return (HttpURLConnection) url.openConnection();
}

public Payment create(Payment payment) {
try {
HttpURLConnection con = getConnection("/payments");
con.setRequestMethod("POST");
con.setDoOutput(true);
con.setRequestProperty("Content-Type", "application/json");
String json = JsonUtils.toJson(payment);
IOUtils.write(json, con.getOutputStream(), "utf-8");
int status = con.getResponseCode();
if (status != 200) {
throw new RuntimeException("status code was " + status);
}
String content = FileUtils.toString(con.getInputStream());
return JsonUtils.fromJson(content, Payment.class);
} catch (Exception e) {
throw new RuntimeException(e);
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>

<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<file>target/karate.log</file>
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>

<logger name="com.intuit.karate" level="DEBUG"/>
<logger name="com.mycompany" level="DEBUG"/>
<logger name="payment" level="DEBUG"/>

<root level="warn">
<appender-ref ref="STDOUT" />
<appender-ref ref="FILE" />
</root>

</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package payment.consumer;

import com.intuit.karate.netty.FeatureServer;
import java.io.File;
import org.junit.AfterClass;
import org.junit.Test;
import static org.junit.Assert.*;
import org.junit.BeforeClass;
import payment.producer.Payment;

/**
*
* @author pthomas3
*/
public class ConsumerIntegrationAgainstMockTest {

private static FeatureServer server;
private static Consumer consumer;

@BeforeClass
public static void beforeClass() {
File file = new File("../payment-producer/src/test/java/payment/producer/mock/payment-mock.feature");
server = FeatureServer.start(file, 0, false, null);
String paymentServiceUrl = "http://localhost:" + server.getPort();
consumer = new Consumer(paymentServiceUrl);
}

@Test
public void testPaymentCreate() throws Exception {
Payment payment = new Payment();
payment.setAmount(5.67);
payment.setDescription("test one");
payment = consumer.create(payment);
assertTrue(payment.getId() > 0);
assertEquals(payment.getAmount(), 5.67, 0);
assertEquals(payment.getDescription(), "test one");
}

@AfterClass
public static void afterClass() {
server.stop();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package payment.consumer;

import org.junit.AfterClass;
import org.junit.Test;
import static org.junit.Assert.*;
import org.junit.BeforeClass;
import org.springframework.context.ConfigurableApplicationContext;
import payment.producer.Payment;
import payment.producer.PaymentService;

/**
*
* @author pthomas3
*/
public class ConsumerIntegrationTest {

private static ConfigurableApplicationContext context;
private static Consumer consumer;

@BeforeClass
public static void beforeClass() {
context = PaymentService.start();
String paymentServiceUrl = "http://localhost:" + PaymentService.getPort(context);
consumer = new Consumer(paymentServiceUrl);
}

@Test
public void testPaymentCreate() throws Exception {
Payment payment = new Payment();
payment.setAmount(5.67);
payment.setDescription("test one");
payment = consumer.create(payment);
assertTrue(payment.getId() > 0);
assertEquals(payment.getAmount(), 5.67, 0);
assertEquals(payment.getDescription(), "test one");
}

@AfterClass
public static void afterClass() {
PaymentService.stop(context);
}

}
29 changes: 29 additions & 0 deletions examples/consumer-driven-contracts/payment-producer/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.intuit.karate.examples</groupId>
<artifactId>examples-cdc</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>

<artifactId>examples-cdc-producer</artifactId>
<packaging>jar</packaging>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring.boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>${spring.boot.version}</version>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package payment.producer;

/**
*
* @author pthomas3
*/
public class Payment {

private int id;
private double amount;
private String description;

public int getId() {
return id;
}

public void setId(int id) {
this.id = id;
}

public double getAmount() {
return amount;
}

public void setAmount(double amount) {
this.amount = amount;
}

public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}

}
Loading