ng-apimock icon indicating copy to clipboard operation
ng-apimock copied to clipboard

ng-apimock using default mock on app launch

Open rfodge opened this issue 5 years ago • 0 comments

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?

rfodge avatar Apr 17 '19 20:04 rfodge