Comments (15)
What is your problem?
from abao.
@cybertk
In my hook file, I have provided two different cases for resource 'GET /org/15602/activity/{activityid} -> 200'
Both the cases have incorrect activityid, so I am expecting these test cases should be fail.
But when I am running the following command all the test passed.
$ abao origin_new.raml https://test.com/ssvui --hookfiles=hook.coffee
So to debug this I just ran the raml file without hook file:
$ abao origin_new.raml https://test.com/ssvui
Result of the above command is also same as the first command, so its look like abao is not reading hook file. Though it says: Found Hookfiles: hook.coffee
Please let me know if you need more information.
from abao.
You can define only one test for each case(response code) in Abao. So for your case, you defined two tests/hooks for GET /org/15602/activity/{activityid} -> 200
, only one is used and the other one is ignored.
If you want test the error case of your API, you should define it in your RAML. e.g. Your API will response 400 if activityid
is not a number with
responses:
200:
...
400:
...
I think Abao should print a warning message for your case, what's your advice?
from abao.
- If that is the case then why the first case 'GET /j_spring_security_check -> 302', (test, done) -> is getting pass where in Hook file I have entered incorrect login and RAML has correct login.
- How can i test multiple test cases for one case?
For example,
I have one resource GET /org/15602/activity/{activityid} -> 200, and I want to test this resource with 3 different activityid where the response code for all 3 cases is 200.
from abao.
- Each test case is identified by Test Name, such as
GET /j_spring_security_check -> 302
. - Abao does not support this feature now.
from abao.
@cybertk
If we can define only one test for each case(response code) in Abao. So the test mentioned in the Hook file run for that particular resuource, right?
Example:
RAML file has activityid 12345*** for GET /org/15602/activity/{activityid} -> 200
and
Hook file has activityid 567*** for GET /org/15602/activity/{activityid} -> 200
Abao test will run with activityid 567*** (Hook file), is that correct?
from abao.
Correct.
from abao.
@agrover8 I have an idea for your condition, test multiple test cases for one case. You can write multiple hooks, then run Abao multiple times with different hook.
Such as,
$ abao origin_new.raml https://test.com/ssvui --hookfiles=hook1.coffee
$ abao origin_new.raml https://test.com/ssvui --hookfiles=hook2.coffee
$ abao origin_new.raml https://test.com/ssvui --hookfiles=hook3.coffee
from abao.
You can open a feature request either, we will implement it in future.
from abao.
@cybertk
Can we pass request data from external file to hook file, like in RAML we can !include example.sample?
Instead of passing request data in hook file I want to pass reference of the external file.
from abao.
Yes, you can. Hook file is just a normal javascript/coffeescript source file, you can do whatever you want.
from abao.
@cybertk
There are some instances where we need to pass the response data from one resource to request data, query parameters, uriParameters to other resource, is that possible in ABAO?
from abao.
Yes. Do whatever javascript can do
from abao.
Filed #35 for multi test case.
I had some working example going of parameter passing using some global context variable to define things.
Something roughly like...
context = {}
after < test 1 > ...
context.example.id = test.response.body.example.id
before < test 2 > ...
test.request.query.id = context.example.id
@agrover8 is your hook file working now?
from abao.
@cybertk @jekhardt Yes, hook file is working now. I am closing this issue.
from abao.
Related Issues (20)
- Make wrapper level for raml-parser
- Add RAML hook to skip tests HOT 4
- Make log-statements in hookfiles output reporter-specific content HOT 2
- Support For OpenAPI / swagger HOT 4
- First test case response time included beforeAll execute time HOT 1
- Rewrite in ES7 HOT 12
- Does not support resourceTypes
- ES7 Migration - Linting HOT 1
- ES7 Migration - CHANGELOG HOT 3
- ES7 Migration - CONTRIBUTING HOT 5
- ES7 Migration - Fixing package versions HOT 1
- Fails silently on valid RAML, even with names option HOT 10
- body disappears when header is added HOT 2
- Replace `tv4` JSON Schema validator
- Remove 'banUnknown' JSON Schema option
- Add error handling to request invocation
- Remove asserts from library source HOT 1
- Add standard User-Agent header
- Abao Tests Not Running HOT 28
- "before all" hook: TypeError: callback is not a function
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 abao.