I have this mock module:
exports.httpBackendMock = function() {
angular.module('httpBackendMock', ['mainApp', 'ngMockE2E'])
.run(function($httpBackend) {
console.log('Test platform bootstrapping');
$httpBackend.whenGET('https://alphashare.tracemytrack.com/lts/retrieval/generateQRcode').respond([{
buildTimestamp: "2019-07-04 08:51",
detail: "success",
qrUUID: "d30ad6386bbd05cb016bc10550299972",
serverVersion: "Version 0.1",
stage: "hostnet",
status: "success",
statusDescription: "Success"
}
]);
console.log('Test platform bootstrapping ... done');
});
}
and in scenario test script I have this:
var mockModule = require('./mocked-backend');
and in beforeEach loop :
browser.addMockModule('httpBackendMock', mockModule.httpBackendMock);
in this test, I need to set qrUUID value in the value from the response from mock Module, but when the request is happening the response in not mocked and all is happening normally, in the same mode when I don't try to mock the result. What am I doing wrong in this test? And what I can do to make the mock works?