gpt4 book ai didi

json - 如何在 vscode 中获取 Protractor 或 json 智能感知

转载 作者:行者123 更新时间:2023-12-04 21:32:43 24 4
gpt4 key购买 nike

如何将 Protractor 智能感知到 Visual Studio 代码中,
当我进入浏览器时,我没有获得与 Protractor 浏览器对象相关的所有可用方法。但是当我手动输入方法时,它运行良好。
我已经安装了所有必需的包(package.json),如下所示

"devDependencies": {
"@types/node": "^8.0.47",
"astrolabe": "0.3.6",
"exceljs": "^0.2.3",
"jasmine-allure-reporter": "^0.2.3",
"jasmine-reporters": "2.0.0",
"protractor": "~2.2.0",
"selenium-webdriver": "^2.47.1",
"winston": "1.0.1"
},
"dependencies": {
"path": "^0.12.7",
"promise": "^7.0.4"
}

甚至安装了一个 vscode 扩展“Protractor 片段”,但没有运气......
需要一些指南或我需要遵循的任何特定步骤才能将 Protractor 智能感知引入 vscode。 json解析同样的问题...

最佳答案

我必须创建一个 global.t.ds 文件,以便用智能感知装饰保护器全局变量:

import { ProtractorBrowser, Config, PluginConfig, ProtractorPlugin, Ptor, ElementFinder, ElementArrayFinder, ElementHelper, ProtractorBy, ProtractorExpectedConditions, ProtractorBrowser, firefox, http, remote } from '../node_modules/protractor/built/index';

declare global {
let browser: ProtractorBrowser;
let protractor: Ptor;
let Command: any;
let CommandName: any;
let protractor: Ptor;
let browser: ProtractorBrowser;
let $: (search: string) => ElementFinder;
let $$: (search: string) => ElementArrayFinder;
let element: ElementHelper;
let By: ProtractorBy;
let by: ProtractorBy;
let ExpectedConditions: ProtractorExpectedConditions;
type PluginConfig = PluginConfig;
type ProtractorPlugin = ProtractorPlugin;
let utils: {
firefox: any;
http: any;
remote: any;
};
}

https://bitbucket.org/krewmarco/protractor-vscode-intellisense/src/master/

intellisense on browser object

关于json - 如何在 vscode 中获取 Protractor 或 json 智能感知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47260373/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com