`)
createOrderTest($el.get(0), 0);
})
})
context('shadowCommands', () => {
it('in general these commands work. this is good enough for now.', () => {
cy.shadowGet('#test')
.shadowFind('span')
.shadowShould('have.length', 2)
.shadowEq(1)
.should($el => {
assert($el, 'shadowGet is able to retrieve the shadow element');
assert($el, 'shadowFind span is able to get the elements');
assert($el, 'shadowShould was able to make the assertion');
})
});
it('shadowGet returns elements in correct order', () => {
[...Array(6)].forEach((_, i) => {
cy.shadowGet('.order-test')
.shadowEq(i)
.shadowShould('have.class', i)
})
})
});
context('retryability', () => {
it('retries the starter element until all chained commands pass', () => {
let count = 0;
// add another option into the select after 2 seconds
// to ensure that the shadowGet will not resolve immediately
// with the correct state
cy.shadowGet('select option')
.then($el => {
setTimeout(() => {
$el.parent().append('