UNPKG

nightwatch

Version:

Easy to use Node.js based end-to-end testing solution for web applications using the W3C WebDriver API.

17 lines (13 loc) 511 B
const {Select} = require('selenium-webdriver'); module.exports = { async demoTest(browser) { const selectElement = browser.element('select[name=selectomatic]'); await browser .url('https://www.selenium.dev/selenium/web/formPage.html') .perform(async function() { const select = new Select(selectElement); await select.selectByVisibleText('Four'); }) .assert.selected(await selectElement.findElement('option[value=four]'), 'Forth option is selected'); } };