from seleniumbase import BaseCase
from seleniumbase.config import settings
from parameterized import parameterized

from common import URL

buttons = 'creation lastedit revisions frequency'.split()

class TestWebapp(BaseCase):
    def test_open_home(self):
        self.set_window_size('640', '480')
        self.open(URL)
        self.assert_element("#map a.leaflet-control-zoom-out",
            timeout=settings.EXTREME_TIMEOUT)

    def test_js_errors(self):
        self.test_open_home()
        self.assert_no_js_errors()

    def test_404_errors(self):
        self.test_open_home()
        self.assert_no_404_errors()

    @parameterized.expand(buttons)
    def test_tabs(self, button):
        self.test_open_home()
        self.execute_script('document.getElementById("'+button+'").click()')
        self.assert_no_js_errors()
        self.assert_no_404_errors()

@@ -284,18 +284,18 @@
 ze('
-640
+768
 ', '4
-80
+32
 ')%0A 
@@ -340,48 +340,24 @@
 ert_
-element(%22#map a.leaflet-control-zoom-out
+text(%22Worst node
 %22,%0A 

Fix Selenium tests