Class: LearnTest::Dependencies::SeleniumServer

Inherits:
LearnTest::Dependency show all
Defined in:
lib/learn_test/dependencies/selenium_server.rb

Instance Attribute Summary

Attributes inherited from LearnTest::Dependency

#options

Instance Method Summary collapse

Methods inherited from LearnTest::Dependency

#execute, #initialize, #mac?, #print_installing, #run_install, #win?

Constructor Details

This class inherits a constructor from LearnTest::Dependency

Instance Method Details

#die(message) ⇒ Object



29
30
31
32
# File 'lib/learn_test/dependencies/selenium_server.rb', line 29

def die(message)
  puts message
  exit
end

#installObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/learn_test/dependencies/selenium_server.rb', line 14

def install
  if win?
    brew = false
  else
    brew = `which brew`
  end

  if brew.empty? || brew.match(/not found/i)
    die('Please install Selenium Server Standalone'.red)
  else
    print_installing('Selenium Server Standalone')
    run_install('brew install selenium-server-standalone')
  end
end

#missing?Boolean

Returns:

  • (Boolean)


4
5
6
7
8
9
10
11
12
# File 'lib/learn_test/dependencies/selenium_server.rb', line 4

def missing?
  if win?
    selenium = `where selenium-server`
  else
    selenium = `which selenium-server`
  end

  selenium.empty? || selenium.match(/not found/i)
end