[PATCH] Make browser tests work again

Stephen Finucane stephen at that.guru
Tue Jul 4 18:15:44 AEST 2017


On Tue, 2017-07-04 at 08:38 +1000, Daniel Axtens wrote:
> Stephen Finucane <stephen at that.guru> writes:
> 
> > On Sat, 2017-07-01 at 14:06 +1000, Daniel Axtens wrote:
> > > Save us the embarassement of releasing v2 with broken tests.
> > > 
> > > Signed-off-by: Daniel Axtens <dja at axtens.net>
> > > ---
> > >  patchwork/tests/browser.py | 10 +++++++++-
> > >  1 file changed, 9 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/patchwork/tests/browser.py b/patchwork/tests/browser.py
> > > index 38413d5130cd..921b5d4af033 100644
> > > --- a/patchwork/tests/browser.py
> > > +++ b/patchwork/tests/browser.py
> > > @@ -30,6 +30,7 @@ from selenium.common.exceptions import (
> > >      TimeoutException)
> > >  from selenium import webdriver
> > >  from selenium.webdriver.support.ui import WebDriverWait
> > > +from selenium.webdriver.chrome.options import Options
> > >  
> > >  
> > >  class Wait(WebDriverWait):
> > > @@ -110,8 +111,15 @@ class SeleniumTestCase(StaticLiveServerTestCase):
> > >          if self.browser == 'firefox':
> > >              self.selenium = webdriver.Firefox()
> > >          if self.browser == 'chrome':
> > > +            chrome_options = Options()
> > > +            # chrome's aggressive sandboxing doesn't work well with
> > > +            # docker so disable the sandbox. We're only looking at our
> > > +            # own site so it should be safe enough
> > > +            chrome_options.add_argument("--no-sandbox")
> > > +            driver = webdriver.Chrome(chrome_options=chrome_options)
> > 
> > Is this line supposed to be here? It does the same thing as the line below
> > minus the service_args, and isn't used anywhere.
> 
> Ah oops, no - sorry - copy-paste mishap.
> 
> Good catch!

Cool cool. I've this applied sans this line now.

Reviewed-by: Stephen Finucane <stephen at that.guru>


More information about the Patchwork mailing list