Are you having the selenium test go to online.html first like in your
manual test?
Maybe you need to have selenium hit offline.html first and cache that page?
On Nov 3, 2012 6:14 AM, "Joao Coelho" <redcoelh...@gmail.com> wrote:

> Hi. I haven't been able to figure this one out. Trying to write an
> automated test that uses selenium.webdriver.firefox.webdriver
>
> The manifest file has
> FALLBACK:
> /online.html /offline.html
>
> So that at /online.html the browser displays the cached copy of
> /offline.html when the server is offline
>
> Also, to simulate server unavailable for testing
> /online.html returns a 200 response
> /online.html?offline=1 returns 503
>
> This all works fine when I browse manually
> /online.html displays "I am online"
> /online.html?offline=1 displays "I am a cached page"
>
> I want the selenium test to get /online.html?offline=1 and see "I am a
> cached page" /offline.html
> But it's only showing a blank page
> I think it's stopping at the 503 and not loading from the app cache
>
>     def test_offline(self):
>         """Simulate site being offline"""
>         self.selenium.get('%s%s' % (self.live_server_url,
> '/online.html?offline=1'))
>         self.assertIn('cached page', self.selenium.page_source)
>
> How can I make it test this? Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/YrAnOOsSaKAJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to