Skip to content
This repository has been archived by the owner on Dec 16, 2023. It is now read-only.

assert.url silently dies... #936

Open
pronebird opened this issue Aug 17, 2015 · 1 comment
Open

assert.url silently dies... #936

pronebird opened this issue Aug 17, 2015 · 1 comment

Comments

@pronebird
Copy link

This is my lovely Facebook log-in test which never make it to Done() because everything dies at walker.assert.url(returnTo), for no reason. Based on logs, everything else worked out as expected... Any clues what's going on?

  test('GET  /v1/auth/facebook', function(done) {
    var loginUrl, returnTo, walker;
    this.timeout(60000);
    walker = new Zombie;
    returnTo = url('success.html');
    loginUrl = url("/v1/auth/facebook?returnTo=" + (encodeURIComponent(returnTo)));
    console.log("Log into " + loginUrl);
    walker.visit(loginUrl, function() {
      walker.assert.success();
      walker.assert.element('#email');
      walker.assert.element('#pass');
      walker.assert.element('#loginbutton input');
      console.log('Loaded.');
      walker.fill('#email', '[email protected]')
        .fill('#pass', 'password')
        .pressButton('#loginbutton input', function() {
          console.log('Pressed button.');
          walker.assert.url(returnTo);
          console.log('Done');
          return done();
      });
      return;
    });
  });

The page browser gets redirected to returns 404 if that makes any difference...

try + catch around that assert revealed that the target URL has hash in its URL. I wonder if I can handle that nicely with Zombie. Basically any assert simply kills the flow and mocha hangs until timeout.

Playing a bit around, still can't figure out what's going on, script just halts at random point, but somehow related to use of Zombie.

@bf
Copy link

bf commented Sep 15, 2015

I experience the same issue with using browser.assert.url({ pathname: 'foo' }). Script just hangs until timeout, if I remove this very line everything works.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants