Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nightwatch: how to assert class is visible based on a regex?

I use nighwatch to test a react app.

App CSS classes are like .myClass__4RFGCG

I'd like to test

browser.assert.visible(".myClass", "Testing if .myClass renders")

since from what I read regex are not supported, is there another way?

like image 393
sebap Avatar asked Oct 24 '25 19:10

sebap


1 Answers

if anyone looking for that:

browser.assert.visible("div[class^= 'myClass']", "")
like image 199
sebap Avatar answered Oct 27 '25 03:10

sebap



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!