-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathspec_helper.rb
executable file
·54 lines (47 loc) · 1.25 KB
/
spec_helper.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
require 'capybara/rspec'
require 'fileutils'
require 'net/http'
require 'ruby_aem'
require 'yaml'
require 'capybara/poltergeist'
def read_config
YAML.load_file('conf.yaml')
end
def init_author_client(conf)
RubyAem::Aem.new(
username: conf['username'] || 'admin',
password: conf['password'] || 'admin',
protocol: conf['protocol'] || 'http',
host: conf['host'] || 'localhost',
port: conf['port'] ? conf['port'].to_i : 4502,
debug: conf['debug'] ? conf['debug'] == true : false
)
end
def init_publish_client(conf)
RubyAem::Aem.new(
username: conf['username'] || 'admin',
password: conf['password'] || 'admin',
protocol: conf['protocol'] || 'http',
host: conf['host'] || 'localhost',
port: conf['port'] ? conf['port'].to_i : 4503,
debug: conf['debug'] ? conf['debug'] == true : false
)
end
def init_web_client(conf)
Capybara.register_driver :poltergeist do |app|
Capybara::Poltergeist::Driver.new(app, js_errors: false)
end
Capybara.current_driver = :poltergeist
Capybara.app_host = "#{conf['protocol']}://#{conf['host']}:#{conf['port']}"
end
def retry_opts
{
_retries: {
max_tries: 120,
base_sleep_seconds: 10,
max_sleep_seconds: 10
}
}
end
def result_handler(results)
end