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

Allow prevention of automatic PhantomJS download #213

Merged
merged 1 commit into from May 21, 2014

Conversation

@fofr
Copy link
Contributor

@fofr fofr commented May 21, 2014

  • Allow users to purposefully avoid automatic download and installation
    of PhantomJS using configuration
  • Maintains default behaviour of downloading if unavailable
  • The download and installation is over http and without a checksum, which poses a security risk
  • When preventing download, PhantomJS already on the path is used
  • Includes an example in the generated jasmine helper
  • Readme also updated for clarification
* Allow users to purposefully avoid automatic download and installation
of another PhantomJS
* The download and installation is over http and without a checksum,
which poses a security risk
* When preventing download, PhantomJS already on the path is used
* Maintains current default behaviour of downloading if unavailable
* Include example in the generated jasmine helper
* Update readme to mention option
fofr added a commit to alphagov/govuk_admin_template that referenced this pull request May 21, 2014
* Use forked gem with phantomjs config added
* Temporarily use this until a PR on gem is accepted
* See: jasmine/jasmine-gem#213
@ragaskar
Copy link
Contributor

@ragaskar ragaskar commented May 21, 2014

Nice, will merge after build passes.

@ragaskar
Copy link
Contributor

@ragaskar ragaskar commented May 21, 2014

JRuby Rails 4 stalled out, but my guess is it's unrelated. Merging. Thanks!

ragaskar added a commit that referenced this pull request May 21, 2014
Allow prevention of automatic PhantomJS download
@ragaskar ragaskar merged commit 6bcf797 into jasmine:master May 21, 2014
1 check failed
1 check failed
continuous-integration/travis-ci The Travis CI build could not complete due to an error
Details
@fofr
Copy link
Contributor Author

@fofr fofr commented May 22, 2014

Excellent 😄 — Version bump to 2.0.2?

fofr referenced this pull request in alphagov/government-frontend Apr 10, 2017
In order to write integration tests that can test for hidden elements (aka use `visible: true` and `visible: false`) we need to upgrade from RackTest to Poltergeist.
RackTest will ignore CSS and Javascript, and does not know how to test hidden elements.

This will be used to test the effect of print stylesheets being developed for this Trello card: https://trello.com/c/88zaXS8J/47-create-print-styles-for-official-documents

After adding Poltergeist, memory caching in Capybara was turned on by default. This meant that some tests were ocassionally failing when they were visiting the same path. In our case, if `government_navigation_test.rb` ran before `phase_label_test.rb`, then the second test would fail. The first test would visit `"/government/case-studies/get-britain-building-carlisle-park"` and cache it. Consequently, the second test would fail with an error that wouldn't obviously indicate caching is the problem.

```

.F

Failure:
PhaseLabelTest#test_Alpha_phase_label_is_displayed_for_a_Case_Study_in_phase_'alpha' [/var/govuk/government-frontend/test/integration/phase_label_test.rb:12]:
Expected false to be truthy.

bin/rails test test/integration/phase_label_test.rb:4

Finished in 3.388734s, 0.5902 runs/s, 0.5902 assertions/s.
```

Due to it taking a while to figure the cause, caching in Capybara has been turned off by default. This is how it's being done:

```

class Minitest::Test
  def teardown
    Capybara.current_session.driver.clear_memory_cache
  end
end
```

Caching can be turned on for specific tests if necessary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.