-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test define_page_methods and require_all_pages
- Loading branch information
1 parent
83a4d30
commit 1e190f2
Showing
6 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# http://localhost:8081/#/form | ||
module Page | ||
class LocalPage | ||
include PageObject | ||
|
||
page_url 'http://localhost:8081/#/form' | ||
element(:greet_button) { element(by.binding('greet')) } | ||
|
||
# alternatively just use the symbol name | ||
element(:greet_button2, binding: 'greet') | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
require_relative 'spec_helper' | ||
|
||
describe 'page object' do | ||
it 'finds by custom protractor locator' do | ||
local_page.goto | ||
element(by.binding('greet')).present? # protractor locator can be used directly | ||
local_page.greet_button? # or inside a page object via block | ||
local_page.greet_button2? # or inside a page object via symbol | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters