Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Make caching behavior more like Selenium #775

Merged
merged 0 commits into from
May 15, 2015
Merged

Conversation

jferris
Copy link
Contributor

@jferris jferris commented May 7, 2015

We disabled caching entirely, because it sometimes led to unexpected
behavior in tests, and Qt 4.8 didn't behave the same as Qt 5.x.

However, this introduced issues:

  • Selenium does perform caching, so capybara-webkit behaved differently
    when switching drivers
  • Without any caching, assets were sometimes requested twice for the
    same page

This commit re-enables caching and attempts to improve the way we behave
on cached pages so that testing is less unpredictable. It adds tests to
ensure we continue to behave similarly to Selenium.

end

def events_for_driver(name, &block)
def compare_for_drivers(first, second, &block)
for_driver(first, &block).should == for_driver(second, &block)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like one of the builds failed here due to an ordering problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just pushed 4748bb5 to hopefully address this.

@mhoran
Copy link
Collaborator

mhoran commented May 7, 2015

This seems reasonable to me, so long as we're bug for bug compatible with Selenium!

Now that I am thinking about this again, I recall that Rails incorrectly returned 304 under certain circumstances in an app that exhibited this cache issue. We only saw the bug under Qt 5, so there's certainly something that changed there but I'm not sure what. Adding a random query-string to the page resolved the issue and returned the correct content.

Given Selenium would likely have behaved the same way, I'd say this is the right way to go. My only remaining concern is the behavior of the headers, body and contentType properties of cached pages.

@jferris jferris closed this May 15, 2015
@jferris jferris force-pushed the jf-improve-cache-behavior branch from 4748bb5 to aeafb90 Compare May 15, 2015 14:32
@jferris jferris merged commit aeafb90 into master May 15, 2015
@jferris jferris deleted the jf-improve-cache-behavior branch May 15, 2015 14:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants