My book is finally out

I’m happy to announce that my book is finally available. I’m publishing it through LeanPub and the version that is released is a beta. This means that I will be publishing updates every few weeks until a the final book is complete.

You can get your copy on the LeanPub site. I hope you enjoy the book.

7 thoughts on “My book is finally out

  1. I’ve been working with Cucumber and WATIR/WebDriver for a while, but I like your style of explanation – picked up a copy – looking forward to learning what I should already know!

  2. Pingback: Watir Podcast #49 | Watir Podcast

  3. I notice you never seem to have 100% code coverage with your specs, which gives me pause. And I say that I also notice that a lot of times your Cucumber tests seem to fail. For example, when I pull down your latest build, this particular step never passes:

    Then /^the data for row “([^\”]*)” and column “([^\”]*)” should be nil$/ do |row, column|
    @element[row][column].should be_nil

    That’s from the table_steps.rb file, matching up with the table.feature file.

    So I guess I’m curious: how are you getting that to pass?

    And the reason this is all of concern to me is because if you are writing a book on this, I would want to make sure what whatever framework I’m promoting does have 100% code coverage from a unit test perspective and that the acceptance-driven tests (i.e., the Cucumber stuff) — which I presume drove your development — are fully working.

    Unless I’m doing something wrong. But I looked at the latest information on Travis and it looks like tons of failures.

    Also: since Watir-WebDriver calls down to Selenium when needed and since you can access Selenium directly if needed, it seems like an extra layer of complication to be supporting Selenium and Watir. From what I can see, you’re putting an interface over both tools. Obviously there’s benefit to this from your perspective, but I didn’t see anything in the book that really covered this. In fact, the books seems to focus more on Watir-WebDriver than anything. (Personally I prefer Watir over Selenium anyway.)

    • I can assure that all features do pass all of the time on my os x system as well as a linux and windows vm I have on my system. Also, the reason you feel that there is not 100% test coverage has to do with a problem with rspec. I do completely test drive all of my code all of the time. The problem is when rspec runs specs and a module is mixed in with another module it is not unmixed in subsequent specs which causes inaccurate failures when they run. In the past I used another gem to include and uninclude the modules so the tests would run properly but that caused the gem to fail when running with jruby. I decided that I’d test drive the code but then after I was comfortable with behavior I’d remove the spec keeping the feature to assure accuracy.

      I can help you debug the problem on your machine but I will need a little more information. What platform are you using? What ruby are you using?

      • Fair enough on all points. I am using Windows and Ruby 1.9.3. As a matter of particular isolation so you have a data point, I don’t see a unit test that works that proves out this logic:

        def find_index_by_title(row_title)
        element.rows.find_index do |row|
        row.cells.any? { |col| col.text.include? row_title }

        (Sorry if my indents don’t come through.) That’s from the table.rb file in lib\page-object\platforms\watir_webdriver.

        When I run SimpleCov, the row.cells.any? line does not indicate it is being covered. And the reason that’s of concern to me is because I can’t quite tell how to use that logic.

        It looks like it’s saying “for every row you come across, for any of the cells in that row, if the text includes the ‘row title’, then you’re good.” But I don’t get what the “row title” is here. A row title to me is normally when you have a table where the first column contains a set of row titles that don’t change.

        • I’m real late to this game, but I agree Steve. There’s actually a lot that isn’t unit tested just by looking at SimpleCov.

          However, I think the thing you are looking at also leads to errors when you unit test it. You’ll get “can’t convert Fixnum into String.” That will happen on this line in table.rb:

          return nil unless idx && columns >= idx + 1

          I honestly think some of this table logic doesn’t work very well. Normally I would turn to a unit test for this as well but, like I said, when I wrote my own unit test for it, I found it gave errors that did not occur if I just ran the code as I think it’s supposed to be run.

  4. Hi, I just bought a copy of your book ‘cucumber & Cheese’. While running the script on page 30 – Adopting a puppy – the finished script. the browser launches but then I am getting an error:

    /Library/Ruby/Gems/1.8/gems/watir-webdriver-0.6.1/lib/watir-webdriver/elements/element.rb:365:in `assert_exists’: unable to locate element, using {:tag_name=>”button”, :value=>”ViewDetails”} (Watir::Exception::UnknownObjectException)
    from /Library/Ruby/Gems/1.8/gems/watir-webdriver-0.6.1/lib/watir-webdriver/elements/element.rb:95:in `click’
    from cheese.rb:5

    Any ideas as to what is causing this? Thanks.


Leave a Reply

Your email address will not be published. Required fields are marked *