angular / protractor

E2E test framework for Angular apps
http://www.protractortest.org
MIT License
8.75k stars 2.31k forks source link

Angular testapp on protractortest.org is broken #4222

Open ghost opened 7 years ago

ghost commented 7 years ago

Bug report

const { SpecReporter } = require('jasmine-spec-reporter');

exports.config = { allScriptsTimeout: 11000, specs: [ './e2e/*/.e2e-spec.ts' ], capabilities: { 'browserName': 'chrome' }, directConnect: true, baseUrl: 'http://localhost:4200/', framework: 'jasmine', jasmineNodeOpts: { showColors: true, defaultTimeoutInterval: 30000, print: function() {} }, beforeLaunch: function() { require('ts-node').register({ project: 'e2e/tsconfig.e2e.json' }); }, onPrepare() { jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); } };

- A relevant example test:
I tested with my own application as wel as with the demo application:

/**

describe('Protractor Demo App', () => { beforeEach(() => { browser.get('http://www.protractortest.org/testapp/ng2/'); });

it('should have a title', () => {
    expect(browser.getTitle()).toEqual('Test App');
});

});

// protractor imports import{browser, element, by } from 'protractor'

// imports from Page Object import{ HomePage } from './homepage.po'

describe('HomePage tests', () => { /**

So for now, my problem is partially solved by turning off the synchronization. But this can't be the way to continue.

heathkit commented 7 years ago

I think the problem is http://www.protractortest.org/testapp/ng2/ is broken (missing System.js?). We should fix that, but in the meantime you can use https://angularjs.org/ to try an AngularJS app. I'm not aware of a good reference app out there for Angular, but you could run the QuickStart seed.

Leaving this issue open to track the problem with http://www.protractortest.org/testapp/ng2/

ghost commented 7 years ago

When trying with an AngularJS app like https://juliemr.github.io/protractor-demo/ Protractor does it's work. I'll test later today with a fresh Angular project.

ghost commented 7 years ago

I tried again with a fresh Angular project and everything seems to be working fine. I've ported my app in this fresh project and the whole thing breaks again.

I think it has something to do with my application not bootstrapping properly, which would explain why Protractor keeps on waiting for it's bootstrap. But I'm struggling to find a way to see where it is stuck, are there ways to debug this? @heathkit

ghost commented 7 years ago

Okay, following a suggestion, I've added ng-app to the body-tag, which seems to have resolved the issue. I don't think this is the way to go, because it seems quite a hacky way.