Page object gem with Bootstrap
NickName:charlietaylor Ask DateTime:2014-06-10T17:12:33

Page object gem with Bootstrap

I have been using the Ruby page object gem successfully for the last few months, however the new software I'm testing is using Bootstrap so it has become harder.

e.g I'm trying to select from a dropdown, which is normally simple, but with Bootstrap the original HTML isn't visible to the driver:

<select class="currency-selector" style="display: none;">
    <option value="GLOBAL">All</option>
    <option selected="" value="GBP">GBP</option>
</select>

So this isn't working.

select_list(:original_currency, :class => 'currency-selector')

What is visible to the driver is all the Bootstrap generated code which looks more like this:

<ul class="dropdown-menu inner selectpicker" role="menu" style="max-height: 164.5px; overflow-y: auto; min-height: 80px;">
    <li rel="0">
    <li class="selected" rel="1">
        <a class="" style="" tabindex="0">
            <span class="text">GBP</span>
            <i class="glyphicon glyphicon-ok icon-ok check-mark"></i>
        </a>
    </li>
    <li rel="2">
    <li rel="3">
</ul>

Is there a nice way around this problem and still using the page object gem or will I be forced to use selenium more directly?

Copyright Notice:Content Author:「charlietaylor」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/24137087/page-object-gem-with-bootstrap

More about “Page object gem with Bootstrap” related questions

Page object gem with Bootstrap

I have been using the Ruby page object gem successfully for the last few months, however the new software I'm testing is using Bootstrap so it has become harder. e.g I'm trying to select from a dr...

Show Detail

Limiting CSS styles to one page/view using Bootstrap gem

Using the bootstrap-sass gem, how can I limit the styles to one page/view? For example, I built an app using the gem, and everything works fine. I created a test view, and added code for a Bootstrap

Show Detail

Error on bootstrap gem

I've been getting the following error after trying to install the bootstrap gem. I've followed the advice found elsewhere but it doesn't seem to be working. I definitely always remember to restart my

Show Detail

Version of twitter bootstrap used in twitter-bootstrap-rails gem

I am using twitter-bootstrap-rails gem for my rails 3.2 and ruby 1.9.3 web app. How do I know which version of twitter bootstrap the gem is using? Is it the bootstrap 3 or the legacy bootstrap 2.3....

Show Detail

framework using page Object gem - bundle as a gem

I would like to create a framework using the ruby page object gem. The idea is simple. I want to seperate the common re-uable components under framework project and then finally bundle all these as...

Show Detail

Rails bootstrap gem monkeypatching method not working

I'm using the excellent twitter-bootstrap-rails gem. There is a helper within that gem (NavbarHelper) which is used to generate Bootstrap navbars with a Ruby helper. I want to monkey patch the gem ...

Show Detail

Jekyll-Bootstrap gem serving blank page

I'm trying to set up a jekyll project using the jekyll-bootstrap gem, and I have Jekyll 3.2 installed. When I go to the http port it's serving on, I just get a blank page instead of the usual Jekyll

Show Detail

Wrapping the bootstrap-sass gem in another gem causes asset manifests to break

I'm trying to wrap the bootstrap-sass gem inside another gem (let's call it my-engine). Along the way, I'm building a small Rails application to test things out. As a first step, I wanted to make ...

Show Detail

Wrapping the bootstrap-sass gem in another gem causes asset manifests to break

I'm trying to wrap the bootstrap-sass gem inside another gem (let's call it my-engine). Along the way, I'm building a small Rails application to test things out. As a first step, I wanted to make ...

Show Detail

Installing Bootstrap-sass gem

I have a similar problem as this guy: One Month Rails - Install Bootstrap-sass gem Mine doesn't give me any error, but stays the same. Bootstrap won't be applied, and the webpage looks the same. ...

Show Detail