我正在尝试使用WebdriverIO / Appium运行测试。代码如下所示:
页面文件:
const click_on_skip_button = () => {
$("#com.ayoba.ayoba:id/onboard_skip").click();
return;
}
const enter_name = () => {
const nameID = driver.elementsByAccessibilityId("#com.ayoba.ayoba:id/name");
nameID.keys("Dzanan");
return;
}
module.exports = {
click_on_skip_button,
enter_name
}
测试文件:
const { click_on_skip_button, enter_name} = require("../pages/LandingPage")
describe('Landing page tests', function(){
it('Should verify all basic functionalities', () =>{
// For demo purpose
click_on_skip_button()
enter_name();
});
});
错误日志:
0-0] 2019-10-04T12:15:42.350Z INFO webdriver: COMMAND findElement("css selector", "#com.ayoba.ayoba:id/onboard_skip")
[0-0] 2019-10-04T12:15:42.351Z INFO webdriver: [POST] http://127.0.0.1:4723/wd/hub/session/199b590d-1fa2-4adb-8962-d5890c7bcd02/element
2019-10-04T12:15:42.351Z INFO webdriver: DATA { using: 'css selector',
value: '#com.ayoba.ayoba:id/onboard_skip' }
[0-0] Error in "Landing page tests Should verify all basic functionalities"
TypeError: $(...).click is not a function
如果有人可以提供我的代码有什么问题的见解,那将是非常棒的。谢谢