typescript - 在量角器中找不到带有黄瓜和打字稿的规范
问题描述
我正在使用 Cucumber 和 Typescript 开发 Protractor 我正在尝试运行简单的登录测试,但我得到 No spec found 这是我的配置文件
import { browser, Config } from "protractor";
const path = require('path')
var downloadsPath = path.resolve(__dirname, '../downloads');
exports.config = {
directConnect:true,
frameworl:'custom',
frameworkPath: require.resolve('protractor-cucumber-framework'),
baseUrl: 'https://www.facebook.com/',
specs: ['./Feature/login.feature'],
capabilities: {
browserName: "chrome",
chromeOptions: {
args: ['allow-file-access-from-files'],
prefs: {
download: {
'prompt_for_download': false,
'directory_upgrade': true,
'default_directory': downloadsPath
},
}
}
},
cucumberOpts:{
require:["./StepDefinitions/LoginSteps.js"],
compiler: "ts:ts-node/register",
format: "json:./reports/json/cucumber_report.json",
tags: ["@Smoke"],
strict: true,
},
}
解决方案
问题已解决,问题在于路径规范:['./Feature/login.feature'],正确的路径是规范:['../Feature/login.feature'],请检查文件的路径如果您遇到类似的问题
推荐阅读
- c# - 我可以同时在 Azure 存储中创建和保存文件吗?
- visual-studio-code - 创建 VS Code Java 项目不创建 .project 或 .classpath
- cakephp - CakePHP 4.x - 如何烘焙 Twig 模板?
- python - 对带有精灵的 2d 数组(板)进行深度复制
- spring - Spring Boot - MongoDb 通过手动创建的查询查找
- python - glClearColor 返回负值?(溢出?)
- javascript - 如何在不使用 npm 或 nodejs 的情况下捆绑 javascript 文件?[ 独立的 javascript 捆绑器 ]
- java - ForEach 循环和 PropertyNotFoundExceptions 中的 JSP 错误
- python - 是否有输入 Google 结果的每个链接并提取文本的程序?
- javascript - 在输入字段中输入 youtube 视频 url,它应该显示该视频的 iframe 以进行确认