0
、私は要素がwebdriverをプロトコルを使用して得ることができますが、結果(res.value)は要素のidの配列です...Vue.js e2e w Nightwatch.js WebElements(WebDriverプロトコル)の詳細を取得する方法は? Nightwatch.jsワット私2E2の試験中
がどのように私はこれらの要素の詳細を取得することができます?
[ { ELEMENT: '0.03261545200301663-4' },
{ ELEMENT: '0.03261545200301663-5' } ] ' length: ' 2
FIRST ELEMENT ID: 0.03261545200301663-4
FIRST ELEMENT TAG NAME: undefined
E2E/test.js
module.exports = {
'Add shoppinglist': (browser) => {
const devServer = browser.globals.devServerURL
// open the browser and wait for #app to be on the page
browser.url(devServer).waitForElementVisible('#app', 5000)
// check the title of the current active tab
browser.expect.element('ul.nav-tabs li.active a').text.to.equal('Groceries')
// click on add shopping list plus button
browser.click('#addShoppingListIcon')
// get shopping list tab title elements
browser.elements('css selector', 'ul.nav-tabs li', (res) => {
console.log(res.value, ' length: ', res.value.length)
console.log('FIRST ELEMENT ID: ', res.value[0].ELEMENT)
console.log('FIRST ELEMENT TAG NAME: ', res.value[0].tag_name)
console.log('FIRST ELEMENT CSS CLASS: ', res.value[0].style('class'))
})
browser.pause(1000)
// check the title of the active tab
browser.expect.element('ul.nav-tabs li.active a').text.to.equal('New Shopping List')
// check the title of the active content panel
browser.expect.element('#app .tab-content .tab-pane.active h2').text.to.equal('New Shopping List')
// check the default value of the footer change title input field
browser.getValue('#app .tab-content .tab-pane.active .footer input.input[name=title]', (result) => {
browser.assert.equal(result.value, 'New Shopping List')
})
browser.end()
}
}