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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 161f8104cb47450096f365dea539df6f962a6563bc8325b6150b5ce7d89481ea
4
- data.tar.gz: 5d04fa37f9a50b45caf54f7a4bb90f4e8c8eafbd621bbc7ff2bcc0adaec6304e
3
+ metadata.gz: 61c9ba995c9bb5f09f649ccc1f326f4a40caa364278edbdbe978eb946e005c42
4
+ data.tar.gz: ee25907bf9e353d072e76071d8695b7d12b4e5dbb7aa2384abdd379fd19ef66a
5
5
  SHA512:
6
- metadata.gz: '067458e98a2b601beac02fc495b234daa2463d103375570e8a90cb9dae467844614b94a29182f255818aa7f2a75cc9bb6bcd53927054d242779158796146a15c'
7
- data.tar.gz: e3c5e0ae30ab7032ec4731c71af4c174aad0dbb016e8f1844da3ec93a0bc9d1524fbcbf61c9320eb0b0cb83beb1a998638a0fcb9be409f15cef27d416129cc97
6
+ metadata.gz: 5183dec97173b33a92f8ff7f9b4150740918f434f6d6b843b2a961812f5d3d53e631f0e17fd0abe518962c008cd2e1ea28b3ae9312f0a5d17ca4cdc3ec721dd7
7
+ data.tar.gz: f3e024c7c6bc31fd87822d61b017c276a6c3c47854084b7dd235c9453bb4ee19584aee611141f3671d1b7c9b712790af83fe423a0ef863cb463fadbd051a46b8
data/Gemfile CHANGED
File without changes
@@ -1,20 +1,20 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cbthelper (1.0.0)
4
+ cbthelper (1.0.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- rake (10.5.0)
9
+ rake (13.0.1)
10
10
 
11
11
  PLATFORMS
12
12
  ruby
13
13
 
14
14
  DEPENDENCIES
15
- bundler (~> 1.16)
15
+ bundler (~> 2.1.0)
16
16
  cbthelper!
17
- rake (~> 10.0)
17
+ rake (~> 13.0)
18
18
 
19
19
  BUNDLED WITH
20
- 1.16.6
20
+ 2.1.4
File without changes
data/README.md CHANGED
File without changes
data/Rakefile CHANGED
File without changes
@@ -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.16"
28
- spec.add_development_dependency "rake", "~> 10.0"
27
+ spec.add_development_dependency "bundler", "~> 2.1.0"
28
+ spec.add_development_dependency "rake", "~> 13.0"
29
29
  end
@@ -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
Binary file
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,3 +1,3 @@
1
1
  module Cbthelper
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
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.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: 2018-11-05 00:00:00.000000000 Z
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: '1.16'
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: '1.16'
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: '10.0'
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: '10.0'
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
- rubyforge_project:
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
data/.gitignore DELETED
@@ -1,9 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
9
- *.gem