=begin

Copyright 2012-2013 inBloom, Inc. and its affiliates.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

=end

require_relative '../../simple_idp/step_definitions/MockIDP_steps.rb'

###############################################################################
# WHEN WHEN WHEN WHEN WHEN WHEN WHEN WHEN WHEN WHEN WHEN WHEN WHEN WHEN WHEN
###############################################################################

When /^I click and go back to Home$/ do
  assertWithWait("Failed to find 'Home' Link on page")  {@driver.find_element(:link_text, "data browser")}
  @driver.find_element(:link_text, "data browser").click
  assertWithWait("Failed to be directed to Databrowser's Home page")  {@driver.page_source.include?("Listing Home")}
end

Then /^I log out of Databrowser$/ do
    steps %Q{
      Then I click on log out
    }
end
###############################################################################
# THEN THEN THEN THEN THEN THEN THEN THEN THEN THEN THEN THEN THEN THEN THEN
###############################################################################

Then /^I am notified that "([^\"]*)"$/ do |message|
  assertText(message)
end

=begin

Copyright 2012-2013 inBloom, Inc. and its affiliates.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

=end

require_relative '../../simple_idp/step_definitions/MockIDP_steps.rb'

###############################################################################
# WHEN WHEN WHEN WHEN WHEN WHEN WHEN WHEN WHEN WHEN WHEN WHEN WHEN WHEN WHEN
###############################################################################

When /^I click and go back to Home$/ do
  assertWithWait("Failed to find 'Home' Link on page")  {@driver.find_element(:link_text, "data browser")}
  @driver.find_element(:link_text, "data browser").click
  assertWithWait("Failed to be directed to Databrowser's Home page")  {@driver.page_source.include?("Listing Home")}
end

Then /^I log out of Databrowser$/ do
if RUN_ON_RC
    steps %Q{
      Then I click on log out
    }
  else
    steps %Q{
      When I click on the logout link 
   }
  end
end
###############################################################################
# THEN THEN THEN THEN THEN THEN THEN THEN THEN THEN THEN THEN THEN THEN THEN
###############################################################################

Then /^I am notified that "([^\"]*)"$/ do |message|
  assertText(message)
end

Revert "my attempt to fix e2e_sandbox test"
Revert "my attempt to fix e2e_sandbox test"

This reverts commit 8db3d9d25a1ad55080a15d0ba6a40c5287164482.
