我正在使用 webdriverIO 自动化一些测试。在 webdriverIO 中调用基本函数时出现错误。即使我调用 $('some css').click() 它也会出错
TypeError: $(...).click is not a function
我现在受够了。请帮忙。示例代码
describe("Verify menu options", function()
{
it("Verify Menu options", function()
{
$('button#sitenav-v2-sidenav-toggle').click();
});
});
my package.json is
{
"name": "webdriver-io-practice",
"version": "1.0.0",
"description": "this is webdriver io scripts-pankaj",
"main": "index.js",
"scripts": {
"test": "./node_modules/.bin/wdio ./wdio.conf.js"
},
"author": "Pankaj Patil",
"license": "ISC",
"devDependencies": {
"@babel/core": "^7.14.6",
"@babel/preset-env": "^7.14.7",
"@babel/register": "^7.14.5",
"@rpii/wdio-html-reporter": "^7.7.1",
"@wdio/allure-reporter": "^7.7.7",
"@wdio/cli": "^7.8.0",
"@wdio/local-runner": "^7.7.8",
"@wdio/mocha-framework": "^7.7.7",
"@wdio/spec-reporter": "^7.7.7",
"@wdio/sync": "^7.8.0",
"chai": "^4.3.4",
"chromedriver": "^91.0.1",
"local-runner": "^0.1.1-alpha",
"wdio-chromedriver-service": "^7.2.0",
"webdriverio": "^7.7.8"
},
"dependencies": {
"chai-webdriverio": "^1.0.0"
}
}
请帮我解决问题。