Comments (5)
Hi @Hiral-Dadhaniya thanks for using oatts and opening an issue.
oatts uses a rest testing framework called chakram to execute requests and assert on responses. If you take a look at your generated code, you'll notice a return chakram.wait()
inside the callback for every it
clause. As described here, this is returning a promise for mocha to wait for.
In this scenario it looks like the test timeout used is 2000ms (the default), and the test is being preempted. A couple of possible scenarios might be that the request is taking longer than the allotted timeout to complete, somehow the server is not reachable but the client's timeout for this is longer than the test's timeout, or there could even be an issue with how mocha is attempting to resolve the promise (i believe this would be out of the scope of this code base and we'd need to dig deeper to prove it).
I'd ask you to please raise the timeout by running the tests with a --timeout
flag, and to ensure that the server you are targeting in the tests is reachable from the machine you are running the tests on (server is available on the host/port, firewalls aren't blocking, etc.)
Thank you!
from oatts.
Hi @noahdietz thank you for quick response.
Yeh, looks like timeout issue. It works with --timeout flag. I was under impression oatts may use own rules to validate json/yaml files, but I think as you mentioned it's the chakram for executing requests and doing assert. So, is it possible to have own rules to validate json/yaml or .js(As it creates the JS files).
from oatts.
OK glad the timeout flag helped.
If I understand the question, you want to know how oatts
validates the JS files it creates? Or the spec that it consumes? Or are you asking about the assertions done on the response as part of the tests that are run? Not sure I am following the question can you please explain in more detail? Thanks.
from oatts.
Yes, Sure.
Basically i am interested in how Oatts validates spec that it consumes. But as it creates JS out of it and validates using chakram, am not sure specific validations of spec file for edit/update supported. (For example: json structure, schema(These two i think chakram itself does?), specific rules like 'parameter objects should have a description' or 'no comma in description' etc. ) Correct me if i am wrong
from oatts.
oatts
uses a module called sway to consume & traverse the given specification. sway also validates the schema of the given OAS document, ensuring it conforms. However this is not the goal of oatts
. oatts
is meant to generate a test suite (of JS files) that would test the contract validity between the OAS document and the server that implements the API. It does not validate the schema of the specification specifically as a test.
I am going to close this issue as we have resolved the issue. Thanks!
from oatts.
Related Issues (17)
- Dynamically populate path parameters from example property HOT 8
- Optional parameters are always included HOT 1
- Nullable values are required to not be null HOT 1
- Using uuid format in parametesr HOT 3
- Values in header will not be overwritten when specified in custom values file HOT 1
- spoofed request parameters aren't URL safe HOT 1
- Body is not generated automatically HOT 6
- Nested definitions are not well recognized
- Generate tests for specific set of operations for a particular path HOT 1
- Keep package up-to-date in npm HOT 2
- Json body in request when testing POST HOT 3
- Expose handlebars object to add custom helpers
- Empty request body for openapi 3.0 specs HOT 2
- OAS v3.x.x Support HOT 1
- support for multiple status code entries in custom values generating multiple tests
- replace query string with entire object from custom values HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oatts.