0

The ui-view elements are not appear when I use as below:

casper.start('https://carepilot-web-staging.herokuapp.com/login');
casper.then( function () {
            require('utils').dump(this.getElementInfo('.main-page'));
            phantomcss.screenshot( '.loginWrapper', 'Get login page' );
            this.echo('get login page...');
        } );

the require print out the div null

<div ui-view=\"\" class=\"main-page ng-scope\"></div>

it should be:

<div ui-view="" class="main-page ng-scope" style="">
<div class="loginWrapper ng-scope" ng-controller="loginController as vm">
    <div class="login-panel">
        <div login-form="" ng-hide="vm.showForgotPassword || vm.showTOU"><form name="vm.loginForm" ng-submit="vm.login()" class="ng-pristine ng-valid-email ng-invalid ng-invalid-required" style="">
    <div class="panel-fields">
        <div class="logo icon-logo"></div>
        <div>
            <input type="email" name="username" id="username" class="form-control ng-pristine ng-untouched ng-empty ng-valid-email ng-invalid ng-invalid-required" ng-model="vm.username" placeholder="Email" required="" ng-class="{'error': vm.loginError &amp;&amp; username.$pristine}" style="">
            <!-- ngIf: vm.loginError -->
        </div>
        <div>
            <input type="password" name="password" id="password" class="form-control ng-pristine ng-untouched ng-empty ng-invalid ng-invalid-required" ng-model="vm.password" placeholder="Password" required="" ng-class="{'error': vm.loginError &amp;&amp; password.$pristine}" style="">
            <!-- ngIf: vm.loginError -->
        </div>
        <div ng-show="vm.resetEmail" class="ng-binding ng-hide" style="">Reset Password email has been sent to </div>
    </div>

    <div class="panel-buttons">

        <button id="loginButton" type="submit" class="btn-login ng-binding ng-hide-remove" ng-show="!vm.loginError || vm.loginForm.$dirty" ng-class="{ 'btn-login-green' : vm.loginForm.$valid }">Login</button>
        <button id="errorButton" class="btn-login btn-login-red ng-hide" ng-show="vm.loginError &amp;&amp; !vm.loginForm.$dirty" disabled="disabled" style="">
            <div class="ng-binding">SORRY</div>
            <div class="ng-binding">We didn't recognize that email and password</div>
        </button>
        <button id="forgotPwdButton" type="button" class="btn-login btn-clear ng-binding" ng-click="vm.showForgotPassword=true">I forgot my password</button>
    </div>
</form>
</div>
</div>
</div>

I tried a hole day with no success, can anyone give me some suggestion? Thanks!

Edit:

the detail is that: **Error: undefined is not a constructor (evaluating 'config.url.startsWith('api/CarePilot/')') request@https://carepilot-web-staging.herokuapp.com/config.js:71:42 More info: [ { "file": "https://carepilot-web-staging.herokuapp.com/bower_components/angular.js", "line": 14199, "function": "" } ] Broken interceptor detected: Config object not supplied in rejection: https://github.com/chieffancypants/angular-loading-bar/pull/50 the config line 71 is if (config.url.startsWith('api/CarePilot/')) {

I change it to if (_.startsWith(config.url,'api/CarePilot/')) {, it is ok.

jackchen
  • 71
  • 8
  • Refering to https://github.com/Huddle/PhantomCSS/issues/191 – jackchen Sep 04 '17 at 06:50
  • casper.start('https://carepilot-web-staging.herokuapp.com/login'); casper.then(() => { require('utils').dump(this.getElementInfo('.main-page')); phantomcss.screenshot( '.loginWrapper', 'Get login page' ); this.echo('get login page...'); } ); – Raja Mohamed Sep 04 '17 at 06:54
  • add arrow function instead of javascript function callback, In Most of the cases Javascript function call back will not work. – Raja Mohamed Sep 04 '17 at 06:54
  • @Raja Mohamed Thanks for you remind, but it is not work, I change it to `casper.then( () => {`, throw the error `SyntaxError: Unexpected token ')' `, so maybe we need not to change it.Thanks. – jackchen Sep 04 '17 at 07:08
  • surround the constructor code with try catch and print the catch error in console. So we can make sure that we are in right track or not. – Raja Mohamed Sep 04 '17 at 07:12

0 Answers0