【发布时间】:2019-04-03 18:13:40
【问题描述】:
我正在尝试浏览此网址 - https://gallant-meitner-86c223.netlify.com/#/,检查页面上 a[href] 链接的数量,单击它们并验证此人是否存在
wdio.conf.js
exports.config = {
runner: 'local',
specs: [
'test/e2e/**/*.js'
],
maxInstances: 10,
capabilities: [{
maxInstances: 5,
browserName: 'firefox'
}],
logLevel: 'info',
bail: 0,
baseUrl: 'http://localhost:8080',
waitforTimeout: 10000,
connectionRetryTimeout: 90000,
connectionRetryCount: 3,
services: ['selenium-standalone'],
framework: 'jasmine',
reporters: ['spec', 'junit'],
jasmineNodeOpts: {
defaultTimeoutInterval: 60000,
}
我的测试
describe('Home', () => {
it('should get count of the links and click on them and verify the person exists', async () => {
await browser.url('/')
const title = await browser.getTitle()
expect(title).toBe('Force Vue Awakens')
// This doesn't work as well
const links = $$('#links a')
const count = links.length
expect(count).toBe(10)
links.forEach((link) => {
link.click()
// Dont know how to verify each person after clicking the link
})
})
})
我是自动化测试和网络驱动程序的新手。任何帮助或小提琴将不胜感激!
【问题讨论】:
标签: javascript automated-tests webdriver-io