gpt4 book ai didi

nightwatch.js - 如何在守夜人测试中设置 select2 的值?

转载 作者:行者123 更新时间:2023-12-05 07:46:12 26 4
gpt4 key购买 nike

如果你能展示一个页面对象的例子就太好了。注释行应为已替换为 jquery select2 的 select 标记设置一个值。

module.exports = {

'Profile step': (client) => {
const profile = client.page.profile();

profile.navigate()
.waitForElementVisible('@editProfileButton', 10000)
.click('@editProfileButton')
.waitForElementVisible('@location', 2000)
.setValue('@location', 'Germany')
//.setSelect2Value('@timezone', '445')
.setValue('@website', 'www.pypage.com')
.click('@saveProfileButton');
}

};

最佳答案

尝试使用“click”而不是“setValue”,像这样:

.click('.select2-results__option[data-value="Germany"]')

关于nightwatch.js - 如何在守夜人测试中设置 select2 的值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41061757/

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