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