siesta-lite
Version:
Stress-free JavaScript unit testing and functional testing tool, works in NodeJS and browsers
35 lines (27 loc) • 941 B
JavaScript
StartTest(function (t) {
// weirdly freezes the automation in Safari 11, (Safari 10 is fine)
// possibly caused by the <select>-ion list appearance in the left-top corner
// as seen in manual SauceLabs session
if (t.bowser.safari) return
document.body.innerHTML =
'<select id="sel">' +
'<option value="volvo">Volvo</option>' +
'<option value="saab">Saab</option>' +
'<option value="mercedes">Mercedes</option>' +
'<option value="audi" disabled="true">Audi</option>' +
'</select> '
t.firesOnce('#sel', 'change');
t.chain(
{ click : '#sel' },
{ click : '#sel [value=mercedes]' },
function(next) {
t.hasValue('#sel', 'mercedes');
next()
},
{ click : '#sel [value=audi]' },
function(next) {
t.hasValue('#sel', 'mercedes');
next()
}
);
})