I am trying to get all the parameters in my upcoming course card div. It has course information, course data, course name, teacher's name and enroll button. I tried the following code and it prints 1, 1+2, 1+2+3, 1+2+3+4. Instead of repetition how can I just have 1 2 3 4?
Then('validate upcoming coursecard all parameters',()=>{
var a = []
cy.get('.upcoming_course_card')
.each(($li, index, $lis) => {
a.push($li[0].innerText)
console.log(a)
})
})