v1
- by gullerya 10/30/202010
disable setup HTML
Setup HTML
<div class="tested-root-with-children">
	<span></span>
	<span></span>
	<div>
		<span></span>
		<span></span>
	</div>
	<div>
		<span></span>
		<span></span>
	</div>
</div>
<div class="tested-root-without-children"></div>
disable setup JavaScript
Setup JavaScript
const root = document.querySelector('.tested-root-with-children');
//const root = document.querySelector('.tested-root-without-children');
delete caserun single casemove downdrag and drop case


ready



const list = Array.from(root.querySelectorAll('*'));
list.unshift(root);
delete caserun single casemove upmove downdrag and drop case


ready



const list = [root, ...root.querySelectorAll('*')];
delete caserun single casemove upmove downdrag and drop case


ready



const list = [];
const ni = document.createNodeIterator(root, NodeFilter.SHOW_ELEMENT);
let next;
while (next = ni.nextNode()) {
    list.push(next);
}
delete caserun single casemove upmove downdrag and drop case


ready



const list = [root];
const tw = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT);
let next;
while (next = tw.nextNode()) {
    list.push(next);
}
delete caserun single casemove updrag and drop case


ready



const list = [root];
if (root.childElementCount) {
    const tw = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT);
    let next;
    while (next = tw.nextNode()) {
        list.push(next);
    }
}
Test Case - click to add another test case
Teardown JS - click to add teardown JavaScript
Output (DOM) - click to monitor output (DOM) while test is running
RUN