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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5511c72398002fc4468de6f4e1e6a3f8c27783fd2cbeef28decae9a833698f57
4
- data.tar.gz: 4aaad3513df4be30725c97ac25fd07bc052bc90dac9b7270d286c1f5ce017090
3
+ metadata.gz: b7fd4592cd7c34e39ae05d9db02ea20dd6ca739f368851db22dac04168504ec1
4
+ data.tar.gz: fb55093d314dfc89e13d0ec4342317106d6caef89dcd9e7341c42c79a59f464b
5
5
  SHA512:
6
- metadata.gz: 4848379d61b1064629f36ca3861759a564ee2fe4d156afb235c6a1eddce86dfd14b05980b6d45dec81b46404d5ce27b81a78fe2f25372ac2040bc5ac480283fe
7
- data.tar.gz: 5c92f007d44d6bcfc74113c091c2fab49a1266c1eef09b093220660eeb2d3db34424f3663f0b752e3c01660df1b8699459954aac88e21e013cf84916f8717370
6
+ metadata.gz: f5ec80dd8977f15b6ffc3a66cec286a2183da371a10eb4d4428ff0f607d849e818bc303ffa96c3295e9ba787f7dcf092e95d64729318dcd357ee390937ec9680
7
+ data.tar.gz: 92d050bbbd02da8821ba2685cec5bcf86a1187a3f9a3ab82d4cc0ef44b0bc5d47644c520e81b5fd8859293021b840bb16571cf407f7fdc08924beaf67dbef97f
data/ChangeLog CHANGED
@@ -1,3 +1,8 @@
1
+ Version 0.1.13
2
+ * Enhancement
3
+ * Fail if cannot find url of page provided
4
+ * Ignore checking duplicate links
5
+
1
6
  Version 0.1.12
2
7
  * Enhancement
3
8
  * More generic matching of username labels allowing any case to be used
@@ -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
@@ -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)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GenericTest
4
- VERSION = '0.1.12'
4
+ VERSION = '0.1.13'
5
5
  end
@@ -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.12
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-02-26 00:00:00.000000000 Z
11
+ date: 2020-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll