-
Notifications
You must be signed in to change notification settings - Fork 15
Updating read me to point to the new location of samples #6
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
Open
prakashmrec
wants to merge
1
commit into
master
Choose a base branch
from
updating-read-me
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,91 +1 @@ | ||
| ## Samples for Ready! API TestServer usage | ||
|
|
||
| This project currently contains simple projects showing how to run API tests with | ||
| Ready! API TestServer. | ||
|
|
||
| Clone this project and run 'mvn test' in the root folder; this will run each of the included modules; | ||
| - The JUnit sample runs API tests using the java client library for TestServer | ||
| - The Maven plugin runs API test recipes and projects provided as resources | ||
| - The Cucumber sample "executes" a feature file via the java client for the TestServer | ||
|
|
||
| ### JUnit Sample | ||
|
|
||
| In the java/junit-client-sample folder/module; this contains a single unit test that uses the | ||
| [TestServer Java Client](https://github.com/SmartBear/ready-api-testserver-client) to run a single request | ||
| against the SwaggerHub API and assert the response. You can run this either from within your | ||
| IDE or with maven: | ||
|
|
||
| ``` | ||
| mvn surefire:test -Dtestserver.host=... -Dtestserver.user=... -Dtestserver.password=... | ||
| ``` | ||
|
|
||
| ### Maven Plugin Sample | ||
|
|
||
| In the java/maven-plugin-sample folder/module; this contains a single recipe that tests the SwaggerHub API | ||
| and asserts the response. The [testserver-maven-plugin](https://github.com/olensmar/readyapi-testserver-maven-plugin) | ||
| is configured to run as part of your integration tests when performing a mvn:install build - but you can also | ||
| trigger them directly with | ||
|
|
||
| ``` | ||
| mvn testserver:run -Dtestserver.host=... -Dtestserver.user=... -Dtestserver.password=... | ||
| ``` | ||
|
|
||
| ### Cucumber Sample | ||
|
|
||
| The Declarative cucumber sample contains a simple [feature file](https://github.com/SmartBear/ready-api-testserver-samples/blob/master/java/cucumber-sample/src/test/resources/cucumber/swaggerhub.feature) for testing the SwaggerHub API | ||
| and corresponding [step definitions](https://github.com/SmartBear/ready-api-testserver-samples/blob/master/java/cucumber-sample/src/test/java/com/smartbear/readyapi/testserver/SwaggerHubStepDefs.java) to build and execute the required recipe. | ||
|
|
||
| For a generic imperative approach to API Testing with Cucumber and TestServer please have a look at | ||
| the [testserver-cucumber](https://github.com/olensmar/testserver-cucumber) project. | ||
|
|
||
| Running them from the command-line with "mvn test" will result in the following: | ||
|
|
||
| ``` | ||
| ... | ||
| ------------------------------------------------------- | ||
| T E S T S | ||
| ------------------------------------------------------- | ||
| Running com.smartbear.readyapi.testserver.RunCucumberTest | ||
| Feature: SwaggerHub REST API | ||
|
|
||
| Scenario: Default API Listing # swaggerhub.feature:2 | ||
| When a request to the API listing is made # SwaggerHubStepDefs.aRequestToTheAPIListing() | ||
| Then a list of APIs should be returned within 500ms # SwaggerHubStepDefs.aListOfAPIsShouldBeReturned(int) | ||
|
|
||
| Scenario: Owner API Listing # swaggerhub.feature:6 | ||
| Given an owner named swagger-hub # SwaggerHubStepDefs.anOwnerNamed(String) | ||
| When a request to the API listing is made # SwaggerHubStepDefs.aRequestToTheAPIListing() | ||
| Then a list of APIs should be returned within 500ms # SwaggerHubStepDefs.aListOfAPIsShouldBeReturned(int) | ||
|
|
||
| Scenario: API Version Listing # swaggerhub.feature:11 | ||
| Given an owner named swagger-hub # SwaggerHubStepDefs.anOwnerNamed(String) | ||
| And an api named registry-api # SwaggerHubStepDefs.anApiNamed(String) | ||
| When a request to the API listing is made # SwaggerHubStepDefs.aRequestToTheAPIListing() | ||
| Then a list of APIs should be returned within 500ms # SwaggerHubStepDefs.aListOfAPIsShouldBeReturned(int) | ||
|
|
||
| Scenario: API Retrieval # swaggerhub.feature:17 | ||
| Given an owner named swagger-hub # SwaggerHubStepDefs.anOwnerNamed(String) | ||
| And an api named registry-api # SwaggerHubStepDefs.anApiNamed(String) | ||
| And a version named 1.0.0 # SwaggerHubStepDefs.aVersionNamed(String) | ||
| When a request to the API listing is made # SwaggerHubStepDefs.aRequestToTheAPIListing() | ||
| Then an API definition should be returned within 500ms # SwaggerHubStepDefs.anApiDefinitionShouldBeReturned(int) | ||
|
|
||
| 4 Scenarios (4 passed) | ||
| 14 Steps (14 passed) | ||
| 0m2.136s | ||
|
|
||
| Tests run: 18, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.617 sec | ||
| ... | ||
| ``` | ||
|
|
||
| ## Configuration | ||
|
|
||
| All the samples in this project run against the public TestServer instance available at | ||
| http://testserver.readyapi.io:8080, if you want to run against your own installation you | ||
| can provide system properties for testserver.host, testserver.user and testserver.password | ||
| containing the hostname, user and password of your TestServer installation. | ||
|
|
||
|
|
||
| ### Looking for more samples? | ||
|
|
||
| Please don't hesitate to raise issues in this repo to ask for more! | ||
| All the samples from here have been moved to https://github.com/SmartBear/readyapi4j/tree/master/modules/samples | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has the removed content been addd to the new location somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we haven't added any ReadMe for the samples yet.