From 5515bf657774c42e94feb108eacf614bcc734d66 Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 09:58:38 -0500 Subject: [PATCH 01/48] Added content --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a4322c0..5c0bf53 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # Robot Framework Page Objects -This Python package adds support of the [Page Object](http://martinfowler.com/bliki/PageObject.html) pattern to [Robot Framework](http://robotframework.org/) & Robot Framework's [Selenium2Library](https://github.com/rtomac/robotframework-selenium2library). +This Python package adds support of the [Page Object](http://martinfowler.com/bliki/PageObject.html) pattern to [Robot Framework](http://robotframework.org/) & Robot Framework's [Selenium2Library](https://github.com/rtomac/robotframework-selenium2library). Though this is a Robot library, it's usable outside the Robot context and facilitates use of the page object +pattern independently of any testing framework (including Python's +unittest etc.). The main point of using page objects is to factor out page implementation details (locators, UI details etc.) from the actual test suites. This makes the tests read more about the services a page offers and what's being tested instead of the internals of the page. It also makes your tests much more maintainable. For example, if a developer changes an element ID, you only need make that change once--in the appropriate page object. From d77920cc6e9914f31c8ddc2d012fac01c8848b4b Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 10:00:11 -0500 Subject: [PATCH 02/48] More content --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5c0bf53..9c628ab 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Robot Framework Page Objects -This Python package adds support of the [Page Object](http://martinfowler.com/bliki/PageObject.html) pattern to [Robot Framework](http://robotframework.org/) & Robot Framework's [Selenium2Library](https://github.com/rtomac/robotframework-selenium2library). Though this is a Robot library, it's usable outside the Robot context and facilitates use of the page object +This Python package adds support for the [Page Object](http://martinfowler.com/bliki/PageObject.html) pattern with [Robot Framework](http://robotframework.org/) and Robot Framework's [Selenium2Library](https://github.com/rtomac/robotframework-selenium2library). Though this is a Robot library, it's usable outside the Robot context and facilitates use of the page object pattern independently of any testing framework (including Python's unittest etc.). From 39e26770b69c15f1f5930396dd806cd92ea1d395 Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 10:00:49 -0500 Subject: [PATCH 03/48] More content --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9c628ab..886f28e 100755 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # Robot Framework Page Objects +## What it is This Python package adds support for the [Page Object](http://martinfowler.com/bliki/PageObject.html) pattern with [Robot Framework](http://robotframework.org/) and Robot Framework's [Selenium2Library](https://github.com/rtomac/robotframework-selenium2library). Though this is a Robot library, it's usable outside the Robot context and facilitates use of the page object pattern independently of any testing framework (including Python's unittest etc.). From 5ffcd0bbfac5f6e98923e46fa93222ed455bddfb Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 10:02:34 -0500 Subject: [PATCH 04/48] More content --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 886f28e..5c07e16 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Robot Framework Page Objects ## What it is -This Python package adds support for the [Page Object](http://martinfowler.com/bliki/PageObject.html) pattern with [Robot Framework](http://robotframework.org/) and Robot Framework's [Selenium2Library](https://github.com/rtomac/robotframework-selenium2library). Though this is a Robot library, it's usable outside the Robot context and facilitates use of the page object +This Python package adds support for the [Page Object](http://martinfowler.com/bliki/PageObject.html) pattern with [Robot Framework](http://robotframework.org/) and Robot Framework's [Selenium2Library](https://github.com/rtomac/robotframework-selenium2library). Though this is a [Robot library](http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#extending-robot-framework), it's usable outside the Robot context and facilitates use of the page object pattern independently of any testing framework (including Python's unittest etc.). From 3a3f3f1329be5d1f276497db1f8f4afa8c8e00bd Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 10:04:32 -0500 Subject: [PATCH 05/48] More content --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5c07e16..1bd9e7d 100755 --- a/README.md +++ b/README.md @@ -2,8 +2,10 @@ ## What it is This Python package adds support for the [Page Object](http://martinfowler.com/bliki/PageObject.html) pattern with [Robot Framework](http://robotframework.org/) and Robot Framework's [Selenium2Library](https://github.com/rtomac/robotframework-selenium2library). Though this is a [Robot library](http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#extending-robot-framework), it's usable outside the Robot context and facilitates use of the page object -pattern independently of any testing framework (including Python's -unittest etc.). +pattern independently of any Python testing framework. This means you can use it to create +page objects and run tests in other testing frameworks like +unittest, +[lettuce](http://lettuce.it/tutorial/simple.html) etc. The main point of using page objects is to factor out page implementation details (locators, UI details etc.) from the actual test suites. This makes the tests read more about the services a page offers and what's being tested instead of the internals of the page. It also makes your tests much more maintainable. For example, if a developer changes an element ID, you only need make that change once--in the appropriate page object. From 7ea789c19cb682be9c11ef1ead8485a9018529b2 Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 10:08:01 -0500 Subject: [PATCH 06/48] More content --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 1bd9e7d..a57da87 100755 --- a/README.md +++ b/README.md @@ -7,6 +7,12 @@ page objects and run tests in other testing frameworks like unittest, [lettuce](http://lettuce.it/tutorial/simple.html) etc. +In addition to providing a base `Page` class to build upon, this package provides convenient +test-running capabilities, like: + + - A hidden, yet accessible Selenium2 `driver` instance, which allows you to focus + your tests on the AUT instead of the implementation details of Selenium2. + The main point of using page objects is to factor out page implementation details (locators, UI details etc.) from the actual test suites. This makes the tests read more about the services a page offers and what's being tested instead of the internals of the page. It also makes your tests much more maintainable. For example, if a developer changes an element ID, you only need make that change once--in the appropriate page object. Each page object is simply a Robot library that inherits from this package's base `Page` class. These library classes can work independently of Robot From 05bbd2690c0a566e269ab4d01f37999a7d595cc8 Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 10:08:17 -0500 Subject: [PATCH 07/48] More content --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a57da87..9e62b10 100755 --- a/README.md +++ b/README.md @@ -10,8 +10,8 @@ page objects and run tests in other testing frameworks like In addition to providing a base `Page` class to build upon, this package provides convenient test-running capabilities, like: - - A hidden, yet accessible Selenium2 `driver` instance, which allows you to focus - your tests on the AUT instead of the implementation details of Selenium2. +- A hidden, yet accessible Selenium2 `driver` instance, which allows you to focus +your tests on the AUT instead of the implementation details of Selenium2. The main point of using page objects is to factor out page implementation details (locators, UI details etc.) from the actual test suites. This makes the tests read more about the services a page offers and what's being tested instead of the internals of the page. It also makes your tests much more maintainable. For example, if a developer changes an element ID, you only need make that change once--in the appropriate page object. From 746c4b5c6ecce0acdac9943c658533747b1912d6 Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 10:11:05 -0500 Subject: [PATCH 08/48] More content --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9e62b10..a717c5f 100755 --- a/README.md +++ b/README.md @@ -11,7 +11,9 @@ In addition to providing a base `Page` class to build upon, this package provide test-running capabilities, like: - A hidden, yet accessible Selenium2 `driver` instance, which allows you to focus -your tests on the AUT instead of the implementation details of Selenium2. +your tests on the *application under test* AUT instead of the implementation details of Selenium2. +- Parameterization and normalization of testing variables, like the AUT's host, +browser type The main point of using page objects is to factor out page implementation details (locators, UI details etc.) from the actual test suites. This makes the tests read more about the services a page offers and what's being tested instead of the internals of the page. It also makes your tests much more maintainable. For example, if a developer changes an element ID, you only need make that change once--in the appropriate page object. From 0a1d79c3abc0c30c1c88097418b2bf9bccd9c0cb Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 10:22:28 -0500 Subject: [PATCH 09/48] More content --- README.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index a717c5f..afdf48e 100755 --- a/README.md +++ b/README.md @@ -1,19 +1,18 @@ -# Robot Framework Page Objects - -## What it is -This Python package adds support for the [Page Object](http://martinfowler.com/bliki/PageObject.html) pattern with [Robot Framework](http://robotframework.org/) and Robot Framework's [Selenium2Library](https://github.com/rtomac/robotframework-selenium2library). Though this is a [Robot library](http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#extending-robot-framework), it's usable outside the Robot context and facilitates use of the page object -pattern independently of any Python testing framework. This means you can use it to create +# Robot Framework Page Objects ## What it is This Python package adds support for the [Page Object](http://martinfowler.com/bliki/PageObject.html) pattern with [Robot Framework](http://robotframework.org/) and Robot Framework's [Selenium2Library](https://github.com/rtomac/robotframework-selenium2library). Though this is a [Robot library](http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#extending-robot-framework), it's usable outside the Robot context and facilitates use of the page object pattern independently of any Python testing framework. This means you can use it to create page objects and run tests in other testing frameworks like unittest, [lettuce](http://lettuce.it/tutorial/simple.html) etc. -In addition to providing a base `Page` class to build upon, this package provides convenient -test-running capabilities, like: +In addition to providing a base `Page` class to build upon, this package provides +many other conveniences somewhat independent of page object modeling including: - A hidden, yet accessible Selenium2 `driver` instance, which allows you to focus -your tests on the *application under test* AUT instead of the implementation details of Selenium2. -- Parameterization and normalization of testing variables, like the AUT's host, -browser type +on the *application under test* AUT instead of Selenium2 implementation details.. +- Easy parameterization and normalization of testing variables, like the AUT's host, +browser type, [Sauce Labs](https://saucelabs.com/) integration, timeouts etc. +- Convenient helper functions like `find_element`, `find_elements` that take [locators](http://rtomac.github.io/robotframework-selenium2library/doc/Selenium2Library.html#Locating%20elements +*or* [WebElements](http://selenium-python.readthedocs.org/en/latest/api.html#module-selenium.webdriver.remote.webelement) as parameters. +- Much more... The main point of using page objects is to factor out page implementation details (locators, UI details etc.) from the actual test suites. This makes the tests read more about the services a page offers and what's being tested instead of the internals of the page. It also makes your tests much more maintainable. For example, if a developer changes an element ID, you only need make that change once--in the appropriate page object. From 164280ce8dc6bd8ec8e8cb0f2ce5af553b8d1b59 Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 10:23:00 -0500 Subject: [PATCH 10/48] More content --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index afdf48e..96af262 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -# Robot Framework Page Objects ## What it is This Python package adds support for the [Page Object](http://martinfowler.com/bliki/PageObject.html) pattern with [Robot Framework](http://robotframework.org/) and Robot Framework's [Selenium2Library](https://github.com/rtomac/robotframework-selenium2library). Though this is a [Robot library](http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#extending-robot-framework), it's usable outside the Robot context and facilitates use of the page object pattern independently of any Python testing framework. This means you can use it to create +# Robot Framework Page Objects +## What it is +This Python package adds support for the [Page Object](http://martinfowler.com/bliki/PageObject.html) pattern with [Robot Framework](http://robotframework.org/) and Robot Framework's [Selenium2Library](https://github.com/rtomac/robotframework-selenium2library). Though this is a [Robot library](http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#extending-robot-framework), it's usable outside the Robot context and facilitates use of the page object pattern independently of any Python testing framework. This means you can use it to create page objects and run tests in other testing frameworks like unittest, [lettuce](http://lettuce.it/tutorial/simple.html) etc. From ba0cc2b8f1604638b0639514d2dad480b81f728d Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 10:23:42 -0500 Subject: [PATCH 11/48] More content --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 96af262..e7a750c 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Robot Framework Page Objects ## What it is -This Python package adds support for the [Page Object](http://martinfowler.com/bliki/PageObject.html) pattern with [Robot Framework](http://robotframework.org/) and Robot Framework's [Selenium2Library](https://github.com/rtomac/robotframework-selenium2library). Though this is a [Robot library](http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#extending-robot-framework), it's usable outside the Robot context and facilitates use of the page object pattern independently of any Python testing framework. This means you can use it to create +This Python package adds support for the [Page Object](http://martinfowler.com/bliki/PageObject.html) pattern with [Robot Framework](http://robotframework.org/) and Robot Framework's [Selenium2Library](https://github.com/rtomac/robotframework-selenium2library). Though this +package is a [Robot library](http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#extending-robot-framework), it's usable outside the Robot context and facilitates use of the page object pattern independently of any Python testing framework. This means you can use it to create page objects and run tests in other testing frameworks like unittest, [lettuce](http://lettuce.it/tutorial/simple.html) etc. From 3291fc3c316aeae3b240e2131c33a72b4749b2c2 Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 10:24:25 -0500 Subject: [PATCH 12/48] More content --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e7a750c..71e95be 100755 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ In addition to providing a base `Page` class to build upon, this package provide many other conveniences somewhat independent of page object modeling including: - A hidden, yet accessible Selenium2 `driver` instance, which allows you to focus -on the *application under test* AUT instead of Selenium2 implementation details.. +on the *application under test* (AUT) instead of Selenium2 implementation details.. - Easy parameterization and normalization of testing variables, like the AUT's host, browser type, [Sauce Labs](https://saucelabs.com/) integration, timeouts etc. - Convenient helper functions like `find_element`, `find_elements` that take [locators](http://rtomac.github.io/robotframework-selenium2library/doc/Selenium2Library.html#Locating%20elements From 7761a50d42403db23d0109fa83ac905ec49a44a5 Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 10:24:44 -0500 Subject: [PATCH 13/48] More content --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 71e95be..7270d5e 100755 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ In addition to providing a base `Page` class to build upon, this package provide many other conveniences somewhat independent of page object modeling including: - A hidden, yet accessible Selenium2 `driver` instance, which allows you to focus -on the *application under test* (AUT) instead of Selenium2 implementation details.. +on the *application under test* (AUT) instead of Selenium2 implementation details. - Easy parameterization and normalization of testing variables, like the AUT's host, browser type, [Sauce Labs](https://saucelabs.com/) integration, timeouts etc. - Convenient helper functions like `find_element`, `find_elements` that take [locators](http://rtomac.github.io/robotframework-selenium2library/doc/Selenium2Library.html#Locating%20elements From 1ccfa2d0c2605a00eeb8e372610222eca647b9e5 Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 10:25:15 -0500 Subject: [PATCH 14/48] More content --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7270d5e..ce69358 100755 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ many other conveniences somewhat independent of page object modeling including: - A hidden, yet accessible Selenium2 `driver` instance, which allows you to focus on the *application under test* (AUT) instead of Selenium2 implementation details. - Easy parameterization and normalization of testing variables, like the AUT's host, -browser type, [Sauce Labs](https://saucelabs.com/) integration, timeouts etc. +the browser type to test with, [Sauce Labs](https://saucelabs.com/) integration, timeouts etc. - Convenient helper functions like `find_element`, `find_elements` that take [locators](http://rtomac.github.io/robotframework-selenium2library/doc/Selenium2Library.html#Locating%20elements *or* [WebElements](http://selenium-python.readthedocs.org/en/latest/api.html#module-selenium.webdriver.remote.webelement) as parameters. - Much more... From b87b57c17b747ff2bff5fe6bd532fd9266477343 Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 10:25:55 -0500 Subject: [PATCH 15/48] More content --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ce69358..1a69e89 100755 --- a/README.md +++ b/README.md @@ -12,7 +12,8 @@ many other conveniences somewhat independent of page object modeling including: - A hidden, yet accessible Selenium2 `driver` instance, which allows you to focus on the *application under test* (AUT) instead of Selenium2 implementation details. - Easy parameterization and normalization of testing variables, like the AUT's host, -the browser type to test with, [Sauce Labs](https://saucelabs.com/) integration, timeouts etc. +the browser type to test with, [Sauce Labs](https://saucelabs.com/) integration, timeouts +for locating injected content after page-load etc. - Convenient helper functions like `find_element`, `find_elements` that take [locators](http://rtomac.github.io/robotframework-selenium2library/doc/Selenium2Library.html#Locating%20elements *or* [WebElements](http://selenium-python.readthedocs.org/en/latest/api.html#module-selenium.webdriver.remote.webelement) as parameters. - Much more... From cdb612e98484774d150f5ca688d951b4fad43770 Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 10:26:23 -0500 Subject: [PATCH 16/48] More content --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1a69e89..4d487b5 100755 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ on the *application under test* (AUT) instead of Selenium2 implementation detail - Easy parameterization and normalization of testing variables, like the AUT's host, the browser type to test with, [Sauce Labs](https://saucelabs.com/) integration, timeouts for locating injected content after page-load etc. -- Convenient helper functions like `find_element`, `find_elements` that take [locators](http://rtomac.github.io/robotframework-selenium2library/doc/Selenium2Library.html#Locating%20elements +- Convenient helper functions like `find_element`, `find_elements` that take [locators](http://rtomac.github.io/robotframework-selenium2library/doc/Selenium2Library.html#Locating%20elements) *or* [WebElements](http://selenium-python.readthedocs.org/en/latest/api.html#module-selenium.webdriver.remote.webelement) as parameters. - Much more... From 4ef3c5d598f382a862912a03dda7d3e14c148348 Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 10:26:52 -0500 Subject: [PATCH 17/48] More content --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 4d487b5..970e148 100755 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ for locating injected content after page-load etc. *or* [WebElements](http://selenium-python.readthedocs.org/en/latest/api.html#module-selenium.webdriver.remote.webelement) as parameters. - Much more... +## More on page objects The main point of using page objects is to factor out page implementation details (locators, UI details etc.) from the actual test suites. This makes the tests read more about the services a page offers and what's being tested instead of the internals of the page. It also makes your tests much more maintainable. For example, if a developer changes an element ID, you only need make that change once--in the appropriate page object. Each page object is simply a Robot library that inherits from this package's base `Page` class. These library classes can work independently of Robot From 3bb0559dea8447407260716ad3c196d2d12938c5 Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 10:27:12 -0500 Subject: [PATCH 18/48] More content --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 970e148..15c4df0 100755 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ for locating injected content after page-load etc. - Much more... ## More on page objects -The main point of using page objects is to factor out page implementation details (locators, UI details etc.) from the actual test suites. This makes the tests read more about the services a page offers and what's being tested instead of the internals of the page. It also makes your tests much more maintainable. For example, if a developer changes an element ID, you only need make that change once--in the appropriate page object. +The main point of using page objects is to factor out page implementation details (element locators, UI details etc.) from the actual test suites. This makes the tests read more about the services a page offers and what's being tested instead of the internals of the page. It also makes your tests much more maintainable. For example, if a developer changes an element ID, you only need make that change once--in the appropriate page object. Each page object is simply a Robot library that inherits from this package's base `Page` class. These library classes can work independently of Robot Framework, even though they ultimately inherit from Robot Framework's Selenium2Library. This allows you to encapsulate page logic Robot libraries, but use those libraries in any testing framework, including From f71d07a6eba7061c5586274da56e94aa260cd8c3 Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 10:27:49 -0500 Subject: [PATCH 19/48] More content --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 15c4df0..e0c343e 100755 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ for locating injected content after page-load etc. ## More on page objects The main point of using page objects is to factor out page implementation details (element locators, UI details etc.) from the actual test suites. This makes the tests read more about the services a page offers and what's being tested instead of the internals of the page. It also makes your tests much more maintainable. For example, if a developer changes an element ID, you only need make that change once--in the appropriate page object. +## How it works Each page object is simply a Robot library that inherits from this package's base `Page` class. These library classes can work independently of Robot Framework, even though they ultimately inherit from Robot Framework's Selenium2Library. This allows you to encapsulate page logic Robot libraries, but use those libraries in any testing framework, including Python [unittest](https://docs.python.org/2/library/unittest.html) test cases. From b4eb728be520a06bd5a3039aae53eb31dc7afdf8 Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 10:28:02 -0500 Subject: [PATCH 20/48] More content --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e0c343e..a56af51 100755 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ for locating injected content after page-load etc. The main point of using page objects is to factor out page implementation details (element locators, UI details etc.) from the actual test suites. This makes the tests read more about the services a page offers and what's being tested instead of the internals of the page. It also makes your tests much more maintainable. For example, if a developer changes an element ID, you only need make that change once--in the appropriate page object. ## How it works -Each page object is simply a Robot library that inherits from this package's base `Page` class. These library classes can work independently of Robot +Each page object you create is simply a Robot library that inherits from this package's base `Page` class. These library classes can work independently of Robot Framework, even though they ultimately inherit from Robot Framework's Selenium2Library. This allows you to encapsulate page logic Robot libraries, but use those libraries in any testing framework, including Python [unittest](https://docs.python.org/2/library/unittest.html) test cases. From d8aea6f80d9b91fbf97e892ec1f6581e32f1b62a Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 10:28:38 -0500 Subject: [PATCH 21/48] More content --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a56af51..1746983 100755 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ for locating injected content after page-load etc. The main point of using page objects is to factor out page implementation details (element locators, UI details etc.) from the actual test suites. This makes the tests read more about the services a page offers and what's being tested instead of the internals of the page. It also makes your tests much more maintainable. For example, if a developer changes an element ID, you only need make that change once--in the appropriate page object. ## How it works -Each page object you create is simply a Robot library that inherits from this package's base `Page` class. These library classes can work independently of Robot +Each page object you create is simply a Robot library that inherits from this package's base `Page` class. Since these classes are *plain old Python classes* they can work independently of Robot Framework, even though they ultimately inherit from Robot Framework's Selenium2Library. This allows you to encapsulate page logic Robot libraries, but use those libraries in any testing framework, including Python [unittest](https://docs.python.org/2/library/unittest.html) test cases. From 6f60c48fb5b3818ec5803379e8f061d4c02093b7 Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 10:29:45 -0500 Subject: [PATCH 22/48] More content --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1746983..d429591 100755 --- a/README.md +++ b/README.md @@ -23,9 +23,8 @@ The main point of using page objects is to factor out page implementation detail ## How it works Each page object you create is simply a Robot library that inherits from this package's base `Page` class. Since these classes are *plain old Python classes* they can work independently of Robot -Framework, even though they ultimately inherit from Robot Framework's Selenium2Library. This allows you to encapsulate page logic Robot libraries, but use those libraries in any testing framework, including -Python [unittest](https://docs.python.org/2/library/unittest.html) test cases. - +Framework, even though they ultimately inherit from Robot Framework's Selenium2Library. This allows you to encapsulate page logic in Robot libraries, but still leverage those classes +in any testing framework. ## Installing From 03668b660ad7d5403537f14a0cfd5dc01e2861c0 Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 10:42:02 -0500 Subject: [PATCH 23/48] More content --- README.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d429591..8e36922 100755 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This Python package adds support for the [Page Object](http://martinfowler.com/b package is a [Robot library](http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#extending-robot-framework), it's usable outside the Robot context and facilitates use of the page object pattern independently of any Python testing framework. This means you can use it to create page objects and run tests in other testing frameworks like unittest, -[lettuce](http://lettuce.it/tutorial/simple.html) etc. +[lettuce](http://lettuce.it/tutorial/simple.html) etc. In addition to providing a base `Page` class to build upon, this package provides many other conveniences somewhat independent of page object modeling including: @@ -18,6 +18,31 @@ for locating injected content after page-load etc. *or* [WebElements](http://selenium-python.readthedocs.org/en/latest/api.html#module-selenium.webdriver.remote.webelement) as parameters. - Much more... +The package doesn't force you to factor everything into page objects. Your test suites +can still benefit from the above features. Here's an example of a very minimally +abstracted page object, where we're using a page object assertion (`title_should_be`) +outside of the Robot framework. + + from robotpageobjects import Page + from unittest import TestCase + + + class MyPage(Page): + uri = "/some/path" + + class MyTestCase(TestCase): + def setUp(self): + self.page = Page() + self.page.open() + + def tearDown(self): + self.page.close() + + def test_title(self): + self.page.title_should_be("My Page") + +Of course this package really shines when you more robustly model your AUT. +We'll learn more about that later. ## More on page objects The main point of using page objects is to factor out page implementation details (element locators, UI details etc.) from the actual test suites. This makes the tests read more about the services a page offers and what's being tested instead of the internals of the page. It also makes your tests much more maintainable. For example, if a developer changes an element ID, you only need make that change once--in the appropriate page object. From 35ea99ae2cbeeaeb234d3c593a77e555c767adee Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 10:44:46 -0500 Subject: [PATCH 24/48] More content --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8e36922..e7da6e9 100755 --- a/README.md +++ b/README.md @@ -18,8 +18,11 @@ for locating injected content after page-load etc. *or* [WebElements](http://selenium-python.readthedocs.org/en/latest/api.html#module-selenium.webdriver.remote.webelement) as parameters. - Much more... -The package doesn't force you to factor everything into page objects. Your test suites -can still benefit from the above features. Here's an example of a very minimally +Like we said, the package is very flexible: it doesn't force you to use Robot, nor forces you +to heavy page object modeling. This is great for convicing your organization to move toward +BDD and page object development because you can approach those ideals iteratively. Even +with light modeling, and use of non-BDD framework, your test suites +can still benefit from the above listed features. Here's an example of a very minimally abstracted page object, where we're using a page object assertion (`title_should_be`) outside of the Robot framework. From 107d9e9e7f73d63f2d4aac7450a333025c1ab676 Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 10:45:09 -0500 Subject: [PATCH 25/48] More content --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e7da6e9..410ffa1 100755 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ for locating injected content after page-load etc. - Much more... Like we said, the package is very flexible: it doesn't force you to use Robot, nor forces you -to heavy page object modeling. This is great for convicing your organization to move toward +to do heavy page object modeling. This is great for convicing your organization to move toward BDD and page object development because you can approach those ideals iteratively. Even with light modeling, and use of non-BDD framework, your test suites can still benefit from the above listed features. Here's an example of a very minimally From 674dfe203ba1f3f483df48e905f15cc9091a067a Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 10:45:19 -0500 Subject: [PATCH 26/48] More content --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 410ffa1..510a479 100755 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ for locating injected content after page-load etc. - Much more... Like we said, the package is very flexible: it doesn't force you to use Robot, nor forces you -to do heavy page object modeling. This is great for convicing your organization to move toward +to do heavy page object modeling up front. This is great for convicing your organization to move toward BDD and page object development because you can approach those ideals iteratively. Even with light modeling, and use of non-BDD framework, your test suites can still benefit from the above listed features. Here's an example of a very minimally From b34399bc52ceff400542ab1ba915330d243c7ecd Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 10:46:29 -0500 Subject: [PATCH 27/48] More content --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 510a479..dc45d14 100755 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ page objects and run tests in other testing frameworks like [lettuce](http://lettuce.it/tutorial/simple.html) etc. In addition to providing a base `Page` class to build upon, this package provides -many other conveniences somewhat independent of page object modeling including: +many other conveniences apart from page object modeling including: - A hidden, yet accessible Selenium2 `driver` instance, which allows you to focus on the *application under test* (AUT) instead of Selenium2 implementation details. From 8dcdfb3b12c722953d8d4da2b4415b3cdff2e99b Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 10:46:57 -0500 Subject: [PATCH 28/48] More content --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dc45d14..9019982 100755 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ many other conveniences apart from page object modeling including: - A hidden, yet accessible Selenium2 `driver` instance, which allows you to focus on the *application under test* (AUT) instead of Selenium2 implementation details. -- Easy parameterization and normalization of testing variables, like the AUT's host, +- Easy parameterization, normalization, and setting of testing variables, like the AUT's host, the browser type to test with, [Sauce Labs](https://saucelabs.com/) integration, timeouts for locating injected content after page-load etc. - Convenient helper functions like `find_element`, `find_elements` that take [locators](http://rtomac.github.io/robotframework-selenium2library/doc/Selenium2Library.html#Locating%20elements) From 674bbf3f481e06f9a36b1c4cb309bb31641fbc57 Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 10:48:37 -0500 Subject: [PATCH 29/48] More content --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9019982..9f192bc 100755 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ the browser type to test with, [Sauce Labs](https://saucelabs.com/) integration, for locating injected content after page-load etc. - Convenient helper functions like `find_element`, `find_elements` that take [locators](http://rtomac.github.io/robotframework-selenium2library/doc/Selenium2Library.html#Locating%20elements) *or* [WebElements](http://selenium-python.readthedocs.org/en/latest/api.html#module-selenium.webdriver.remote.webelement) as parameters. +- Built-in and readable *assertion methods* on the page object. For example `location_should_be`, `title_should_be` etc. - Much more... Like we said, the package is very flexible: it doesn't force you to use Robot, nor forces you From 50cd82235e9d19cc2258001ba89ae918ef59cfe1 Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 10:49:08 -0500 Subject: [PATCH 30/48] More content --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9f192bc..2ef5dcd 100755 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ for locating injected content after page-load etc. Like we said, the package is very flexible: it doesn't force you to use Robot, nor forces you to do heavy page object modeling up front. This is great for convicing your organization to move toward BDD and page object development because you can approach those ideals iteratively. Even -with light modeling, and use of non-BDD framework, your test suites +with light modeling, and use of a non-BDD framework, your test suites can still benefit from the above listed features. Here's an example of a very minimally abstracted page object, where we're using a page object assertion (`title_should_be`) outside of the Robot framework. From d5a004301434e26a8c6d41e239b46d9048ed266a Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 10:52:35 -0500 Subject: [PATCH 31/48] More content --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2ef5dcd..a67c25b 100755 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ BDD and page object development because you can approach those ideals iterativel with light modeling, and use of a non-BDD framework, your test suites can still benefit from the above listed features. Here's an example of a very minimally abstracted page object, where we're using a page object assertion (`title_should_be`) -outside of the Robot framework. +outside of the Robot framework. `mytest.py` from robotpageobjects import Page from unittest import TestCase @@ -45,6 +45,12 @@ outside of the Robot framework. def test_title(self): self.page.title_should_be("My Page") +We could run this test on the default browser ([PhantomJs](http://phantomjs.org/)) like this: + + $ export PO_BASEURL=http://qa.mydomain.com + $ export PO_SELENIUM_SPEED=1 # Slow the whole test down for debugging + $ python mytest.py + Of course this package really shines when you more robustly model your AUT. We'll learn more about that later. ## More on page objects From dffd01a01eac9dc04010186e4cc9258e2ff8b748 Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 10:55:56 -0500 Subject: [PATCH 32/48] More content --- README.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a67c25b..eda3ad8 100755 --- a/README.md +++ b/README.md @@ -33,6 +33,9 @@ outside of the Robot framework. `mytest.py` class MyPage(Page): uri = "/some/path" + selectors = { + "the portlet": "xpath://some/complicated/xpath" + } class MyTestCase(TestCase): def setUp(self): @@ -45,14 +48,21 @@ outside of the Robot framework. `mytest.py` def test_title(self): self.page.title_should_be("My Page") + def test_portlet_renders(self): + self.page.element_should_be_visible("the portlet") + + We could run this test on the default browser ([PhantomJs](http://phantomjs.org/)) like this: $ export PO_BASEURL=http://qa.mydomain.com $ export PO_SELENIUM_SPEED=1 # Slow the whole test down for debugging $ python mytest.py -Of course this package really shines when you more robustly model your AUT. -We'll learn more about that later. +Notice, we did not factor out all page implementation details from the test itself. But +we still can leverage many of the package's features in our tests. If need to model the page +further nothing stops us from doing so later. +We'll learn more about that in a bit. + ## More on page objects The main point of using page objects is to factor out page implementation details (element locators, UI details etc.) from the actual test suites. This makes the tests read more about the services a page offers and what's being tested instead of the internals of the page. It also makes your tests much more maintainable. For example, if a developer changes an element ID, you only need make that change once--in the appropriate page object. From a8463c34367d76e95dfe83e74ac8f4de282acae0 Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 10:57:19 -0500 Subject: [PATCH 33/48] More content --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index eda3ad8..c5ada5c 100755 --- a/README.md +++ b/README.md @@ -59,9 +59,9 @@ We could run this test on the default browser ([PhantomJs](http://phantomjs.org/ $ python mytest.py Notice, we did not factor out all page implementation details from the test itself. But -we still can leverage many of the package's features in our tests. If need to model the page -further nothing stops us from doing so later. -We'll learn more about that in a bit. +we still can leverage many of the package's features in our tests. If we need to model the page +further, nothing stops us from doing so in the future. +We'll learn how to do this in a bit. ## More on page objects The main point of using page objects is to factor out page implementation details (element locators, UI details etc.) from the actual test suites. This makes the tests read more about the services a page offers and what's being tested instead of the internals of the page. It also makes your tests much more maintainable. For example, if a developer changes an element ID, you only need make that change once--in the appropriate page object. From 22d8c4c4fa81f4d21d14ec50d7c4efeff39b9466 Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 10:57:54 -0500 Subject: [PATCH 34/48] More content --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c5ada5c..fcb8a2a 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@ # Robot Framework Page Objects +## Installing + + $ pip install robotframework-pageobjects ## What it is This Python package adds support for the [Page Object](http://martinfowler.com/bliki/PageObject.html) pattern with [Robot Framework](http://robotframework.org/) and Robot Framework's [Selenium2Library](https://github.com/rtomac/robotframework-selenium2library). Though this package is a [Robot library](http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#extending-robot-framework), it's usable outside the Robot context and facilitates use of the page object pattern independently of any Python testing framework. This means you can use it to create @@ -71,10 +74,6 @@ Each page object you create is simply a Robot library that inherits from this pa Framework, even though they ultimately inherit from Robot Framework's Selenium2Library. This allows you to encapsulate page logic in Robot libraries, but still leverage those classes in any testing framework. -## Installing - - $ pip install robotframework-pageobjects - ## Demo From b02f675168db20579dee5d9afca93a7eca754f9b Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 12:29:07 -0500 Subject: [PATCH 35/48] More content --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fcb8a2a..81584fb 100755 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This Python package adds support for the [Page Object](http://martinfowler.com/bliki/PageObject.html) pattern with [Robot Framework](http://robotframework.org/) and Robot Framework's [Selenium2Library](https://github.com/rtomac/robotframework-selenium2library). Though this package is a [Robot library](http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#extending-robot-framework), it's usable outside the Robot context and facilitates use of the page object pattern independently of any Python testing framework. This means you can use it to create page objects and run tests in other testing frameworks like -unittest, +[`unittest`](http://docs.python.org/2/library/unittest.html), [lettuce](http://lettuce.it/tutorial/simple.html) etc. In addition to providing a base `Page` class to build upon, this package provides From 534a54250a3f5280ff5ef82099ffa029c5c72aed Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 13:11:00 -0500 Subject: [PATCH 36/48] More content --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 81584fb..8143ac8 100755 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ to do heavy page object modeling up front. This is great for convicing your orga BDD and page object development because you can approach those ideals iteratively. Even with light modeling, and use of a non-BDD framework, your test suites can still benefit from the above listed features. Here's an example of a very minimally -abstracted page object, where we're using a page object assertion (`title_should_be`) +abstracted page object, where we're using a few page object assertions (`title_should_be`, `element_should_be_visible`) outside of the Robot framework. `mytest.py` from robotpageobjects import Page From 5d6614be7e01904d5005691af8e4b64b12cf9115 Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 13:13:18 -0500 Subject: [PATCH 37/48] More content --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8143ac8..5c47bed 100755 --- a/README.md +++ b/README.md @@ -31,8 +31,7 @@ abstracted page object, where we're using a few page object assertions (`title_s outside of the Robot framework. `mytest.py` from robotpageobjects import Page - from unittest import TestCase - + import unittest class MyPage(Page): uri = "/some/path" @@ -40,7 +39,7 @@ outside of the Robot framework. `mytest.py` "the portlet": "xpath://some/complicated/xpath" } - class MyTestCase(TestCase): + class MyTestCase(unittest.TestCase): def setUp(self): self.page = Page() self.page.open() @@ -54,6 +53,8 @@ outside of the Robot framework. `mytest.py` def test_portlet_renders(self): self.page.element_should_be_visible("the portlet") + unittest.main() + We could run this test on the default browser ([PhantomJs](http://phantomjs.org/)) like this: From f33f293b753e91b2c3544572b77d90ce75745e68 Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 13:14:02 -0500 Subject: [PATCH 38/48] More content --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5c47bed..f11353f 100755 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ BDD and page object development because you can approach those ideals iterativel with light modeling, and use of a non-BDD framework, your test suites can still benefit from the above listed features. Here's an example of a very minimally abstracted page object, where we're using a few page object assertions (`title_should_be`, `element_should_be_visible`) -outside of the Robot framework. `mytest.py` +outside of the Robot framework. `mytest.py`: from robotpageobjects import Page import unittest From 992d68a081eb416548d255b4241f1eca1fe77dae Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 13:15:41 -0500 Subject: [PATCH 39/48] More content --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f11353f..03011b1 100755 --- a/README.md +++ b/README.md @@ -28,8 +28,8 @@ BDD and page object development because you can approach those ideals iterativel with light modeling, and use of a non-BDD framework, your test suites can still benefit from the above listed features. Here's an example of a very minimally abstracted page object, where we're using a few page object assertions (`title_should_be`, `element_should_be_visible`) -outside of the Robot framework. `mytest.py`: + # mytest.py from robotpageobjects import Page import unittest From f531feea43fb965baebb6eccb4258dd73e6d65f0 Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 13:15:56 -0500 Subject: [PATCH 40/48] More content --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 03011b1..edfef7b 100755 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ to do heavy page object modeling up front. This is great for convicing your orga BDD and page object development because you can approach those ideals iteratively. Even with light modeling, and use of a non-BDD framework, your test suites can still benefit from the above listed features. Here's an example of a very minimally -abstracted page object, where we're using a few page object assertions (`title_should_be`, `element_should_be_visible`) +abstracted page object, where we're using a few page object assertions (`title_should_be`, `element_should_be_visible`). # mytest.py from robotpageobjects import Page From d568cbbe417424e48ff50edf42c132d810d1826d Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 13:16:59 -0500 Subject: [PATCH 41/48] More content --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index edfef7b..6dc1b32 100755 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ We'll learn how to do this in a bit. The main point of using page objects is to factor out page implementation details (element locators, UI details etc.) from the actual test suites. This makes the tests read more about the services a page offers and what's being tested instead of the internals of the page. It also makes your tests much more maintainable. For example, if a developer changes an element ID, you only need make that change once--in the appropriate page object. ## How it works -Each page object you create is simply a Robot library that inherits from this package's base `Page` class. Since these classes are *plain old Python classes* they can work independently of Robot +Each page object you create is simply an object that inherits from this package's base `Page` class. Since these classes are *plain old Python classes* they can work independently of Robot Framework, even though they ultimately inherit from Robot Framework's Selenium2Library. This allows you to encapsulate page logic in Robot libraries, but still leverage those classes in any testing framework. From 33ac86022da7fde4ed03d764d16fcdd5844500c1 Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 13:18:37 -0500 Subject: [PATCH 42/48] More content --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6dc1b32..5321022 100755 --- a/README.md +++ b/README.md @@ -71,8 +71,8 @@ We'll learn how to do this in a bit. The main point of using page objects is to factor out page implementation details (element locators, UI details etc.) from the actual test suites. This makes the tests read more about the services a page offers and what's being tested instead of the internals of the page. It also makes your tests much more maintainable. For example, if a developer changes an element ID, you only need make that change once--in the appropriate page object. ## How it works -Each page object you create is simply an object that inherits from this package's base `Page` class. Since these classes are *plain old Python classes* they can work independently of Robot -Framework, even though they ultimately inherit from Robot Framework's Selenium2Library. This allows you to encapsulate page logic in Robot libraries, but still leverage those classes +Each page object you create is simply an object that inherits from this package's base `Page` class. In the context of a Robot test, the object is a Robot library. Since these classes are *plain old Python classes* they can work independently of Robot +Framework, even though they ultimately inherit their base methods from Robot Framework's Selenium2Library. This allows you to encapsulate page logic in Robot libraries, but still leverage those classes in any testing framework. From f48cf5dc96ef196133f36d3d054e8bed832c6a81 Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 13:19:17 -0500 Subject: [PATCH 43/48] More content --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 5321022..a347797 100755 --- a/README.md +++ b/README.md @@ -72,9 +72,7 @@ The main point of using page objects is to factor out page implementation detail ## How it works Each page object you create is simply an object that inherits from this package's base `Page` class. In the context of a Robot test, the object is a Robot library. Since these classes are *plain old Python classes* they can work independently of Robot -Framework, even though they ultimately inherit their base methods from Robot Framework's Selenium2Library. This allows you to encapsulate page logic in Robot libraries, but still leverage those classes -in any testing framework. - +Framework, even though they ultimately inherit their base methods from Robot Framework's Selenium2Library. This allows you to encapsulate page logic in Robot libraries, but still leverage those classes in any testing framework. ## Demo From 8df34272eb28afcd7fc356a09a008abbd9822a72 Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 13:22:33 -0500 Subject: [PATCH 44/48] More content --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a347797..3ffcdbd 100755 --- a/README.md +++ b/README.md @@ -56,9 +56,11 @@ abstracted page object, where we're using a few page object assertions (`title_s unittest.main() -We could run this test on the default browser ([PhantomJs](http://phantomjs.org/)) like this: +We could run this test on a local Firefox installation like so (you could, of course, +persist these settings using your `.bash_profile` file: $ export PO_BASEURL=http://qa.mydomain.com + $ export PO_BROWSER=firefox $ export PO_SELENIUM_SPEED=1 # Slow the whole test down for debugging $ python mytest.py From c4ed0b9a55e7c11d5643e04c42b2ea4c045931a2 Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 13:24:16 -0500 Subject: [PATCH 45/48] More content --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 3ffcdbd..d3e0921 100755 --- a/README.md +++ b/README.md @@ -2,6 +2,10 @@ ## Installing $ pip install robotframework-pageobjects +## Compatibility +Currently `Robot Framework Page Objects` is developed and tested on Linux systems only. +Windows compatibility is unknown and probably broken. Pull requests are welcome. + ## What it is This Python package adds support for the [Page Object](http://martinfowler.com/bliki/PageObject.html) pattern with [Robot Framework](http://robotframework.org/) and Robot Framework's [Selenium2Library](https://github.com/rtomac/robotframework-selenium2library). Though this package is a [Robot library](http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#extending-robot-framework), it's usable outside the Robot context and facilitates use of the page object pattern independently of any Python testing framework. This means you can use it to create From cb492676317ef546a95f968be04897483aef8dc2 Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 13:26:15 -0500 Subject: [PATCH 46/48] More content --- README.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index d3e0921..6699c19 100755 --- a/README.md +++ b/README.md @@ -205,19 +205,19 @@ The rest of this README explains many more details around writing page objects a Test-runs always require at least the setting of one option external to the test case: `baseurl`. Setting `baseurl` allows the page object to define its `uri` independent of the host. This allows you to easily run your tests on a dev/qa/production host without having to change your page object. You can set a default `baseurl` by setting a `baseurl` property on your page object class. The base `Page` class defines several other built-in options relevant whether using your page objects in Robot or plain, Python tests. These are: -- baseurl: The host for any tests you run. This facilitates test portability between different environments instead of hardcoding the test environment into the test. - -- browser : Default is phantomjs. Sets the type of browser used. Values can be: firefox, phantomjs (default). Eg: (ift-env) $ pybot -v browser:firefox mytest.robot, or any browser that Sauce Labs supports. - -- log_level : Default is "INFO". Sets the logging threshold for what's logged from the log method. Currently you have to set -L or --loglevel in Robot, not -vloglevel:LEVEL. See and Logging, Reporting & Debugging. -- sauce_apikey : The API key (password) for your [Sauce](http://www.saucelabs.com) account. Never hard-code this in anything, and never commit the repository. If you need to store it somewhere, store it as an environment variable. -- sauce_browserversion : The version of the sauce browser. Defaults to the latest available version for the given browser. -- sauce_device_orientation : Defaults to "portrait". For mobile devices, tells the page object what orientation to run the test in. -- sauce_platform : A platform Sauce Labs supports. -- sauce_username: The user name of your Sauce account. Never hard-code this in anything, and never commit the repository. If you need to store it somewhere, store it as an environment variable. -- selenium_implicit_wait : A global setting that sets the maximum time to wait before raising an ValueError. Default is 10 seconds. For example, for a call to click_element, Selenium will poll the page for the existence of the passed element at an interval of 200 ms until 10 seconds before raising an ElementNotFoundException. -- selenium_speed : The time in seconds between each Selenium API call issued. This should only be used for debugging to slow down your tests so you can see what the browser is doing. Default is 0 seconds. eg. $ pybot -v selenium_speed:1 mytest.robot -- service_args : Additional command-line arguments (such as "--ignore-ssl-errors=yes") to pass to the browser (any browser) when it is run. Arguments are space-separated. Example: PO_SERVICE_ARGS="--ignore-ssl-errors=yes --ssl-protocol=TLSv1" python mytest.py +- `baseurl`: The host for any tests you run. This facilitates test portability between different environments instead of hardcoding the test environment into the test. + +- `browser` : Default is phantomjs. Sets the type of browser used. Values can be: firefox, phantomjs (default). Eg: (ift-env) $ pybot -v browser:firefox mytest.robot, or any browser that Sauce Labs supports. + +- `log_level` : Default is "INFO". Sets the logging threshold for what's logged from the log method. Currently you have to set -L or --loglevel in Robot, not -vloglevel:LEVEL. See and Logging, Reporting & Debugging. +- `sauce_apikey` : The API key (password) for your [Sauce](http://www.saucelabs.com) account. Never hard-code this in anything, and never commit the repository. If you need to store it somewhere, store it as an environment variable. +- `sauce_browserversion` : The version of the sauce browser. Defaults to the latest available version for the given browser. +- `sauce_device_orientation` : Defaults to "portrait". For mobile devices, tells the page object what orientation to run the test in. +- `sauce_platform` : A platform Sauce Labs supports. +- `sauce_username`: The user name of your Sauce account. Never hard-code this in anything, and never commit the repository. If you need to store it somewhere, store it as an environment variable. +- `selenium_implicit_wait` : A global setting that sets the maximum time to wait before raising an ValueError. Default is 10 seconds. For example, for a call to click_element, Selenium will poll the page for the existence of the passed element at an interval of 200 ms until 10 seconds before raising an ElementNotFoundException. +- `selenium_speed` : The time in seconds between each Selenium API call issued. This should only be used for debugging to slow down your tests so you can see what the browser is doing. Default is 0 seconds. eg. $ pybot -v selenium_speed:1 mytest.robot +- `service_args` : Additional command-line arguments (such as "--ignore-ssl-errors=yes") to pass to the browser (any browser) when it is run. Arguments are space-separated. Example: PO_SERVICE_ARGS="--ignore-ssl-errors=yes --ssl-protocol=TLSv1" python mytest.py Once set, these option values are available as attributes on the page object. For example, self.baseurl. From f34f6a7d60ad226fabfe39e9615305f9e353320c Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 13:29:02 -0500 Subject: [PATCH 47/48] More content --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6699c19..bcdb62f 100755 --- a/README.md +++ b/README.md @@ -203,7 +203,8 @@ The rest of this README explains many more details around writing page objects a ### Built-in options for `Page` -Test-runs always require at least the setting of one option external to the test case: `baseurl`. Setting `baseurl` allows the page object to define its `uri` independent of the host. This allows you to easily run your tests on a dev/qa/production host without having to change your page object. You can set a default `baseurl` by setting a `baseurl` property on your page object class. The base `Page` class defines several other built-in options relevant whether using your page objects in Robot or plain, Python tests. These are: +Test-runs always require at least the setting of one option external to the test case: `baseurl`. Setting `baseurl` allows the page object to define its `uri` independent of the host. This allows you to easily run your tests on a dev/qa/production host without having to change your page object. You can set a default `baseurl` by setting a `baseurl` property on your page object class. The base `Page` class defines several other built-in options relevant whether using your page objects in Robot or plain, Python tests. **Note**: Sauce option values +like `sauce_platform` etc. can be gotten from Sauce's [configuration app](https://docs.saucelabs.com/reference/platforms-configurator/?_ga=1.167969697.126382613.1414715829#/). These are: - `baseurl`: The host for any tests you run. This facilitates test portability between different environments instead of hardcoding the test environment into the test. From d599e0c04ecd7bb075c1603f0ff518c442b9d83b Mon Sep 17 00:00:00 2001 From: cohenaa Date: Mon, 9 Feb 2015 13:29:28 -0500 Subject: [PATCH 48/48] More content --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bcdb62f..d75308e 100755 --- a/README.md +++ b/README.md @@ -204,7 +204,7 @@ The rest of this README explains many more details around writing page objects a ### Built-in options for `Page` Test-runs always require at least the setting of one option external to the test case: `baseurl`. Setting `baseurl` allows the page object to define its `uri` independent of the host. This allows you to easily run your tests on a dev/qa/production host without having to change your page object. You can set a default `baseurl` by setting a `baseurl` property on your page object class. The base `Page` class defines several other built-in options relevant whether using your page objects in Robot or plain, Python tests. **Note**: Sauce option values -like `sauce_platform` etc. can be gotten from Sauce's [configuration app](https://docs.saucelabs.com/reference/platforms-configurator/?_ga=1.167969697.126382613.1414715829#/). These are: +like `sauce_platform` etc. can be gotten from Sauce's [configuration app](https://docs.saucelabs.com/reference/platforms-configurator/?_ga=1.167969697.126382613.1414715829#/). The bult-in options are: - `baseurl`: The host for any tests you run. This facilitates test portability between different environments instead of hardcoding the test environment into the test.