1
我有與量角器測試問題,它總是拋出一個消息:端對端測試沒有發現規格角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
}
};
我端對端文件:
// 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);
});
});
});
我不知道該怎麼辦,沒關係我投入端對端文件,它會打開瀏覽器,關閉它,拋出所有的時間相同的消息,我用npm run e2e
還是同樣的消息沒有找到規格@ –
JędrekMarkowski還好吧,蠻力:試試這個:'讓套房= { E2E: 「./*spec.ts」, E2E2:」 ../* spec.ts「, e2e2e:」./**/*spec.ts「, e2e2e2:」../**/*spec.ts「 };' – Alf
如果您發佈測試路徑的截圖。所以我們可以找出正確的路徑。 – Alf