generic_test 0.1.12 → 0.1.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +5 -0
- data/lib/generic_test.rb +2 -0
- data/lib/generic_test/setup.rb +2 -0
- data/lib/generic_test/version.rb +1 -1
- data/spec/generic_test_spec.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7fd4592cd7c34e39ae05d9db02ea20dd6ca739f368851db22dac04168504ec1
|
4
|
+
data.tar.gz: fb55093d314dfc89e13d0ec4342317106d6caef89dcd9e7341c42c79a59f464b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5ec80dd8977f15b6ffc3a66cec286a2183da371a10eb4d4428ff0f607d849e818bc303ffa96c3295e9ba787f7dcf092e95d64729318dcd357ee390937ec9680
|
7
|
+
data.tar.gz: 92d050bbbd02da8821ba2685cec5bcf86a1187a3f9a3ab82d4cc0ef44b0bc5d47644c520e81b5fd8859293021b840bb16571cf407f7fdc08924beaf67dbef97f
|
data/ChangeLog
CHANGED
data/lib/generic_test.rb
CHANGED
@@ -15,9 +15,11 @@ module GenericTest
|
|
15
15
|
# browser so less likely to be accurate for logged in pages
|
16
16
|
@only_javascript = false
|
17
17
|
|
18
|
+
@tested_links = []
|
18
19
|
class << self
|
19
20
|
attr_accessor :browser
|
20
21
|
attr_accessor :pages
|
22
|
+
attr_accessor :tested_links
|
21
23
|
attr_accessor :only_javascript
|
22
24
|
end
|
23
25
|
end
|
data/lib/generic_test/setup.rb
CHANGED
@@ -34,6 +34,8 @@ if ENV[GT_LOGIN_URL] && ENV[GT_USERNAME] && ENV[GT_PASSWORD]
|
|
34
34
|
puts "Login through #{ENV[GT_LOGIN_URL]} successful!"
|
35
35
|
end
|
36
36
|
|
37
|
+
ENV['PAGE_URL'] = RestClient.get(ENV['PAGE_URL']).request.url # Check page exists
|
38
|
+
puts "Checking #{ENV['PAGE_URL']}"
|
37
39
|
browser.goto ENV['PAGE_URL']
|
38
40
|
sleep 2.5 # Give a bit of time for page to load
|
39
41
|
GenericTest.pages << GenericTest::Page.new(browser)
|
data/lib/generic_test/version.rb
CHANGED
data/spec/generic_test_spec.rb
CHANGED
@@ -7,10 +7,14 @@ links = page.links
|
|
7
7
|
RSpec.describe "#{page.title} Links respond" do
|
8
8
|
links.each_with_index do |link, index|
|
9
9
|
link_text = link.text.to_s.empty? ? '' : " \"#{link.text}\""
|
10
|
+
next if GenericTest.tested_links.include? link.href
|
11
|
+
|
12
|
+
GenericTest.tested_links << link.href
|
10
13
|
it "Link (#{index + 1})#{link_text} to '#{link.href}' succeeds" do
|
11
14
|
expect(Checker.link_status(link.href)).to be_between 200, 399
|
12
15
|
end
|
13
16
|
end
|
17
|
+
puts "Checking #{GenericTest.tested_links.count} non duplicate links"
|
14
18
|
end
|
15
19
|
|
16
20
|
emails = page.emails
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: generic_test
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Garratt
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|