Re: Introducing Watirsome

202 views
Skip to first unread message

Chuck van der Linden

unread,
May 17, 2013, 4:46:18 PM5/17/13
to watir-...@googlegroups.com
On Monday, May 13, 2013 11:36:12 PM UTC-7, Alex Rodionov wrote:

Hey guys!

I've recently released Watirsome, which is a gem I've been using at work for a long time as an alternative to well known page-object. 

It's a lot similar to it, but more dynamic and based on watir-webdriver. Thus (at least for now), it works only with it.

Anyways, you can take a look at https://github.com/p0deje/watirsome and probably give it a shot!


How is it different from, or would you contrast it with the "test-factory" page objects gem?  http://rubygems.org/gems/test-factory

just wondering as that is a lightweight, designed for Watir page objects gem that I'm using (and so far like very much) 

Jarmo Pertman

unread,
May 18, 2013, 7:46:25 AM5/18/13
to watir-...@googlegroups.com
Hi!

If you're looking something really lightweight, then my gem Test::Page is the one you're looking for:

Jarmo

Alex Rodionov

unread,
May 18, 2013, 9:19:47 AM5/18/13
to watir-...@googlegroups.com
@Jarmo @Chuck

I created this because I've been using page-object for more than a year and I didn't know abut test-factory and test-page. It has a bit different API compared to them: test-factory and test-page provide with #element class method, while page-object provides with a range of tag-based methods (#div, #text_field, etc.) I find it much nicer as it is more readable.

I've been contributing to page-object constantly but at some point faced architecture limitations which resulted that it may be easier to create my own library which implements similar API other than modify page-object. So I did just the same.

The main idea is to be as close to Watir API as possible (the same locators, method names) + some extra stuff. It's achieved because watirsome is practically a "proxy" to Watir browser. This allowed me to move all element definitions to class methods so it's much easier to support such page classes.

Extra stuff includes initializers for page classes and region modules (to support polymorphous page objects), custom locators which for now is any boolean method Watir::Element responds to. For example:

# find first visible text field with label "Username"
text_field :username, label: 'Username', visible: true

I treat it as an alternative to gems you mentioned which is more suitable for me.

Alex Rodionov

unread,
May 18, 2013, 12:22:18 PM5/18/13
to watir-...@googlegroups.com
For the record, I have updated Watir readme to include all these libraries.

Jarmo Pertman

unread,
May 19, 2013, 10:29:58 AM5/19/13
to watir-...@googlegroups.com
By the way, element class method in test-page is not the same as your tag-based methods. Element in test-page is a method for providing container element - e.g. like "el" in Backbone.js. The method name is "element" because it is framework agnostic - e.g. you can use it with Watir-WebDriver, Selenium-Webdriver, Capybara or with whatever other framework - i'd say that's the real main difference between test-page and Watirsome.

Jarmo

Alex Rodionov

unread,
May 19, 2013, 11:55:48 AM5/19/13
to watir-...@googlegroups.com
Yep, I understand. A lot similar does page-object by wrapping elements in own classes thus allowing to support both watir-webdriver and selenium-webdriver. The point of watirsome is a bit different - it exposes Watir classes so you could work with the same old well-known API. That's what I needed.

-- 
Cheerz,
Alex Rodionov

--
--
Before posting, please read http://watir.com/support. In short: search before you ask, be nice.
 
watir-...@googlegroups.com
http://groups.google.com/group/watir-general
watir-genera...@googlegroups.com
 
---
You received this message because you are subscribed to a topic in the Google Groups "Watir General" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/watir-general/7a9os1u67MI/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to watir-genera...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Jarmo Pertman

unread,
May 20, 2013, 4:05:16 PM5/20/13
to watir-...@googlegroups.com
Hehe, you can work with the same well-known Watir API, when using test-page too, because everything will be proxied to the underlying Watir element via method_missing. And you can use well-known selenium-webdriver API in the same way. Or some other well-known API.

The main point of test-page compared to page-object, is that it does almost not have any API itself, but it just creates the environment for you to start using almost any library you feel comfortable in.

Jarmo

Alex Rodionov

unread,
May 20, 2013, 9:39:58 PM5/20/13
to watir-...@googlegroups.com
In case I had to use capybara/selenium, I'd definitely try test-page, but I don't see much point in using them compared to Watir :) Maybe only tight Rails integration of the first, but I think I would better improve watir-rails.


-- 
Cheerz,
Alex Rodionov

Reply all
Reply to author
Forward
0 new messages