Search code examples
rubycucumbercapybarasite-prism

How to get CSS Style of section in Siteprism Page object model using Cucumber/Capybara


How to get CSS Style of section in Siteprism Page object model using Cucumber/Capybara. For an element, I use the below code to get CSS

@app.page_name.element_name.css('height')

For sections, When I try to use same as above like

@app.page_name.section_name.css('height')

I am getting error as

undefined method `css' for #section_name_Section:0x3635b08> (NoMethodError)

Is there anyway to get css of section directly instead of creating one more element for the same section and using it?

or

Is there any way to convert section into element in step definitions?


Solution

  • Instead of:

    @app.page_name.section_name.css('height')
    

    ...try:

    @app.page_name.section_name.root_element.css('height')