jeudi 28 juillet 2016

Change value modulo.valor () on the Protractor

I have a system using AngularJS and I'm using Protractor to test, however, would like to change a value set in module.value().

The module is thus:

'use strict';

var app = angular.module('myModule');

app.value('config',{
logo: 'images/logo.png',
apiUrl: 'http://localhost:8080/v1/', ...

In tests I tried it (not this going right):

beforeEach(function() {

    var mockedModule=function(){
        var module = angular.module('myModule').value('config',{
                apiUrl: 'http://localhost:8080/v1/'
        });
    };

    browser.addMockModule('myModule',mockedModule); 

});

I want to know how can I change the value in "apiUrl" in the tests?

Aucun commentaire:

Enregistrer un commentaire