omniture_test 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/.rspec +1 -0
- data/Gemfile +4 -0
- data/README.md +1 -0
- data/Rakefile +2 -0
- data/bin/omniture_test +12 -0
- data/lib/omniture_test/version.rb +3 -0
- data/lib/omniture_test.rb +7 -0
- data/omniture_test.gemspec +21 -0
- data/spec/omniture_spec.rb +55 -0
- data/spec/spec_helper.rb +6 -0
- data/targets.sample.yml +11 -0
- metadata +106 -0
data/.gitignore
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color -f documentation
|
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
NAME HERE
|
data/Rakefile
ADDED
data/bin/omniture_test
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
#!/bin/ruby
|
2
|
+
|
3
|
+
require 'rake'
|
4
|
+
require 'rspec/core/rake_task'
|
5
|
+
require 'omniture_test'
|
6
|
+
|
7
|
+
RSpec::Core::RakeTask.new do |t|
|
8
|
+
t.rspec_opts = '--color -f documentation'
|
9
|
+
t.pattern = "#{ENV['OMNITURE_TEST_PATH']}/spec/**/*_spec.rb"
|
10
|
+
end
|
11
|
+
|
12
|
+
Rake.application['spec'].invoke
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/omniture_test/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["rdecunrex"]
|
6
|
+
gem.email = ["rdecurnex@despegar.com"]
|
7
|
+
gem.description = %q{Rspec Test for Omniture Integrations}
|
8
|
+
gem.summary = %q{Rspec Test for Omniture Integrations}
|
9
|
+
gem.homepage = ""
|
10
|
+
|
11
|
+
gem.files = `git ls-files`.split($\)
|
12
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
13
|
+
gem.test_files = []
|
14
|
+
gem.name = "omniture_test"
|
15
|
+
gem.require_paths = ["lib"]
|
16
|
+
gem.version = OmnitureTest::VERSION
|
17
|
+
|
18
|
+
gem.add_dependency 'rake'
|
19
|
+
gem.add_dependency 'rspec'
|
20
|
+
gem.add_dependency 'watir-webdriver'
|
21
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
require_relative 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Omniture' do
|
4
|
+
|
5
|
+
before :each do
|
6
|
+
$browser = Watir::Browser.new :ff
|
7
|
+
end
|
8
|
+
|
9
|
+
after :each do
|
10
|
+
$browser.close
|
11
|
+
end
|
12
|
+
|
13
|
+
$targets.each do |target|
|
14
|
+
|
15
|
+
describe "at #{target['url']}" do
|
16
|
+
|
17
|
+
before :each do
|
18
|
+
$browser.goto(target['url'])
|
19
|
+
|
20
|
+
target['cookies'].each do |key, value|
|
21
|
+
$browser.cookies.add(key, value)
|
22
|
+
end
|
23
|
+
|
24
|
+
$browser.goto(target['url'])
|
25
|
+
|
26
|
+
$browser.execute_script(%q{window.open("","dp_debugger","width=600,height=600,location=0,menubar=0,status=1,toolbar=0,resizable=1,scrollbars=1").document.write("<script language=\"JavaScript\" id=dbg src=\"http://www.digitalpulse.omniture.com/dp/debugger.js\"></script>")})
|
27
|
+
|
28
|
+
$browser.windows.last.use
|
29
|
+
|
30
|
+
@debug_tables = $browser.tables(:class => 'debugtable')
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'should send the expected variables/values' do
|
34
|
+
@debug_tables.each do |table|
|
35
|
+
selected_trs = table.trs.select do |tr|
|
36
|
+
target['omniture_variables'].keys.include? tr.tds.first.text
|
37
|
+
end
|
38
|
+
|
39
|
+
sent_variables = selected_trs.collect { |tr| tr.tds.first.text }
|
40
|
+
|
41
|
+
target['omniture_variables'].keys.each do |target_omniture_variable|
|
42
|
+
sent_variables.should include(target_omniture_variable)
|
43
|
+
end
|
44
|
+
|
45
|
+
selected_trs.collect.each do |tr|
|
46
|
+
tr.tds.last.text.should == target['omniture_variables'][tr.tds.first.text]
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
data/spec/spec_helper.rb
ADDED
data/targets.sample.yml
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
targets:
|
2
|
+
- cookies:
|
3
|
+
"X-COOKIE-KEY": "VALUE"
|
4
|
+
url: "http://example.com/something_here"
|
5
|
+
omniture_variables:
|
6
|
+
"VARIABLE_NAME": "VARIABLE_VALUE"
|
7
|
+
- cookies:
|
8
|
+
"X-COOKIE-KEY": "VALUE"
|
9
|
+
url: "http://example.com/something_here"
|
10
|
+
omniture_variables:
|
11
|
+
"VARIABLE_NAME": "VARIABLE_VALUE"
|
metadata
ADDED
@@ -0,0 +1,106 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: omniture_test
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- rdecunrex
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-07-27 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rake
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rspec
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: watir-webdriver
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
description: Rspec Test for Omniture Integrations
|
63
|
+
email:
|
64
|
+
- rdecurnex@despegar.com
|
65
|
+
executables:
|
66
|
+
- omniture_test
|
67
|
+
extensions: []
|
68
|
+
extra_rdoc_files: []
|
69
|
+
files:
|
70
|
+
- .gitignore
|
71
|
+
- .rspec
|
72
|
+
- Gemfile
|
73
|
+
- README.md
|
74
|
+
- Rakefile
|
75
|
+
- bin/omniture_test
|
76
|
+
- lib/omniture_test.rb
|
77
|
+
- lib/omniture_test/version.rb
|
78
|
+
- omniture_test.gemspec
|
79
|
+
- spec/omniture_spec.rb
|
80
|
+
- spec/spec_helper.rb
|
81
|
+
- targets.sample.yml
|
82
|
+
homepage: ''
|
83
|
+
licenses: []
|
84
|
+
post_install_message:
|
85
|
+
rdoc_options: []
|
86
|
+
require_paths:
|
87
|
+
- lib
|
88
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
|
+
none: false
|
96
|
+
requirements:
|
97
|
+
- - ! '>='
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '0'
|
100
|
+
requirements: []
|
101
|
+
rubyforge_project:
|
102
|
+
rubygems_version: 1.8.24
|
103
|
+
signing_key:
|
104
|
+
specification_version: 3
|
105
|
+
summary: Rspec Test for Omniture Integrations
|
106
|
+
test_files: []
|