2016-10-20 15 views
1

私は分度器で新しいテストをしていますが、私はテストを実行できません。 マイprotractor.config.js:ジャスミン分度器を使ったe2e testin "仕様が見つかりません"

exports.config = { 

    allScriptsTimeout: 99999, 

    // The address of a running selenium server. 
    seleniumAddress: 'http://localhost:4444/wd/hub', 

    // Capabilities to be passed to the webdriver instance. 
    capabilities: { 
    browserName: 'chrome' 
    }, 

    baseUrl: 'http://localhost:8080/', 

    framework: 'jasmine', 

    // Spec patterns are relative to the current working directly when 
    // protractor is called. 
    specs: ['.src/test/e2e/login.e2e.spec.js'], 

    // Options to be passed to Jasmine-node. 
    jasmineNodeOpts: { 
    showColors: true, 
    defaultTimeoutInterval: 30000, 
    isVerbose: true, 
    includeStackTrace: true 
    } 
}; 

、これは私が実行しようとしているテストです:

'use strict'; 

    describe('my app', function() { 

     beforeEach(function() { 
     browser.get('index.html'); 
     }); 

     it('should automatically redirect to/when location hash is empty', function() { 
     expect(browser.getLocationAbsUrl()).toMatch("/"); 
     }); 
    }); 

そして、これは私が取得エラーです:

I/hosted - Using the selenium server at http://localhost:4444/wd/hub 
[13:20:49] I/launcher - Running 1 instances of WebDriver 
Started 


No specs found 
Finished in 0.001 seconds 

[13:20:50] I/launcher - 0 instance(s) of WebDriver still running 
[13:20:50] I/launcher - chrome #01 passed 
[13:20:50] The following tasks did not complete: e2e 
[13:20:50] Did you forget to signal async completion? 

私はwebdriver-managerと私のアプリケーションサーバーを実行しています。私のジャスミンのバージョンは:2.5.2 と私の分度器のバージョンは: 4.0.9

私は間違って何をしているのアイデア?

ありがとうございました!

+0

おそらく、仕様に指定したファイルパスが正しくないことを意味します。どのコマンドを使ってテストを実行していますか? – Gunderson

+0

テストフォルダツリーはどのように見えますか? – stsatlantis

+0

こんにちは! gulpタスクを使用しています: function e2e(){ gulp.src(["./ src/tests/*。js"])パイプ(分度器({ configFile: "conf/protractor.config。 ( 'error'、function(e){ throw e; });}}; } –

答えて

0

私は自分の問題点を認識しました(私が実現するのを助けたコメントのお陰で)。私はこの理由を知らない

function e2e() { 
    gulp.src(["/src/test/*.js"]).pipe(protractor({ 
    configFile: "conf/protractor.config.js", 
    args: ['--baseUrl', 'http://localhost8080'] 
    })).on('error', function (e) { 
    throw e; 
    }); 
} 

::私は一気タスクで私のテストを実行していた 私が作っgulp.src(["/src/test/*.js"])波平は私のテストファイルへのアクセスもになって、私はそれを変更する:私は知っているgulp.src(["src/test/e2e/login.e2e.spec.js"])

その最高の解決策ではありませんが、生き残るには十分です。

+1

あなたが持っていた問題は 'src/test/login.e2e.spec.js'が' src/test/e2e/login.e2e.spec.js'で 'src/test/**/*。js'を実行してみてください。 – tehbeardedone

+0

あなたは正しいです、それは働いた!ありがとう!! –

関連する問題