ng-apimock | Node plugin that provides the ability to use scenario | Mock library
kandi X-RAY | ng-apimock Summary
kandi X-RAY | ng-apimock Summary
Node plugin that provides the ability to use scenario based api mocking:.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of ng-apimock
ng-apimock Key Features
ng-apimock Examples and Code Snippets
Community Discussions
Trending Discussions on ng-apimock
QUESTION
We're using ng-apimock
to test our angular application. For returning specific data sets in certain tests, we use ngApiMock.selectScenario
When i look at the http request of the selectScenario (in a tcp monitor) i see a header is added with key ngapimockid
(and a generated value).
However when executing the test, I noticed that the ngapimockid
was often not specified in the header (or as cookie), resulting in receiving other data than setup in the ngApiMock.selectScenario
.
For example an http request during execution of test (with the ngapimockid):
...ANSWER
Answered 2018-Jan-22 at 08:25Looking again at the tcpmonitor i noticed the requests that have no ngapimockid
were the first http requests after selecting the scenario (in the Background
of the feature
file) and before the first step in my test (Scenario outline
).
So i suspected the opening of the page happens outside protractor's domain. (Even though i see it happen in the tcpmonitor after the scenario selection.)
I added a step in the Background
where the page is refreshed and in that http call i do see the ngapimockid
in the headers of the request. So for now i fixed it by adding a step And I have opened the page
after the scenario selection that refreshes the page.
Part of the resulting feature file:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ng-apimock
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page