Skip to content

Commit

Permalink
Merge pull request #322 from natritmeyer/prepare_first_v3_release
Browse files Browse the repository at this point in the history
Prepare first v3 release
  • Loading branch information
luke-hill authored Sep 9, 2018
2 parents 804bdac + 7955d5c commit 3f68401
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 33 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.DS_Store
Gemfile.lock
coverage/*
.bundle
.idea
.env
.cucumber-timings
3 changes: 0 additions & 3 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ Style/SafeNavigation:
Style/RegexpLiteral:
Enabled: false

Style/ConditionalAssignment:
Enabled: false

BlockLength:
Exclude:
- './spec/*_spec.rb'
Expand Down
36 changes: 29 additions & 7 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,38 @@
<!-- #291 - Jul 20th - Last update to this document (Siloed v2.17 not in master) -->
## [Unreleased]
<!-- #320 - Sep 9th - Last update to this document -->
## [3.0.beta] - 2018-09-15
### Removed
- ...
- `wait_for_<element>` and `wait_for_no_<element>` have been removed
- As per deprecation warnings, users should use the regular methods with a `wait` parameter
([luke-hill])

- All SitePrism configuration options ...
- A warning message is thrown when a user sets any configuration option using `SitePrism.configure`
- Default load validations should now be customised by the user (Detailed in the Upgrading docs)
- `raise_on_wait_fors` was only triggered on the `wait_for` / `wait_for_no` methods
- Implicit waiting is now hard-coded to always be on.
- This can be overridden at runtime by using a `wait` key
- You can still not use implicit waits by setting `Capybara.default_max_wait_time = 0`
([luke-hill])

### Added
- ...
- An UPGRADING.md document to help facilitate the switch from SitePrism v2 to v3
([luke-hill])

### Changed
- ...
- Most error message classes have been re-written into a more Ruby naming scheme (Ending in Error)
- The previously aliased names have all been removed
- The `error.rb` file details the previous names to help with the transition
([luke-hill])

- Upped Version Dependency of `selenium-webdriver` to `~> 3.6`
([luke-hill])

- SitePrism will now use the configured Capybara wait time to implicitly wait at all times
([luke-hill])

### Fixed
- ...
- The names/locations of some waiting tests, which were testing implicit instead of explicit waits
([luke-hill])

## [2.17] - 2018-09-07
### Removed
Expand Down Expand Up @@ -649,7 +671,7 @@ Removed testing for Ruby `2.0` on Travis
- First release!

<!-- Releases -->
[Unreleased]: https://github.com/natritmeyer/site_prism/compare/v2.17...master
[3.0.beta]: https://github.com/natritmeyer/site_prism/compare/v2.17...master
[2.17]: https://github.com/natritmeyer/site_prism/compare/v2.16...2.17
[2.16]: https://github.com/natritmeyer/site_prism/compare/v2.15.1...v2.16
[2.15.1]: https://github.com/natritmeyer/site_prism/compare/v2.15...v2.15.1
Expand Down
4 changes: 2 additions & 2 deletions development_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ $ cp .env.example .env
$ bundle
```

_You can amend which browser you run integration tests on by editing the value in `.env`_
_You can amend which browser you run feature tests on by editing the value in `.env`_

- Write your code (adding unit / feature tests / documentation), where appropriate
- Write your code. Make sure to add unit / feature tests AND documentation (If appropriate)
- Run `bundle exec rake` and ensure it passes
- Submit a pull request

Expand Down
2 changes: 1 addition & 1 deletion features/step_definitions/explicit_waiting_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
end

Then("an exception is raised when I wait for a section that won't appear") do
expect { @test_site.section_experiments.slow_section(wait: 0.1) }
expect { @test_site.section_experiments.slow_section(wait: 0.05) }
.to raise_error(Capybara::ElementNotFound)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/site_prism/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module SitePrism
VERSION = '2.17'.freeze
VERSION = '3.0.beta'.freeze
end
21 changes: 9 additions & 12 deletions spec/addressable_url_matcher_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@
expect_matches('//bungle.com').to be false
end

it 'raises an error on templated port' do
expect { matches? '//bazzle.com:{port}' }
.to raise_error(SitePrism::InvalidUrlMatcherError)
.with_message('Your URL and/or matcher could not be interpreted.')
end

it 'passes on correct static port' do
expect_matches('//bazzle.com:8443').to be true
end
Expand Down Expand Up @@ -173,18 +167,21 @@
).to be false
end

it 'raises an error on templated port' do
expect { matches?('//bazzle.com:{port}') }
.to raise_error(SitePrism::InvalidUrlMatcherError)
.with_message('Your URL and/or matcher could not be interpreted.')
end

def expect_matches(*args)
expect(matches?(*args))
end

def matches?(*args)
if args.last.is_a?(::Hash)
mappings = args.pop
else
mappings = {}
end
mappings = args.pop if args.last.is_a?(Hash)
mappings ||= {}
pattern = args.first

pattern = args.first || raise('Must specify a pattern for matches?')
SitePrism::AddressableUrlMatcher.new(pattern).matches?(url, mappings)
end
end
Expand Down
8 changes: 2 additions & 6 deletions test_site/html/section_experiments.htm
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
slow_link.innerText = "slow link";
slow_link.setAttribute("class", "slow");
//wait for a short while then add the links
setTimeout("dumping_ground.appendChild(slow_link);", 250);
setTimeout("document.getElementById('removing-element').remove();", 250);
setTimeout("dumping_ground.appendChild(slow_link);", 200);
setTimeout("document.getElementById('removing-element').remove();", 200);
}
window.onload = load;
</script>
Expand All @@ -31,22 +31,18 @@
<div class="search-results">
<div class="search-result" id="first_search_result">
<span class="title">title 0</span>
<a href="whatever">link 0</a>
<span class="description">description 0</span>
</div>
<div class="search-result">
<span class="title">title 1</span>
<a href="whatever">link 1</a>
<span class="description">description 1</span>
</div>
<div class="search-result">
<span class="title">title 2</span>
<a href="whatever">link 2</a>
<span class="description">description 2</span>
</div>
<div class="search-result">
<span class="title">title 3</span>
<a href="whatever">link 3</a>
<span class="description">description 3</span>
</div>
</div>
Expand Down

0 comments on commit 3f68401

Please sign in to comment.