Свойство CSS: отображение: нет. Ошибка Cypress: невозможно нажать кнопку «Добавить», чтобы добавить товары в корзину.CSS

Разбираемся в CSS
Ответить Пред. темаСлед. тема
Anonymous
 Свойство CSS: отображение: нет. Ошибка Cypress: невозможно нажать кнопку «Добавить», чтобы добавить товары в корзину.

Сообщение Anonymous »

В настоящее время я создаю комплект регрессионного теста e2e для веб-сайта электронной коммерции, разработанного в Angular JS. Я написал цикл и указал в нем условие, это мой код:
const productText = $el.find('.productName').text()
if(productText.includes('Cookie')) {
cy.wrap(productText).get('.add-btn').contains('Add').click()

}
})```

The website UI is a table view so I'm looping through this table view by tr, and then I also provided a locator there .productName which is the product name basically and if any of the product names on in this table contain "Cookies" word then find the Add button and click to add to basket.

Interestingly if adds the first product at index 0 from the table tr but then when it moves to the next iteration then I get this error:

"Timed out retrying after 4050ms: cy.click() failed because this element is not visible:

Add

This element is not visible because its parent has CSS property: display: none"

The locator is the same for all the buttons I have checked this many times, but then if I use click({force: true}), this still add only the first prodiuct to the basket and then find those products which meet the if statement but it does not click on their add button to add them as well into the basket.

Can someone help with this probably is simple but I'm just stuck here with this, here is a video I have recorded: https://vimeo.com/936771058/081f79e031?share=copy


Подробнее здесь: https://stackoverflow.com/questions/783 ... o-add-prod
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «CSS»