Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor/general tidy in prep for 3.3 #1

Merged
merged 4 commits into from
Jun 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .env.example

This file was deleted.

30 changes: 20 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<!-- #392 - May 10th - Last update to this document -->
## [3.2] - 2019-05-xx
## [Unreleased]
### Removed

### Added

### Changed

### Fixed

## [3.2] - 2019-05-14
### Added
- Allow `#load` to be called with a new option `:with_validations`
- When this is set to `false` this will skip load_validations for the one method invocation
Expand Down Expand Up @@ -32,11 +41,11 @@ impending major rubocop release

## [3.1] - 2019-03-26
### Added
- Add info on how to deal with V2->V3 upgrade warnings RE Capybara selectors
- Add info on how to deal with V2 -> V3 upgrade warnings RE Capybara selectors
- In particular how to deal with adding `wait` keys to `wait_until_*` methods
([tgaff])

- Added gem version badge to README
- Added gem version badge to `README.md`
([luke-hill])

- Some of the README docs surrounding how to setup site_prism have been improved
Expand All @@ -51,16 +60,16 @@ impending major rubocop release

- The SitePrism Logger has been massively refactored
- It now almost entirely mimics the Full Ruby Logger API
- The full list of delegated methods can be found [HERE](https://github.com/natritmeyer/site_prism/blob/master/lib/site_prism.rb)
- The full list of delegated methods can be found [HERE](https://github.com/natritmeyer/site_prism/blob/v3.1/lib/site_prism.rb)
- Consequently, the minimum Ruby Version for the suite has been bumped to `2.3`
- Alongside this higher ruby requirement, changes have been made to Capybara/Rubocop/Test code
([luke-hill])

### Changed
- Travis now uses `xenial` Ubuntu in the Docker VM Tests, bringing it slightly more up to date
- Travis now uses `xenial` Ubuntu in the Docker VM Tests, bringing it more up to date
([luke-hill])

- Travis now will build on some more legacy permutations of gems to increase support
- Travis now will build on some more (older), permutations of gems to increase test coverage
([luke-hill])

- The `HISTORY.md` document has now moved to `CHANGELOG.md` to try keep it in-line with other OSS repos
Expand All @@ -74,7 +83,7 @@ impending major rubocop release
- This has also enabled the Mock Pages to be a little more extensible going forwards
([luke-hill])

- Added waiter methods for iFrame's that were previously missing, bringing them in-line with other items
- Added waiter methods for iFrame's that were previously missing, bringing them in-line with other DSL items
([luke-hill])

## [3.0.3] - 2019-02-20
Expand Down Expand Up @@ -155,7 +164,7 @@ impending major rubocop release
- This is due to `simplecov` caching dual results
([luke-hill])

- Stopped Ruby 2.5 users getting spammed with warnings about uninitialised instance variables
- Stopped Ruby `2.5` users getting spammed with warnings about uninitialised instance variables
([menge101])

- Updated user documentation to not advise using now removed methods!
Expand Down Expand Up @@ -426,7 +435,7 @@ impending major rubocop release
([luke-hill])

### Fixed
- README fixes
- `README.md` fixes
([robd])

## [2.12] - 2018-04-20
Expand All @@ -451,7 +460,7 @@ impending major rubocop release
([luke-hill])

### Fixed
- README / rubocop / Test / TODO fixes
- `README.md` / rubocop / Test / TODO fixes
([luke-hill])

- Fix suite incidentally masking several issues due to incorrect cucumber setup
Expand Down Expand Up @@ -988,3 +997,4 @@ impending major rubocop release
[tadashi0713]: https://github.com/tadashi0713
[JanStevens]: https://github.com/JanStevens
[dkniffin]: https://github.com/dkniffin
[hoffi]: https://github.com/hoffi
6 changes: 3 additions & 3 deletions UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,17 @@ The wait time should now be passed using hash args like: `wait: <seconds>`

For example, previously:

```rb
```ruby
@page.wait_until_dialog_invisible(10)
@page.wait_until_notification_flag_visible(5, count: 3)
```

These now become:

```rb
```ruby
@page.wait_until_dialog_invisible(wait: 10)
@page.wait_until_notification_flag_visible(wait: 5, count: 3)
```

> Note: If after upgrading you see `Unused parameters passed to Capybara::Queries::SelectorQuery : [NUMBER]`
this may indicate that you need to make this change.
this may indicate that you need to make this change.
19 changes: 12 additions & 7 deletions development_setup.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
# SitePrism dev setup

To successfully get SitePrism running locally, you will need ...
To successfully get SitePrism running locally, you need to fork the repo and have
`geckodriver` and/or `chromedriver` downloaded

- To fork the repo
- To have geckodriver and/or chromedriver installed and available on your System PATH

```
```bash
$ git clone git@github.com:your_user_name/site_prism.git
$ cd site_prism
$ cp .env.example .env
$ bundle
```

_You can amend which browser you run feature tests on by editing the value in `.env`_
Hacking commands you may need are ...

```bash
$ bundle exec rake cukes # Run feature tests on firefox (Default browser)
$ bundle exec rake cukes browser=chrome # Run feature tests on chrome
$ bundle exec rake specs # Run all rspec tests
$ bundle exec rake # Runs feature tests on firefox, then specs, then runs rubocop
```

- Write your code. Make sure to add unit / feature tests AND documentation (If appropriate)
- Run `bundle exec rake` and ensure it passes
Expand All @@ -21,4 +25,5 @@ _You can amend which browser you run feature tests on by editing the value in `.
Happy Testing / Developing!

Cheers,

The SitePrism Team
22 changes: 12 additions & 10 deletions features/support/env.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
# frozen_string_literal: true

unless ENV['CI']
require 'simplecov'
require 'dotenv'
Dotenv.load('.env')
end

require 'simplecov' unless ENV['CI']
require 'capybara'
require 'capybara/dsl'
require 'capybara/cucumber'
require 'selenium-webdriver'
require 'webdrivers'
Expand All @@ -20,13 +14,21 @@
require_relative 'js_helper'
require_relative 'sections/all'

Capybara.register_driver :selenium do |app|
Capybara.register_driver :site_prism do |app|
browser = ENV.fetch('browser', 'firefox').to_sym
Capybara::Selenium::Driver.new(app, browser: browser)
# To stop chrome V75 failures (Not a problem whilst we're only supporting selenium v3)
capabilities =
if browser == :chrome
{ 'chromeOptions' => { 'w3c' => false } }
else
{}
end

Capybara::Selenium::Driver.new(app, browser: browser, desired_capabilities: capabilities)
end

Capybara.configure do |config|
config.default_driver = :selenium
config.default_driver = :site_prism
config.default_max_wait_time = 0.75
config.app_host = 'file://' + File.dirname(__FILE__) + '/../../test_site'
config.ignore_hidden_elements = false
Expand Down
3 changes: 1 addition & 2 deletions site_prism.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ SitePrism implements the Page Object Model pattern on top of Capybara.'
s.files = Dir.glob('lib/**/*') + %w[LICENSE.md README.md]
s.require_path = 'lib'
s.add_dependency 'addressable', ['~> 2.5']
s.add_dependency 'capybara', ['~> 3.2']
s.add_dependency 'capybara', ['~> 3.3']

s.add_development_dependency 'cucumber', ['~> 3.1']
s.add_development_dependency 'dotenv', ['~> 2.6']
s.add_development_dependency 'rake', ['~> 12.3']
s.add_development_dependency 'rspec', ['~> 3.8']
s.add_development_dependency 'rubocop', ['~> 0.67.0']
Expand Down