Automating Google Workspace (GWS) & more with Apps Script
Page-objects-pattern
1. AMIR BARYLKO
PAGE OBJECTS
PATTERN
WINNIPEG RUBY USER GROUP
FEB 2012
Amir Barylko - Page Objects MavenThought Inc.
2. WHO AM I?
• Architect
• Developer
• Mentor
• Great cook
• The one who’s entertaining you for the next hour!
Amir Barylko - Page Objects MavenThought Inc.
4. WHAT’S THE POINT?
• Flush out requirements
• Drive development
• Traceability
• Documentation
• ????
Amir Barylko - Page Objects MavenThought Inc.
5. WHO CARES?
• The Stakeholders
• The Developers
• QAs
• BAs
• Etc
Amir Barylko - Page Objects MavenThought Inc.
6. WHAT’S THE PROBLEM?
• New approach
• It’s quite a bit of effort
• Classic roles may clash
• The whole team needs to buy in
• Implementation changes may imply test changes
Amir Barylko - Page Objects MavenThought Inc.
8. FEATURES
Feature: Listing projects
As a user
I Want to see the list of projects
So I can choose one to see the details
Scenario: List all projects
Given I'm logged in
And I have some projects loaded
When I go to the projects page
Then I should the complete list of projects
Amir Barylko - Page Objects MavenThought Inc.
9. STEPS
When /^I have some projects loaded$/ do
# setup the projects you have
end
Then /^I should have the complete list of projects$/ do
# some cool ruby code here to
# verify that what you are seeing is what you
# actually have in the database
end
Amir Barylko - Page Objects MavenThought Inc.
10. COMMON STRUCTURE
Step Cucumber Implementation
Arrange Given I have.... Put some stuff in the DB
Click, enter values,
Act When I do this...
more clicking
Assert Then I should see... DB == HTML?
Amir Barylko - Page Objects MavenThought Inc.
11. LOOK MA! NO TAGS!
• How to avoid brittle tests?
• What do we do in general when coding?
• Reusability.... perhaps?
• Less coupling, maybe?
• How? Where?
Amir Barylko - Page Objects MavenThought Inc.
12. LOOK MA! NO SLIDES!
unless boring || stef.still_talking? do
demo()
end
Amir Barylko - Page Objects MavenThought Inc.