mdasberg / ng-apimock

Node plugin that provides the ability to use scenario based api mocking: for local development for protractor testing
MIT License
99 stars 26 forks source link

ng-apimock using default mock on app launch #71

Open rfodge opened 5 years ago

rfodge commented 5 years ago

When using ng-apimock to mock scenarios for an angular application, it keeps returning the default scenario on app launch when I set the scenario then launch the app:

loginPage.selectScenario('terms-and-conditions-get-request', 'terms-and-conditions-not-accepted');
loginPage.navigateToBaseUrl();
loginPage.loginButton().click();

The following gives me the expected results:

loginPage.navigateToBaseUrl();
loginPage.selectScenario('terms-and-conditions-get-request','terms-and-conditions-not-accepted');
loginPage.navigateToBaseUrl();
loginPage.loginButton().click();

If I set the default to false for both possible scenarios, then it works without needing to navigate to the URL first. Is there a way to tell it to not use the default without needing to relaunch the app before setting the scenario and then again after?