cbthelper 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +0 -0
- data/Gemfile.lock +5 -5
- data/LICENSE.txt +0 -0
- data/README.md +0 -0
- data/Rakefile +0 -0
- data/cbthelper.gemspec +2 -2
- data/example.rb +85 -0
- data/lib/.DS_Store +0 -0
- data/lib/cbthelper.rb +0 -0
- data/lib/cbthelper/.DS_Store +0 -0
- data/lib/cbthelper/AutomatedTest.rb +0 -0
- data/lib/cbthelper/CapsBuilder.rb +0 -0
- data/lib/cbthelper/Snapshot.rb +0 -0
- data/lib/cbthelper/TestHistoryBuilder.rb +0 -0
- data/lib/cbthelper/Video.rb +0 -0
- data/lib/cbthelper/version.rb +1 -1
- metadata +8 -10
- data/.DS_Store +0 -0
- data/.gitignore +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61c9ba995c9bb5f09f649ccc1f326f4a40caa364278edbdbe978eb946e005c42
|
4
|
+
data.tar.gz: ee25907bf9e353d072e76071d8695b7d12b4e5dbb7aa2384abdd379fd19ef66a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5183dec97173b33a92f8ff7f9b4150740918f434f6d6b843b2a961812f5d3d53e631f0e17fd0abe518962c008cd2e1ea28b3ae9312f0a5d17ca4cdc3ec721dd7
|
7
|
+
data.tar.gz: f3e024c7c6bc31fd87822d61b017c276a6c3c47854084b7dd235c9453bb4ee19584aee611141f3671d1b7c9b712790af83fe423a0ef863cb463fadbd051a46b8
|
data/Gemfile
CHANGED
File without changes
|
data/Gemfile.lock
CHANGED
@@ -1,20 +1,20 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cbthelper (1.0.
|
4
|
+
cbthelper (1.0.1)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
rake (
|
9
|
+
rake (13.0.1)
|
10
10
|
|
11
11
|
PLATFORMS
|
12
12
|
ruby
|
13
13
|
|
14
14
|
DEPENDENCIES
|
15
|
-
bundler (~> 1.
|
15
|
+
bundler (~> 2.1.0)
|
16
16
|
cbthelper!
|
17
|
-
rake (~>
|
17
|
+
rake (~> 13.0)
|
18
18
|
|
19
19
|
BUNDLED WITH
|
20
|
-
1.
|
20
|
+
2.1.4
|
data/LICENSE.txt
CHANGED
File without changes
|
data/README.md
CHANGED
File without changes
|
data/Rakefile
CHANGED
File without changes
|
data/cbthelper.gemspec
CHANGED
@@ -24,6 +24,6 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
25
25
|
spec.require_paths = ["lib"]
|
26
26
|
|
27
|
-
spec.add_development_dependency "bundler", "~> 1.
|
28
|
-
spec.add_development_dependency "rake", "~>
|
27
|
+
spec.add_development_dependency "bundler", "~> 2.1.0"
|
28
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
29
29
|
end
|
data/example.rb
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
require "cbthelper"
|
2
|
+
|
3
|
+
#Set username and auth key for api requests
|
4
|
+
#Be sure to use %40 instead of @
|
5
|
+
|
6
|
+
username = "YOUR_USERNAME"
|
7
|
+
authkey = "YOUR_AUTHKEY"
|
8
|
+
|
9
|
+
|
10
|
+
Cbthelper.login(username, authkey)
|
11
|
+
|
12
|
+
#Build caps
|
13
|
+
caps = Cbthelper.getCapsBuilder()
|
14
|
+
.withPlatform("Windows 10")
|
15
|
+
.withBrowserApiName("Chrome68")
|
16
|
+
.withResolution(1024, 768)
|
17
|
+
.withName("cbthelper test")
|
18
|
+
.withBuild("0.0.1")
|
19
|
+
.withRecordNetwork(false)
|
20
|
+
.withRecordVideo(true)
|
21
|
+
.build()
|
22
|
+
|
23
|
+
|
24
|
+
#wrapped in a begin rescue to ensure proper ending of test
|
25
|
+
begin
|
26
|
+
driver = Selenium::WebDriver.for(:remote, :url => "http://#{Cbthelper.username}:#{Cbthelper.authkey}@hub.crossbrowsertesting.com:80/wd/hub", :desired_capabilities => caps)
|
27
|
+
driver.manage.timeouts.implicit_wait = 20
|
28
|
+
|
29
|
+
# Initialize an AutomatedTest object with the selenium session id
|
30
|
+
myTest = Cbthelper.getTestFromId(driver.session_id)
|
31
|
+
video = myTest.RecordingVideo
|
32
|
+
video.setDescription("google")
|
33
|
+
driver.navigate.to("http://google.com")
|
34
|
+
driver.manage.timeouts.implicit_wait = 2
|
35
|
+
|
36
|
+
# Easily take a snapshot
|
37
|
+
googleSnap = myTest.takeSnapshot
|
38
|
+
|
39
|
+
# Easily set snapshot description
|
40
|
+
googleSnap.setDescription("testsnap")
|
41
|
+
|
42
|
+
# Save the snapshot locally
|
43
|
+
googleSnap.saveSnapshot("test/testsnap1.png")
|
44
|
+
|
45
|
+
driver.navigate.to("http://crossbrowsertesting.com")
|
46
|
+
driver.manage.timeouts.implicit_wait = 2
|
47
|
+
|
48
|
+
#Take snapshot and set description with one call
|
49
|
+
myTest.takeSnapshot("cbtsnap")
|
50
|
+
|
51
|
+
|
52
|
+
#downloads every snapshot for a given test and saves them in a directory
|
53
|
+
#can set useDescription to name the images what we set as the description
|
54
|
+
#alternatively can set a prefix (default 'image') and images will be indexed
|
55
|
+
|
56
|
+
myTest.saveAllSnapshots("test/newfolder", useDescription=true)
|
57
|
+
|
58
|
+
#Sets test score
|
59
|
+
myTest.setScore("pass")
|
60
|
+
|
61
|
+
#Sends a request to our api to stop the test
|
62
|
+
myTest.stop
|
63
|
+
|
64
|
+
driver.quit()
|
65
|
+
|
66
|
+
video.saveVideo("test/video.mp4")
|
67
|
+
|
68
|
+
#Our test history api call takes a lot of optional parameters
|
69
|
+
#The builder makes it easier to get what you want
|
70
|
+
options = Cbthelper.getTestHistoryBuilder()
|
71
|
+
.withLimit(1)
|
72
|
+
.withName('cbthelper testy')
|
73
|
+
.build
|
74
|
+
puts options
|
75
|
+
|
76
|
+
#Grab our history using the options we created above
|
77
|
+
history = Cbthelper.getTestHistory(options)
|
78
|
+
puts history["selenium"]
|
79
|
+
|
80
|
+
#Handles any exception, print the error, and quits the driver
|
81
|
+
rescue Exception => e
|
82
|
+
puts e.message
|
83
|
+
puts e.backtrace.inspect
|
84
|
+
driver.quit()
|
85
|
+
end
|
data/lib/.DS_Store
CHANGED
Binary file
|
data/lib/cbthelper.rb
CHANGED
File without changes
|
data/lib/cbthelper/.DS_Store
CHANGED
File without changes
|
File without changes
|
File without changes
|
data/lib/cbthelper/Snapshot.rb
CHANGED
File without changes
|
File without changes
|
data/lib/cbthelper/Video.rb
CHANGED
File without changes
|
data/lib/cbthelper/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cbthelper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daphne Magsby
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.1.0
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 2.1.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '13.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '13.0'
|
41
41
|
description: cbthelper wraps CrossBrowserTesting's (https://crossbrowsertesting.com/apidocs/v3/selenium.html)
|
42
42
|
into an easy to use library.
|
43
43
|
email:
|
@@ -46,8 +46,6 @@ executables: []
|
|
46
46
|
extensions: []
|
47
47
|
extra_rdoc_files: []
|
48
48
|
files:
|
49
|
-
- ".DS_Store"
|
50
|
-
- ".gitignore"
|
51
49
|
- Gemfile
|
52
50
|
- Gemfile.lock
|
53
51
|
- LICENSE.txt
|
@@ -56,6 +54,7 @@ files:
|
|
56
54
|
- bin/console
|
57
55
|
- bin/setup
|
58
56
|
- cbthelper.gemspec
|
57
|
+
- example.rb
|
59
58
|
- lib/.DS_Store
|
60
59
|
- lib/cbthelper.rb
|
61
60
|
- lib/cbthelper/.DS_Store
|
@@ -86,8 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
86
85
|
- !ruby/object:Gem::Version
|
87
86
|
version: '0'
|
88
87
|
requirements: []
|
89
|
-
|
90
|
-
rubygems_version: 2.7.7
|
88
|
+
rubygems_version: 3.0.3
|
91
89
|
signing_key:
|
92
90
|
specification_version: 4
|
93
91
|
summary: cbthelper
|
data/.DS_Store
DELETED
Binary file
|