Is it possible to set the value of Style property of an element by nightwatch.js ? if yes then how?

前端 未结 1 618
我寻月下人不归
我寻月下人不归 2021-01-22 01:33

I am working with nightwatch.js and i am quite new into this automation testing, i want to set the value into the style property of an element by nightwatch.js, so i am asking,

相关标签:
1条回答
  • 2021-01-22 02:04

    You can use the Nightwatch Selenium execute protocol to change the style property of an element. With the Selenium execute protocol you can execute arbitrary javascript on the site to be tested.

    For example you can use it like this:

    browser
    .execute("document.getElementById('main').style.display = 'block';")
    .expect.element('#main').to.have.css('display').which.equals('block');
    
    0 讨论(0)
提交回复
热议问题