Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Timeout issue with Angular-UI carousel #589

Closed
@simonykq

Description

@simonykq

Hi, Why is my protractor testing always timeout ? I am pretty sure I did not use $timeout in my application code and my API has been correctly connected with my front-end code. Following is my testing code

var util = require('util')

var HomePage = function(){

    this.get = function(){
        browser.get('/')
    }

    this.latest_news = element.all(by.repeater('l_n in latest_news'));
    this.events      = element.all(by.repeater('event in events'));
    this.slides      = element.all(by.repeater('slide in slides'));
    this.states      = element.all(by.repeater('state in states'));
    this.currentYear = element(by.binding('currentYear'));
}


describe('fobh homepage', function() {

    var ptor     = protractor.getInstance(),
        homepage = new HomePage();

    beforeEach(function(){
        homepage.get();
        ptor.waitForAngular();
    });

    it('should get to the root url', function() {
        expect(ptor.getCurrentUrl()).toEqual('http://localhost:9000/#/');
    });

    it('should have one latest news', function() {
        var news = homepage.latest_news;
        expect(news.count()).toEqual(1);
    })

    it('should have at least one event', function(){
        var events = homepage.events;
        expect(events.count()).toBeGreaterThan(1);
    })

    it('should have 5 states', function(){
        var states = homepage.states;
        expect(states.count()).toEqual(5);
    })

    it('should have five slides', function(){
        var slides = homepage.slides;
        expect(slides.count()).toEqual(5);
    })

    it('should render current year', function(){
        var year = homepage.currentYear;
        expect(year.getText()).toEqual('2014');
    })


});

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions