Skip to content

Commit

Permalink
Test getLocationAbsUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
bootstraponline committed May 21, 2015
1 parent b6ebe5d commit b30e006
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/angular_webdriver/protractor/protractor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def setLocation url
# @example
# browser.get('http://angular.github.io/protractor/#/api');
# expect(browser.getLocationAbsUrl())
# .toBe('http://angular.github.io/protractor/#/api');
# .toBe('/api');
#
def getLocationAbsUrl
waitForAngular
Expand Down
7 changes: 6 additions & 1 deletion notes/protractor_cli_bugs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,9 @@ Trace



doesn't sync on goForward or goBackward ?
doesn't sync on goForward or goBackward ?


docs for getLocationAbsUrl are wrong. it returns
'/api' not 'http://angular.github.io/protractor/#/api' when on
'http://angular.github.io/protractor/#/api'
14 changes: 12 additions & 2 deletions spec/protractor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
After each test the page is reset and ignore_sync is set to false. (rspec before)
Protractor CLI
browser.get('http://localhost:8081/#/')
browser.setLocation('async')
.exit
Expand Down Expand Up @@ -99,7 +101,6 @@ def angular_not_found_error
=begin
todo: write tests for:
getLocationAbsUrl
initialize
sync
waitForAngular
Expand All @@ -122,12 +123,21 @@ def angular_not_found_error

protractor.setLocation 'polling'

actual = driver.current_url
actual = driver.current_url
expected = 'http://localhost:8081/#/polling'

expect(actual).to eq(expected)
end

it 'getLocationAbsUrl' do
visit 'async'

actual = protractor.getLocationAbsUrl
expected = '/async'

expect(actual).to eq(expected)
end

it 'finds by bindings' do
visit 'async'

Expand Down

0 comments on commit b30e006

Please sign in to comment.