Protractor 量角器-配置查询
我的问题是当我们说例如..时如何调用config.js。。“npm运行测试”将根据config.js中定义的配置运行测试 示例my package.json包含Protractor 量角器-配置查询,protractor,cucumberjs,Protractor,Cucumberjs,我的问题是当我们说例如..时如何调用config.js。。“npm运行测试”将根据config.js中定义的配置运行测试 示例my package.json包含 "scripts" : { "test" : "Env=ST CukeTags=regression testrunner -s functional" } 我的另一个问题是,在哪里可以找到这些配置文件、钩子文件如何相互关联的详细信息?在运行量角器测试期间如何调用这些脚本?您应该在package.json中设置测试脚本 该测试脚本将告
"scripts" : {
"test" : "Env=ST CukeTags=regression testrunner -s functional"
}
我的另一个问题是,在哪里可以找到这些配置文件、钩子文件如何相互关联的详细信息?在运行量角器测试期间如何调用这些脚本?您应该在package.json中设置测试脚本 该测试脚本将告诉命令运行给定配置文件路径的量角器
"scripts":{"test": "protractor typeScript/config/config.js"}
这里,test命令将使用typescript/config文件夹中的配置文件运行量角器
量角器和量角器的示例配置文件
import * as path from "path";
import { browser, Config } from "protractor";
import { Reporter } from "../support/reporter";
const jsonReports = process.cwd() + "/reports/json";
export const config: Config = {
seleniumAddress: "http://127.0.0.1:4444/wd/hub",
SELENIUM_PROMISE_MANAGER: false,
baseUrl: "https://www.google.com",
capabilities: {
browserName: "chrome",
},
framework: "custom",
frameworkPath: require.resolve("protractor-cucumber-framework"),
specs: [
"../../features/*.feature",
],
onPrepare: () => {
browser.ignoreSynchronization = true;
browser.manage().window().maximize();
Reporter.createDirectory(jsonReports);
},
cucumberOpts: {
compiler: "ts:ts-node/register",
format: "json:./reports/json/cucumber_report.json",
require: ["../../typeScript/stepdefinitions/*.js", "../../typeScript/support/*.js"],
strict: true,
tags: "@CucumberScenario or @ProtractorScenario or @TypeScriptScenario or @OutlineScenario",
},
onComplete: () => {
Reporter.createHTMLReport();
},
};
请提供更多关于
testrunner
的详细信息,它来自npm包还是其他?