There are many tutorials but just can't figure it out... So i am practicing on https://www.saucedemo.com/inventory.html and trying to get the list of elements, and compare it to a list, to see that it is ok. Will do the same after sorting Z to A, and same with price. But i am quite a noob and beginner and really struggling. Until now i managed to get the list and reverse it (?)
const array1 = $$('.inventory_item_name').forEach(element => {
console.log(element.getText())
});
const array2 = $$('.inventory_item_name').reverse().forEach(element => {
console.log(element.getText())
});
If i try to compare these with === it will be true :/ i am trying it in VScode -Js - webdriverIO - Mocha