2017-07-17 16 views
0

circleCiで分度器を使用する方法については少し質問があります。このコードは、私のlocalhostでうまく動作し、もしfirefoxで実行しても動作します。小さな推測(100%ではない)もありますが、たとえばgetCurrentUrlのような約束を返すメソッドを使用すると、circleCiのchromeも失敗します。これは、私はエラーが表示されます。分度器はlocalhostで動作しますがCircleCiでは失敗します

circleCi error message

私の設定は次のとおりです。

  • ノードのバージョン:6.9.1
  • 分度器バージョン:5.1
  • 角度のバージョン:4
  • ブラウザ:chrome
  • Operating Syste m、およびバージョンのUbuntu 16.4

**私のテストsamble **

import { browser, Config, element, by } from 'protractor'; 
import { assert } from 'chai'; 
describe('simple test', function() { 

    beforeEach(function() { 
     browser.ignoreSynchronization = true; 
    }); 

    it('should login', function() { 
     browser.get('http://localhost:8080/#/signin'); 
     const email = element(by.name('email')); 
     const password = element(by.name('password')); 
     const button = element(by.css('[type="submit"]')); 
     email.sendKeys('[email protected]'); 
     password.sendKeys('12345678'); 
     button.click(); 
     browser.sleep(1500); 
     const logout = element(by.className('ll-navbar-icon fa fa-power-off')); 
     expect(browser.getCurrentUrl()).toMatch('/dashboard'); 
     browser.isElementPresent(logout); 
    }); 
}); 

私の分度器の設定ファイル:

import { environment } from './environment'; 
import { browser, Config } from 'protractor'; 
import { SpecReporter } from 'jasmine-spec-reporter'; 

export let config: Config = { 
    directConnect: true, 
    allScriptsTimeout: 11000, 
    seleniumAddress: 'http://localhost:4444/wd/hub', 
    baseUrl: environment.baseUrl, 
    capabilities: environment.capabilities, 
    framework: environment.framework, 
    jasmineNodeOpts: { 
    showColors: true, 
    defaultTimeoutInterval: 30000, 
    print: function() {} 
    }, 

    specs: [ 
    '../../build/app.spec.js' 
    ], 
    // This utility function helps prepare our scripts with required actions like browser maximize 
    onPrepare:() => { 
    jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 
    browser.driver.manage().window().maximize(); 
    } 
}; 

答えて

0

私は同様の問題を抱えていた、テストなしで走りました問題をローカルではなく、circleciで実行すると失敗しました。

私は私のテストでジャスミンDEFAULT_TIMEOUT_INTERVALを増やすことで、それを修正することができました:

beforeEach(function() { jasmine.DEFAULT_TIMEOUT_INTERVAL = 999999; });

も提供circleci「デバッグSSH経由」機能を使用してください。セットアップをデバッグするのは非常に便利です。

関連する問題