Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

scenario runner should allow future value as argument #429

vojtajina opened this Issue Jun 23, 2011 · 4 comments


None yet
5 participants

vojtajina commented Jun 23, 2011

it('async expectation', function() {

  var countBefore = element('ul#test li').count();

  // here is code which adds a node

  // this does not work - the future has no value yet
  expect(element('ul#suck li').count()).toEqual(count.value + 1);

This this topic for more info: https://groups.google.com/forum/#!topic/angular/FszMlvnrQfY


juliemr commented Aug 2, 2012

Ping! This would be awesome.

co-dh commented Jan 10, 2013

My personal feeling about the scenario is that it's a bad abstraction.
It's a surprise that .count() is not return a number,
and worse, you cannot do expect(1).toEqual(1).
I think the DSL is intended to hide asyn call, but the code still looks like imperative, and very count intuitive.

Overall, Angular.js is awesome!

Elexy commented May 14, 2013

I now use this in my scenario:

function appWindow() {
    return document.getElementsByTagName('iframe')[0].contentWindow;
function appAngular() {
    return appWindow().angular;
it('should create a tab', function () {
    var pageCount = appAngular().element('.page_navigation li').length;
    console.log(repeater('.page_navigation li').count().exec)
    expect(repeater('.page_navigation li').count()).toBe(pageCount+1);

Is that the right way until this is implemented?

@btford btford closed this Aug 24, 2013


btford commented Aug 24, 2013

As part of our effort to clean out old issues, this issue is being automatically closed since it has been inactivite for over two months.

Please try the newest versions of Angular (1.0.8 and 1.2.0-rc.1), and if the issue persists, comment below so we can discuss it.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment