lundi 25 juillet 2016

Protractor E2E could not find angular exceeded

I know there is a lot of this error here, in the stackoverflow, but the other solution didn't work to me so i'm asking:

I'm trying to do a simple login test and protractor is giving me this error:

Error: Angular could not be found on the page http://localhost:5555/# : retries looking for angular exceeded my configuration file is:

const config = {
  baseUrl: 'http://localhost:5555/',
  specs: [
  //'./testes/teste3.js'
  './testes/cadastroNorma.js'
  //'./testes/cadastroCargo.js'
  ],
  //Identificando o framework escolhido para escrita de testes.
  framework: 'jasmine',
  jasmineNodeOpts: {

    showColors: true,
    isVerbose: false,
    includeStackTrace: false,

  },
  directConnect: true,
  capabilities: {
    browserName: 'chrome'
  },


      //Função que será executado antes dos inicios de testes. Fazendo o Login no sistema.
  onPrepare: function() {
    browser.get('#');

    // needed for custom class decorators
    require("reflect-metadata");
    require("http://ift.tt/2asjGLq");
    const SpecReporter = require('jasmine-spec-reporter');
    // add jasmine spec reporter
    jasmine.getEnv().addReporter(new SpecReporter({ displayStacktrace: true }));

    //var btn = element(By.buttonText('Conectar-se'));  
    //btn.click();  
    //necessário esperar redirecionamento;
    //browser.driver.sleep(2000);
    //A pagina de login não é feita em angular, então é necessário para a sicronização para o protracotr não ficar procurando as tags do Angular
    browser.ignoreSynchronization = true; 
    var login = browser.driver.findElement(by.id('Username'));
    var senha = browser.driver.findElement(by.id('Password'));
    var btnEntrar = element(by.buttonText('ENTRAR'));
    login.sendKeys('123');
    senha.sendKeys('123');
    btnEntrar.click();
  //Para esperar o redirecionamento do sistema
  browser.driver.sleep(8000);
},  
  //Para o protractor indentifcar os comandos do Angular 2
  useAllAngular2AppRoots: true
};
if (process.env.TRAVIS) {
  config.capabilities = {
    browserName: 'firefox'
  };
}
exports.config = config;

It was working perfectly but I don't know why its stopped

Aucun commentaire:

Enregistrer un commentaire