mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Webpack all the things! Fixes #2135
This significantly speeds up loading of the application; in an average of 3 tests, v1.6 loaded in 11.5s in the runtime on a Mac, whilst the webpacked version of the code loaded in 5.53s.
This commit is contained in:
committed by
Dave Page
parent
d04ac7656a
commit
4a91bcde30
@@ -183,6 +183,7 @@ SELECT generate_series(1, {}) as id""".format(
|
||||
config.ON_DEMAND_RECORD_COUNT * ON_DEMAND_CHUNKS)
|
||||
|
||||
wait = WebDriverWait(self.page.driver, 10)
|
||||
time.sleep(1)
|
||||
self.page.fill_codemirror_area_with(query)
|
||||
|
||||
self.page.find_by_id("btn-flash").click()
|
||||
@@ -194,16 +195,15 @@ SELECT generate_series(1, {}) as id""".format(
|
||||
|
||||
# scroll to bottom to fetch next chunk of result set.
|
||||
self.driver.execute_script(
|
||||
"$('.slick-viewport').scrollTop($('.grid-canvas').height());"
|
||||
"pgAdmin.SqlEditor.jquery('.slick-viewport').scrollTop(pgAdmin.SqlEditor.jquery('.grid-canvas').height());"
|
||||
)
|
||||
|
||||
# wait for ajax to complete.
|
||||
time.sleep(1)
|
||||
|
||||
# again scroll to bottom to bring last row of next chunk in
|
||||
# viewport.
|
||||
self.driver.execute_script(
|
||||
"$('.slick-viewport').scrollTop($('.grid-canvas').height());"
|
||||
"pgAdmin.SqlEditor.jquery('.slick-viewport').scrollTop(pgAdmin.SqlEditor.jquery('.grid-canvas').height());"
|
||||
)
|
||||
|
||||
row_id_to_find = config.ON_DEMAND_RECORD_COUNT * ON_DEMAND_CHUNKS
|
||||
@@ -234,7 +234,7 @@ SELECT generate_series(1, {}) as id""".format(
|
||||
# scroll to bottom to bring last row of next chunk in
|
||||
# viewport.
|
||||
self.driver.execute_script(
|
||||
"$('.slick-viewport').scrollTop($('.grid-canvas').height());"
|
||||
"pgAdmin.SqlEditor.jquery('.slick-viewport').scrollTop(pgAdmin.SqlEditor.jquery('.grid-canvas').height());"
|
||||
)
|
||||
|
||||
canvas = wait.until(EC.presence_of_element_located(
|
||||
@@ -274,7 +274,7 @@ SELECT generate_series(1, {}) as id1, 'dummy' as id2""".format(
|
||||
# scroll to bottom to bring last row of next chunk in
|
||||
# viewport.
|
||||
self.driver.execute_script(
|
||||
"$('.slick-viewport').scrollTop($('.grid-canvas').height());"
|
||||
"pgAdmin.SqlEditor.jquery('.slick-viewport').scrollTop(pgAdmin.SqlEditor.jquery('.grid-canvas').height());"
|
||||
)
|
||||
|
||||
canvas = wait.until(EC.presence_of_element_located(
|
||||
|
||||
@@ -152,6 +152,7 @@ class CheckForXssFeatureTest(BaseFeatureTest):
|
||||
def _check_xss_in_query_tool(self):
|
||||
self.page.driver.find_element_by_link_text("Tools").click()
|
||||
self.page.find_by_partial_link_text("Query Tool").click()
|
||||
self.page.click_tab('Query -')
|
||||
self.page.fill_codemirror_area_with("select '<img src=\"x\" onerror=\"console.log(1)\">'")
|
||||
time.sleep(1)
|
||||
self.page.find_by_id("btn-flash").click()
|
||||
|
||||
Reference in New Issue
Block a user