2017-07-14 13 views
1

を発見していない、それは常にメッセージをスロー:E2Eテストませスペックiは分度器テストの問題を持って、角2分度器

[10:11:22] I/hosted - Using the selenium server at http://localhost:4444/wd/hub 
[10:11:22] I/launcher - Running 1 instances of WebDriver 
Started 
No specs found 
Finished in 0.001 seconds 
[10:11:24] I/launcher - 0 instance(s) of WebDriver still running 
[10:11:24] I/launcher - firefox #01 passed 
http-server stopped. 

設定ファイルは結構です、それはE2Eファイルを読み込みます。設定ファイルがあります:

exports.config = { 
    seleniumAddress: 'http://localhost:4444/wd/hub', 
    baseURL: 'http://localhost:3000/', 
    capabilities: { 
     'browserName': 'firefox' 
    }, 
    specs: ['e2e-spec.ts'], 
    jasmineNodeOpts: { 
     showColors: true 
    } 
}; 

マイE2Eファイル:

// app.e2e-spec.ts 
import { Registration } from './registrationPage'; 
import {browser} from "protractor"; 

describe('e2e-spec.ts', function() { 
    let page: Registration; 
    let header = 'Welcome!'; 
    page = new Registration(); 
    let result = page.getHeader(); 
     it('should display heading saying Welcome!',() => { 
     page.navigateTo().then(function() { 
      console.log('Start test 1: automatic redirection of index'); 
      expect(result).toEqual(header); 
     }); 
    }); 
}); 

私はいけないが、それを閉じて、それがブラウザを開いて、私がE2Eファイルに入れてかは重要ではありません、何をすべきか知っているとすべての時間に同じメッセージを投げ、私はnpm run e2e

答えて

1

を使用するスイートを使用してみてください:

/*let suites = { 
    e2e: "./*e2e-spec.ts" 
};*/ 

//Bruteforce to find the path 

let suites = { 
    e2e2: "../**/*spec.ts" 
}; 

exports.config = { 
    seleniumAddress: 'http://localhost:4444/wd/hub', 
    baseURL: 'http://localhost:3000/', 
    capabilities: { 
     'browserName': 'firefox' 
    }, 
    suites: suites, 
    jasmineNodeOpts: { 
     showColors: true 
    } 
}; 

たぶんあなたは、ページオブジェクトDessignパターンになります。

let RegistrationPage = require('./registrationPage'); 

describe('e2e-spec.ts', function() { 
    let page = new RegistrationPage(); 
    let result = page.getHeader(); 
    let header = 'Welcome!'; 

    it('should display heading saying Welcome!',() => { 
     page.navigateTo().then(function() { 
      console.log('Start test 1: automatic redirection of index'); 
      expect(result).toEqual(header); 
     }); 
    }); 
}); 
+0

それでも同じメッセージなしスペックはJędrekMarkowskiオールライト、ブルートフォース@ –

+0

見つかりませんでした。みましょう 'スイート= { E2E:これを試してください "./*spec.ts"、 e2e2:」../* spec.ts "、 e2e2e:" ./**/*spec.ts "、 e2e2e2:" ../**/*spec.ts " }; – Alf

+0

あなたが投稿したあなたのテストパスのスクリーンショット。正しいパスがどこにあるのかわかります – Alf

0

それは非常に簡単です:それはE2Eフォルダ内のすべてのテストケース(.e2e-spec.ts)を実行することを意味し

specs: [ 
'./e2e/**/*.e2e-spec.ts' 
] 

を。

enter image description here

関連する問題