Thread: [pgAdmin4][Patch] Feature #3270 Add support for running regressiontests against Firefox
[pgAdmin4][Patch] Feature #3270 Add support for running regressiontests against Firefox
- Extract the gecko driver.
- Run chmod +x geckodriver.
- Either copy the geckodriver to /usr/local/bin or the path of the geckodriver must be specified in PATH.
- Apply the attached patch.
- Change the parameter "DEFAULT_TEST_BROWSER = 'Firefox' "
- Start the feature test.
--
Mobile: +91 976-788-8246
Attachment
Re: [pgAdmin4][Patch] Feature #3270 Add support for runningregression tests against Firefox
Hi Hackers,I have added support for running feature tests against FireFox. For that user will have to download gecko driver from https://github.com/mozilla/geckodriver/releases and follow the below steps:
- Extract the gecko driver.
- Run chmod +x geckodriver.
- Either copy the geckodriver to /usr/local/bin or the path of the geckodriver must be specified in PATH.
- Apply the attached patch.
- Change the parameter "DEFAULT_TEST_BROWSER = 'Firefox' "
- Start the feature test.
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Re: [pgAdmin4][Patch] Feature #3270 Add support for runningregression tests against Firefox
HiOn Mon, Apr 23, 2018 at 2:05 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote: Hi Hackers,I have added support for running feature tests against FireFox. For that user will have to download gecko driver from https://github.com/mozilla/geckodriver/releases and follow the below steps:
- Extract the gecko driver.
- Run chmod +x geckodriver.
- Either copy the geckodriver to /usr/local/bin or the path of the geckodriver must be specified in PATH.
- Apply the attached patch.
- Change the parameter "DEFAULT_TEST_BROWSER = 'Firefox' "
- Start the feature test.
The config option needs to be in test_config.json. We don't really want test-specific config options in config.py (arguably, TEST_SQLITE_PATH shoudn't be there either, as it's useless for end users).I'm surprised to not see any updates to tests. When I tried firefox manually a few weeks back, it was failing at lot.--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Re: [pgAdmin4][Patch] Feature #3270 Add support for runningregression tests against Firefox
We also tried running the tests with this patch. It didn't launch without some code changes and several tests were failing. We should really defer pulling this in until we have more robust results on FirefoxIn order to have the tests running we had to do the following change:diff --git a/web/regression/feature_utils/app_starter.py b/web/regression/feature_ utils/app_starter.py index 77b0400c..50d3e307 100644--- a/web/regression/feature_utils/app_starter.py +++ b/web/regression/feature_utils/app_starter.py @@ -42,10 +44,18 @@ class AppStarter:)self.driver.set_window_size(1280, 1024) - self.driver.get(- "http://" + self.app_config.DEFAULT_SERVER + ":" +- random_server_port- )+ # self.driver.implicitly_wait(60) ++ def launch_browser():+ try:+ self.driver.get(+ "http://" + self.app_config.DEFAULT_SERVER + ":" ++ random_server_port+ )+ except WebDriverException as e:+ time.sleep(5)+ launch_browser()+ launch_browser()This change was required because firefox was throwing an exception when we tried to get the address and the server was not running. We saw this behavior in Ubuntu.
- Anthony and JoaoOn Mon, Apr 23, 2018 at 9:12 AM, Dave Page <dpage@pgadmin.org> wrote:HiOn Mon, Apr 23, 2018 at 2:05 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote: Hi Hackers,I have added support for running feature tests against FireFox. For that user will have to download gecko driver from https://github.com/mozilla/geckodriver/releases and follow the below steps:
- Extract the gecko driver.
- Run chmod +x geckodriver.
- Either copy the geckodriver to /usr/local/bin or the path of the geckodriver must be specified in PATH.
- Apply the attached patch.
- Change the parameter "DEFAULT_TEST_BROWSER = 'Firefox' "
- Start the feature test.
The config option needs to be in test_config.json. We don't really want test-specific config options in config.py (arguably, TEST_SQLITE_PATH shoudn't be there either, as it's useless for end users).I'm surprised to not see any updates to tests. When I tried firefox manually a few weeks back, it was failing at lot.--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Mobile: +91 976-788-8246
Attachment
Re: [pgAdmin4][Patch] Feature #3270 Add support for running regression tests against Firefox
./regression/runtests.py:184: [E125] continuation line with same indent as next logical line./regression/runtests.py:184: [E501] line too long (80 > 79 characters)1 E125 continuation line with same indent as next logical line1 E501 line too long (80 > 79 characters)2
=============Running the test cases for 'PostgreSQL 10'=============
runTest (pgadmin.feature_tests.copy_selected_query_results_feature_test.CopySelectedQueryResultsFeatureTest)
Copy rows, column using button and keyboard shortcut ... ERROR
runTest (pgadmin.feature_tests.keyboard_shortcut_test.KeyboardShortcutFeatureTest)
Test for keyboard shortcut ... Executing shortcut: File main menu...OK
Executing shortcut: Object main menu...OK
ok
runTest (pgadmin.feature_tests.pg_datatype_validation_test.PGDataypeFeatureTest)
Test checks for PG data-types output ... ERROR
runTest (pgadmin.feature_tests.query_tool_journey_test.QueryToolJourneyTest)
Tests the path through the query tool ... ERROR
runTest (pgadmin.feature_tests.query_tool_tests.QueryToolFeatureTest)
Query tool feature test ...
On demand query result...
On demand result set on scrolling... OK.
On demand result set on grid select all... OK.
On demand result set on column select all... OK.
Explain query with verbose and cost... ERROR
runTest (pgadmin.feature_tests.table_ddl_feature_test.TableDdlFeatureTest)
Test table DDL generation ... ok
runTest (pgadmin.feature_tests.view_data_dml_queries.CheckForViewDataTest)
Validate Insert, Update operations in View/Edit data with given test data ... ERROR
ERROR
runTest (pgadmin.feature_tests.xss_checks_file_manager_test.CheckFileManagerFeatureTest)
Tests to check if File manager is vulnerable to XSS ... ERROR
runTest (pgadmin.feature_tests.xss_checks_panels_and_query_tool_test.CheckForXssFeatureTest)
Test XSS check for panels and query tool ... ERROR
ERROR
runTest (pgadmin.feature_tests.xss_checks_pgadmin_debugger_test.CheckDebuggerForXssFeatureTest)
Tests to check if Debugger is vulnerable to XSS ... ERROR
ERROR
runTest (pgadmin.feature_tests.xss_checks_roles_control_test.CheckRoleMembershipControlFeatureTest)
Tests to check if Role membership control is vulnerable to XSS^[ ... Traceback (most recent call last): File "/home/pivotal/workspace/pgadmin4/web/regression/python_test_utils/test_utils.py", line 338, in create_role sql_query
psycopg2.ProgrammingError: role "test_role" already exists
Traceback (most recent call last): File "/home/pivotal/workspace/pgadmin4/web/regression/python_test_utils/test_utils.py", line 338, in create_role sql_query
psycopg2.ProgrammingError: role "<h1>test</h1>" already exists
ERROR
ERROR
======================================================================
ERROR: runTest (pgadmin.feature_tests.copy_selected_query_results_feature_test.CopySelectedQueryResultsFeatureTest)
Copy rows, column using button and keyboard shortcut
----------------------------------------------------------------------
Traceback (most recent call last): File "/home/pivotal/workspace/pgadmin4/web/pgadmin/feature_tests/copy_selected_query_results_feature_test.py", line 57, in runTest self._copies_rows() File "/home/pivotal/workspace/pgadmin4/web/pgadmin/feature_tests/copy_selected_query_results_feature_test.py", line 67, in _copies_rows pyperclip.copy("old clipboard contents") File "/home/pivotal/.pyenv/versions/python36/lib/python3.6/site-packages/pyperclip/__init__.py", line 574, in lazy_load_stub_copy return copy(text) File "/home/pivotal/.pyenv/versions/python36/lib/python3.6/site-packages/pyperclip/__init__.py", line 284, in __call__ raise PyperclipException(EXCEPT_MSG)
pyperclip.PyperclipException: Pyperclip could not find a copy/paste mechanism for your system. For more information, please visit https://pyperclip.readthedocs.io/en/latest/introduction.html#not-implemented-error
======================================================================
ERROR: runTest (pgadmin.feature_tests.pg_datatype_validation_test.PGDataypeFeatureTest)
Test checks for PG data-types output
----------------------------------------------------------------------
Traceback (most recent call last): File "/home/pivotal/workspace/pgadmin4/web/pgadmin/feature_tests/pg_datatype_validation_test.py", line 135, in runTest self._check_datatype() File "/home/pivotal/workspace/pgadmin4/web/pgadmin/feature_tests/pg_datatype_validation_test.py", line 169, in _check_datatype "contains(.,'{}')]".format(batch['datatype'][0]) File "/home/pivotal/.pyenv/versions/python36/lib/python3.6/site-packages/selenium/webdriver/support/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message:
======================================================================
ERROR: runTest (pgadmin.feature_tests.query_tool_journey_test.QueryToolJourneyTest)
Tests the path through the query tool
----------------------------------------------------------------------
Traceback (most recent call last): File "/home/pivotal/workspace/pgadmin4/web/pgadmin/feature_tests/query_tool_journey_test.py", line 49, in runTest self._test_copies_rows() File "/home/pivotal/workspace/pgadmin4/web/pgadmin/feature_tests/query_tool_journey_test.py", line 54, in _test_copies_rows pyperclip.copy("old clipboard contents") File "/home/pivotal/.pyenv/versions/python36/lib/python3.6/site-packages/pyperclip/__init__.py", line 284, in __call__ raise PyperclipException(EXCEPT_MSG)
pyperclip.PyperclipException: Pyperclip could not find a copy/paste mechanism for your system. For more information, please visit https://pyperclip.readthedocs.io/en/latest/introduction.html#not-implemented-error
======================================================================
ERROR: runTest (pgadmin.feature_tests.query_tool_tests.QueryToolFeatureTest)
Query tool feature test
----------------------------------------------------------------------
Traceback (most recent call last): File "/home/pivotal/workspace/pgadmin4/web/pgadmin/feature_tests/query_tool_tests.py", line 59, in runTest self._query_tool_explain_with_verbose_and_cost() File "/home/pivotal/workspace/pgadmin4/web/pgadmin/feature_tests/query_tool_tests.py", line 262, in _query_tool_explain_with_verbose_and_cost self.page.find_by_id("btn-explain-costs").click() File "/home/pivotal/workspace/pgadmin4/web/regression/feature_utils/pgadmin_page.py", line 174, in find_by_id lambda driver: driver.find_element_by_id(element_id) File "/home/pivotal/workspace/pgadmin4/web/regression/feature_utils/pgadmin_page.py", line 261, in wait_for_element return self._wait_for("element to exist", element_if_it_exists) File "/home/pivotal/workspace/pgadmin4/web/regression/feature_utils/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions/python36/lib/python3.6/site-packages/selenium/webdriver/support/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message: Timed out waiting for element to exist
======================================================================
ERROR: runTest (pgadmin.feature_tests.view_data_dml_queries.CheckForViewDataTest)
Validate Insert, Update operations in View/Edit data with given test data
----------------------------------------------------------------------
Traceback (most recent call last): File "/home/pivotal/workspace/pgadmin4/web/pgadmin/feature_tests/view_data_dml_queries.py", line 114, in runTest self.page.add_server(self.server) File "/home/pivotal/workspace/pgadmin4/web/regression/feature_utils/pgadmin_page.py", line 55, in add_server self.find_by_partial_link_text("Server...").click() File "/home/pivotal/workspace/pgadmin4/web/regression/feature_utils/pgadmin_page.py", line 185, in find_by_partial_link_text EC.element_to_be_clickable((By.PARTIAL_LINK_TEXT, link_text)) File "/home/pivotal/workspace/pgadmin4/web/regression/feature_utils/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions/python36/lib/python3.6/site-packages/selenium/webdriver/support/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message: Timed out waiting for link with text "Server..."
======================================================================
ERROR: runTest (pgadmin.feature_tests.view_data_dml_queries.CheckForViewDataTest)
Validate Insert, Update operations in View/Edit data with given test data
----------------------------------------------------------------------
Traceback (most recent call last): File "/home/pivotal/workspace/pgadmin4/web/regression/feature_utils/base_feature_test.py", line 66, in tearDown self.after() File "/home/pivotal/workspace/pgadmin4/web/pgadmin/feature_tests/view_data_dml_queries.py", line 132, in after self.page.remove_server(self.server) File "/home/pivotal/workspace/pgadmin4/web/regression/feature_utils/pgadmin_page.py", line 122, in remove_server "' and @class='aciTreeItem']") File "/home/pivotal/workspace/pgadmin4/web/regression/feature_utils/pgadmin_page.py", line 169, in find_by_xpath lambda driver: driver.find_element_by_xpath(xpath) File "/home/pivotal/workspace/pgadmin4/web/regression/feature_utils/pgadmin_page.py", line 261, in wait_for_element return self._wait_for("element to exist", element_if_it_exists) File "/home/pivotal/workspace/pgadmin4/web/regression/feature_utils/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions/python36/lib/python3.6/site-packages/selenium/webdriver/support/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message: Timed out waiting for element to exist
======================================================================
ERROR: runTest (pgadmin.feature_tests.xss_checks_file_manager_test.CheckFileManagerFeatureTest)
Tests to check if File manager is vulnerable to XSS
----------------------------------------------------------------------
Traceback (most recent call last): File "/home/pivotal/workspace/pgadmin4/web/regression/feature_utils/base_feature_test.py", line 43, in setUp self.before() File "/home/pivotal/workspace/pgadmin4/web/pgadmin/feature_tests/xss_checks_file_manager_test.py", line 37, in before self.page.add_server(self.server) File "/home/pivotal/workspace/pgadmin4/web/regression/feature_utils/pgadmin_page.py", line 55, in add_server self.find_by_partial_link_text("Server...").click() File "/home/pivotal/workspace/pgadmin4/web/regression/feature_utils/pgadmin_page.py", line 185, in find_by_partial_link_text EC.element_to_be_clickable((By.PARTIAL_LINK_TEXT, link_text)) File "/home/pivotal/workspace/pgadmin4/web/regression/feature_utils/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions/python36/lib/python3.6/site-packages/selenium/webdriver/support/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message: Timed out waiting for link with text "Server..."
======================================================================
ERROR: runTest (pgadmin.feature_tests.xss_checks_panels_and_query_tool_test.CheckForXssFeatureTest)
Test XSS check for panels and query tool
----------------------------------------------------------------------
Traceback (most recent call last): File "/home/pivotal/workspace/pgadmin4/web/pgadmin/feature_tests/xss_checks_panels_and_query_tool_test.py", line 57, in runTest self.page.add_server(self.server) File "/home/pivotal/workspace/pgadmin4/web/regression/feature_utils/pgadmin_page.py", line 55, in add_server self.find_by_partial_link_text("Server...").click() File "/home/pivotal/workspace/pgadmin4/web/regression/feature_utils/pgadmin_page.py", line 185, in find_by_partial_link_text EC.element_to_be_clickable((By.PARTIAL_LINK_TEXT, link_text)) File "/home/pivotal/workspace/pgadmin4/web/regression/feature_utils/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions/python36/lib/python3.6/site-packages/selenium/webdriver/support/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message: Timed out waiting for link with text "Server..."
======================================================================
ERROR: runTest (pgadmin.feature_tests.xss_checks_panels_and_query_tool_test.CheckForXssFeatureTest)
Test XSS check for panels and query tool
----------------------------------------------------------------------
Traceback (most recent call last): File "/home/pivotal/workspace/pgadmin4/web/regression/feature_utils/base_feature_test.py", line 66, in tearDown self.after() File "/home/pivotal/workspace/pgadmin4/web/pgadmin/feature_tests/xss_checks_panels_and_query_tool_test.py", line 69, in after self.page.remove_server(self.server) File "/home/pivotal/workspace/pgadmin4/web/regression/feature_utils/pgadmin_page.py", line 122, in remove_server "' and @class='aciTreeItem']") File "/home/pivotal/workspace/pgadmin4/web/regression/feature_utils/pgadmin_page.py", line 169, in find_by_xpath lambda driver: driver.find_element_by_xpath(xpath) File "/home/pivotal/workspace/pgadmin4/web/regression/feature_utils/pgadmin_page.py", line 261, in wait_for_element return self._wait_for("element to exist", element_if_it_exists) File "/home/pivotal/workspace/pgadmin4/web/regression/feature_utils/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions/python36/lib/python3.6/site-packages/selenium/webdriver/support/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message: Timed out waiting for element to exist
======================================================================
ERROR: runTest (pgadmin.feature_tests.xss_checks_pgadmin_debugger_test.CheckDebuggerForXssFeatureTest)
Tests to check if Debugger is vulnerable to XSS
----------------------------------------------------------------------
Traceback (most recent call last): File "/home/pivotal/workspace/pgadmin4/web/pgadmin/feature_tests/xss_checks_pgadmin_debugger_test.py", line 41, in runTest self.page.add_server(self.server) File "/home/pivotal/workspace/pgadmin4/web/regression/feature_utils/pgadmin_page.py", line 55, in add_server self.find_by_partial_link_text("Server...").click() File "/home/pivotal/workspace/pgadmin4/web/regression/feature_utils/pgadmin_page.py", line 185, in find_by_partial_link_text EC.element_to_be_clickable((By.PARTIAL_LINK_TEXT, link_text)) File "/home/pivotal/workspace/pgadmin4/web/regression/feature_utils/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions/python36/lib/python3.6/site-packages/selenium/webdriver/support/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message: Timed out waiting for link with text "Server..."
======================================================================
ERROR: runTest (pgadmin.feature_tests.xss_checks_pgadmin_debugger_test.CheckDebuggerForXssFeatureTest)
Tests to check if Debugger is vulnerable to XSS
----------------------------------------------------------------------
Traceback (most recent call last): File "/home/pivotal/workspace/pgadmin4/web/regression/feature_utils/base_feature_test.py", line 66, in tearDown self.after() File "/home/pivotal/workspace/pgadmin4/web/pgadmin/feature_tests/xss_checks_pgadmin_debugger_test.py", line 46, in after self.page.remove_server(self.server) File "/home/pivotal/workspace/pgadmin4/web/regression/feature_utils/pgadmin_page.py", line 122, in remove_server "' and @class='aciTreeItem']") File "/home/pivotal/workspace/pgadmin4/web/regression/feature_utils/pgadmin_page.py", line 169, in find_by_xpath lambda driver: driver.find_element_by_xpath(xpath) File "/home/pivotal/workspace/pgadmin4/web/regression/feature_utils/pgadmin_page.py", line 261, in wait_for_element return self._wait_for("element to exist", element_if_it_exists) File "/home/pivotal/workspace/pgadmin4/web/regression/feature_utils/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions/python36/lib/python3.6/site-packages/selenium/webdriver/support/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message: Timed out waiting for element to exist
======================================================================
ERROR: runTest (pgadmin.feature_tests.xss_checks_roles_control_test.CheckRoleMembershipControlFeatureTest)
Tests to check if Role membership control is vulnerable to XSS
----------------------------------------------------------------------
Traceback (most recent call last): File "/home/pivotal/workspace/pgadmin4/web/pgadmin/feature_tests/xss_checks_roles_control_test.py", line 37, in runTest self.page.add_server(self.server) File "/home/pivotal/workspace/pgadmin4/web/regression/feature_utils/pgadmin_page.py", line 55, in add_server self.find_by_partial_link_text("Server...").click() File "/home/pivotal/workspace/pgadmin4/web/regression/feature_utils/pgadmin_page.py", line 185, in find_by_partial_link_text EC.element_to_be_clickable((By.PARTIAL_LINK_TEXT, link_text)) File "/home/pivotal/workspace/pgadmin4/web/regression/feature_utils/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions/python36/lib/python3.6/site-packages/selenium/webdriver/support/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message: Timed out waiting for link with text "Server..."
======================================================================
ERROR: runTest (pgadmin.feature_tests.xss_checks_roles_control_test.CheckRoleMembershipControlFeatureTest)
Tests to check if Role membership control is vulnerable to XSS
----------------------------------------------------------------------
Traceback (most recent call last): File "/home/pivotal/workspace/pgadmin4/web/regression/feature_utils/base_feature_test.py", line 66, in tearDown self.after() File "/home/pivotal/workspace/pgadmin4/web/pgadmin/feature_tests/xss_checks_roles_control_test.py", line 42, in after self.page.remove_server(self.server) File "/home/pivotal/workspace/pgadmin4/web/regression/feature_utils/pgadmin_page.py", line 122, in remove_server "' and @class='aciTreeItem']") File "/home/pivotal/workspace/pgadmin4/web/regression/feature_utils/pgadmin_page.py", line 169, in find_by_xpath lambda driver: driver.find_element_by_xpath(xpath) File "/home/pivotal/workspace/pgadmin4/web/regression/feature_utils/pgadmin_page.py", line 261, in wait_for_element return self._wait_for("element to exist", element_if_it_exists) File "/home/pivotal/workspace/pgadmin4/web/regression/feature_utils/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions/python36/lib/python3.6/site-packages/selenium/webdriver/support/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message: Timed out waiting for element to exist
----------------------------------------------------------------------
Ran 11 tests in 441.881s
FAILED (errors=13)
======================================================================
Test Result Summary
======================================================================
PostgreSQL 10:
2 tests passed 9 tests failed: CopySelectedQueryResultsFeatureTest (Copy rows, column using button and keyboard shortcut) PGDataypeFeatureTest (Test checks for PG data-types output) QueryToolJourneyTest (Tests the path through the query tool) QueryToolFeatureTest (Query tool feature test) CheckForViewDataTest (Validate Insert, Update operations in View/Edit data with given test data) CheckFileManagerFeatureTest (Tests to check if File manager is vulnerable to XSS) CheckForXssFeatureTest (Test XSS check for panels and query tool) CheckDebuggerForXssFeatureTest (Tests to check if Debugger is vulnerable to XSS) CheckRoleMembershipControlFeatureTest (Tests to check if Role membership control is vulnerable to XSS) 0 tests skipped
======================================================================
Hi Hackers,On Mon, Apr 23, 2018 at 9:07 PM, Anthony Emengo <aemengo@pivotal.io> wrote:We also tried running the tests with this patch. It didn't launch without some code changes and several tests were failing. We should really defer pulling this in until we have more robust results on FirefoxIn order to have the tests running we had to do the following change:diff --git a/web/regression/feature_utils/app_starter.py b/web/regression/feature_utils/app_starter.pyindex 77b0400c..50d3e307 100644--- a/web/regression/feature_utils/app_starter.py+++ b/web/regression/feature_utils/app_starter.py@@ -42,10 +44,18 @@ class AppStarter:)self.driver.set_window_size(1280, 1024)- self.driver.get(- "http://" + self.app_config.DEFAULT_SERVER + ":" +- random_server_port- )+ # self.driver.implicitly_wait(60)++ def launch_browser():+ try:+ self.driver.get(+ "http://" + self.app_config.DEFAULT_SERVER + ":" ++ random_server_port+ )+ except WebDriverException as e:+ time.sleep(5)+ launch_browser()+ launch_browser()This change was required because firefox was throwing an exception when we tried to get the address and the server was not running. We saw this behavior in Ubuntu.Yes I have faced the same problem in Ubuntu. As per suggestion by Dave I have added parameter in test_config.json.in and also include the above code given by Anthony.Attached is the modified patch.- Anthony and JoaoOn Mon, Apr 23, 2018 at 9:12 AM, Dave Page <dpage@pgadmin.org> wrote:HiOn Mon, Apr 23, 2018 at 2:05 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:Hi Hackers,I have added support for running feature tests against FireFox. For that user will have to download gecko driver from https://github.com/mozilla/geckodriver/releases and follow the below steps:
- Extract the gecko driver.
- Run chmod +x geckodriver.
- Either copy the geckodriver to /usr/local/bin or the path of the geckodriver must be specified in PATH.
- Apply the attached patch.
- Change the parameter "DEFAULT_TEST_BROWSER = 'Firefox' "
- Start the feature test.
The config option needs to be in test_config.json. We don't really want test-specific config options in config.py (arguably, TEST_SQLITE_PATH shoudn't be there either, as it's useless for end users).I'm surprised to not see any updates to tests. When I tried firefox manually a few weeks back, it was failing at lot.--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Attachment
Re: [pgAdmin4][Patch] Feature #3270 Add support for runningregression tests against Firefox
We also tried running the tests with this patch. It didn't launch without some code changes and several tests were failing. We should really defer pulling this in until we have more robust results on FirefoxIn order to have the tests running we had to do the following change:diff --git a/web/regression/feature_utils/app_starter.py b/web/regression/feature_ utils/app_starter.py index 77b0400c..50d3e307 100644--- a/web/regression/feature_utils/app_starter.py +++ b/web/regression/feature_utils/app_starter.py @@ -42,10 +44,18 @@ class AppStarter:)self.driver.set_window_size(1280, 1024) - self.driver.get(- "http://" + self.app_config.DEFAULT_SERVER + ":" +- random_server_port- )+ # self.driver.implicitly_wait(60) ++ def launch_browser():+ try:+ self.driver.get(+ "http://" + self.app_config.DEFAULT_SERVER + ":" ++ random_server_port+ )+ except WebDriverException as e:+ time.sleep(5)+ launch_browser()+ launch_browser()This change was required because firefox was throwing an exception when we tried to get the address and the server was not running. We saw this behavior in Ubuntu.- Anthony and JoaoOn Mon, Apr 23, 2018 at 9:12 AM, Dave Page <dpage@pgadmin.org> wrote:HiOn Mon, Apr 23, 2018 at 2:05 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote: Hi Hackers,I have added support for running feature tests against FireFox. For that user will have to download gecko driver from https://github.com/mozilla/geckodriver/releases and follow the below steps:
- Extract the gecko driver.
- Run chmod +x geckodriver.
- Either copy the geckodriver to /usr/local/bin or the path of the geckodriver must be specified in PATH.
- Apply the attached patch.
- Change the parameter "DEFAULT_TEST_BROWSER = 'Firefox' "
- Start the feature test.
The config option needs to be in test_config.json. We don't really want test-specific config options in config.py (arguably, TEST_SQLITE_PATH shoudn't be there either, as it's useless for end users).I'm surprised to not see any updates to tests. When I tried firefox manually a few weeks back, it was failing at lot.--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Re: [pgAdmin4][Patch] Feature #3270 Add support for running regression tests against Firefox
Hi Akshay,Linter fails and tests are failing when we run the patch on our machine using Firefox. The linter output is:./regression/runtests.py:184: [E125] continuation line with same indent as next logical line./regression/runtests.py:184: [E501] line too long (80 > 79 characters)1 E125 continuation line with same indent as next logical line1 E501 line too long (80 > 79 characters)2The tests output is:=============Running the test cases for 'PostgreSQL 10'============= runTest (pgadmin.feature_tests.copy_
selected_query_results_ feature_test. CopySelectedQueryResultsFeatur eTest) Copy rows, column using button and keyboard shortcut ... ERROR runTest (pgadmin.feature_tests. keyboard_shortcut_test. KeyboardShortcutFeatureTest) Test for keyboard shortcut ... Executing shortcut: File main menu...OK Executing shortcut: Object main menu...OK ok runTest (pgadmin.feature_tests.pg_ datatype_validation_test. PGDataypeFeatureTest) Test checks for PG data-types output ... ERROR runTest (pgadmin.feature_tests.query_ tool_journey_test. QueryToolJourneyTest) Tests the path through the query tool ... ERROR runTest (pgadmin.feature_tests.query_ tool_tests. QueryToolFeatureTest) Query tool feature test ... On demand query result... On demand result set on scrolling... OK. On demand result set on grid select all... OK. On demand result set on column select all... OK. Explain query with verbose and cost... ERROR runTest (pgadmin.feature_tests.table_ ddl_feature_test. TableDdlFeatureTest) Test table DDL generation ... ok runTest (pgadmin.feature_tests.view_ data_dml_queries. CheckForViewDataTest) Validate Insert, Update operations in View/Edit data with given test data ... ERROR ERROR runTest (pgadmin.feature_tests.xss_ checks_file_manager_test. CheckFileManagerFeatureTest) Tests to check if File manager is vulnerable to XSS ... ERROR runTest (pgadmin.feature_tests.xss_ checks_panels_and_query_tool_ test.CheckForXssFeatureTest) Test XSS check for panels and query tool ... ERROR ERROR runTest (pgadmin.feature_tests.xss_ checks_pgadmin_debugger_test. CheckDebuggerForXssFeatureTest ) Tests to check if Debugger is vulnerable to XSS ... ERROR ERROR runTest (pgadmin.feature_tests.xss_ checks_roles_control_test. CheckRoleMembershipControlFeat ureTest) Tests to check if Role membership control is vulnerable to XSS^[ ... Traceback (most recent call last): File "/home/pivotal/workspace/ pgadmin4/web/regression/ python_test_utils/test_utils. py", line 338, in create_role sql_query psycopg2.ProgrammingError: role "test_role" already exists Traceback (most recent call last): File "/home/pivotal/workspace/ pgadmin4/web/regression/ python_test_utils/test_utils. py", line 338, in create_role sql_query psycopg2.ProgrammingError: role "<h1>test</h1>" already exists ERROR ERROR ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.copy_ selected_query_results_ feature_test. CopySelectedQueryResultsFeatur eTest) Copy rows, column using button and keyboard shortcut ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/ pgadmin4/web/pgadmin/feature_ tests/copy_selected_query_ results_feature_test.py", line 57, in runTest self._copies_rows() File "/home/pivotal/workspace/ pgadmin4/web/pgadmin/feature_ tests/copy_selected_query_ results_feature_test.py", line 67, in _copies_rows pyperclip.copy("old clipboard contents") File "/home/pivotal/.pyenv/ versions/python36/lib/python3. 6/site-packages/pyperclip/__ init__.py", line 574, in lazy_load_stub_copy return copy(text) File "/home/pivotal/.pyenv/ versions/python36/lib/python3. 6/site-packages/pyperclip/__ init__.py", line 284, in __call__ raise PyperclipException(EXCEPT_MSG) pyperclip.PyperclipException: Pyperclip could not find a copy/paste mechanism for your system. For more information, please visit https://pyperclip.readthedocs. io/en/latest/introduction. html#not-implemented-error ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.pg_ datatype_validation_test. PGDataypeFeatureTest) Test checks for PG data-types output ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/ pgadmin4/web/pgadmin/feature_ tests/pg_datatype_validation_ test.py", line 135, in runTest self._check_datatype() File "/home/pivotal/workspace/ pgadmin4/web/pgadmin/feature_ tests/pg_datatype_validation_ test.py", line 169, in _check_datatype "contains(.,'{}')]".format( batch['datatype'][0]) File "/home/pivotal/.pyenv/ versions/python36/lib/python3. 6/site-packages/selenium/ webdriver/support/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions. TimeoutException: Message: ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.query_ tool_journey_test. QueryToolJourneyTest) Tests the path through the query tool ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/ pgadmin4/web/pgadmin/feature_ tests/query_tool_journey_test. py", line 49, in runTest self._test_copies_rows() File "/home/pivotal/workspace/ pgadmin4/web/pgadmin/feature_ tests/query_tool_journey_test. py", line 54, in _test_copies_rows pyperclip.copy("old clipboard contents") File "/home/pivotal/.pyenv/ versions/python36/lib/python3. 6/site-packages/pyperclip/__ init__.py", line 284, in __call__ raise PyperclipException(EXCEPT_MSG) pyperclip.PyperclipException: Pyperclip could not find a copy/paste mechanism for your system. For more information, please visit https://pyperclip.readthedocs. io/en/latest/introduction. html#not-implemented-error ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.query_ tool_tests. QueryToolFeatureTest) Query tool feature test ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/ pgadmin4/web/pgadmin/feature_ tests/query_tool_tests.py", line 59, in runTest self._query_tool_explain_with_ verbose_and_cost() File "/home/pivotal/workspace/ pgadmin4/web/pgadmin/feature_ tests/query_tool_tests.py", line 262, in _query_tool_explain_with_ verbose_and_cost self.page.find_by_id("btn- explain-costs").click() File "/home/pivotal/workspace/ pgadmin4/web/regression/ feature_utils/pgadmin_page.py" , line 174, in find_by_id lambda driver: driver.find_element_by_id( element_id) File "/home/pivotal/workspace/ pgadmin4/web/regression/ feature_utils/pgadmin_page.py" , line 261, in wait_for_element return self._wait_for("element to exist", element_if_it_exists) File "/home/pivotal/workspace/ pgadmin4/web/regression/ feature_utils/pgadmin_page.py" , line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/ versions/python36/lib/python3. 6/site-packages/selenium/ webdriver/support/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions. TimeoutException: Message: Timed out waiting for element to exist ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.view_ data_dml_queries. CheckForViewDataTest) Validate Insert, Update operations in View/Edit data with given test data ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/ pgadmin4/web/pgadmin/feature_ tests/view_data_dml_queries. py", line 114, in runTest self.page.add_server(self. server) File "/home/pivotal/workspace/ pgadmin4/web/regression/ feature_utils/pgadmin_page.py" , line 55, in add_server self.find_by_partial_link_ text("Server...").click() File "/home/pivotal/workspace/ pgadmin4/web/regression/ feature_utils/pgadmin_page.py" , line 185, in find_by_partial_link_text EC.element_to_be_clickable(( By.PARTIAL_LINK_TEXT, link_text)) File "/home/pivotal/workspace/ pgadmin4/web/regression/ feature_utils/pgadmin_page.py" , line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/ versions/python36/lib/python3. 6/site-packages/selenium/ webdriver/support/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions. TimeoutException: Message: Timed out waiting for link with text "Server..." ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.view_ data_dml_queries. CheckForViewDataTest) Validate Insert, Update operations in View/Edit data with given test data ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/ pgadmin4/web/regression/ feature_utils/base_feature_ test.py", line 66, in tearDown self.after() File "/home/pivotal/workspace/ pgadmin4/web/pgadmin/feature_ tests/view_data_dml_queries. py", line 132, in after self.page.remove_server(self. server) File "/home/pivotal/workspace/ pgadmin4/web/regression/ feature_utils/pgadmin_page.py" , line 122, in remove_server "' and @class='aciTreeItem']") File "/home/pivotal/workspace/ pgadmin4/web/regression/ feature_utils/pgadmin_page.py" , line 169, in find_by_xpath lambda driver: driver.find_element_by_xpath( xpath) File "/home/pivotal/workspace/ pgadmin4/web/regression/ feature_utils/pgadmin_page.py" , line 261, in wait_for_element return self._wait_for("element to exist", element_if_it_exists) File "/home/pivotal/workspace/ pgadmin4/web/regression/ feature_utils/pgadmin_page.py" , line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/ versions/python36/lib/python3. 6/site-packages/selenium/ webdriver/support/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions. TimeoutException: Message: Timed out waiting for element to exist ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.xss_ checks_file_manager_test. CheckFileManagerFeatureTest) Tests to check if File manager is vulnerable to XSS ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/ pgadmin4/web/regression/ feature_utils/base_feature_ test.py", line 43, in setUp self.before() File "/home/pivotal/workspace/ pgadmin4/web/pgadmin/feature_ tests/xss_checks_file_manager_ test.py", line 37, in before self.page.add_server(self. server) File "/home/pivotal/workspace/ pgadmin4/web/regression/ feature_utils/pgadmin_page.py" , line 55, in add_server self.find_by_partial_link_ text("Server...").click() File "/home/pivotal/workspace/ pgadmin4/web/regression/ feature_utils/pgadmin_page.py" , line 185, in find_by_partial_link_text EC.element_to_be_clickable(( By.PARTIAL_LINK_TEXT, link_text)) File "/home/pivotal/workspace/ pgadmin4/web/regression/ feature_utils/pgadmin_page.py" , line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/ versions/python36/lib/python3. 6/site-packages/selenium/ webdriver/support/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions. TimeoutException: Message: Timed out waiting for link with text "Server..." ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.xss_ checks_panels_and_query_tool_ test.CheckForXssFeatureTest) Test XSS check for panels and query tool ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/ pgadmin4/web/pgadmin/feature_ tests/xss_checks_panels_and_ query_tool_test.py", line 57, in runTest self.page.add_server(self. server) File "/home/pivotal/workspace/ pgadmin4/web/regression/ feature_utils/pgadmin_page.py" , line 55, in add_server self.find_by_partial_link_ text("Server...").click() File "/home/pivotal/workspace/ pgadmin4/web/regression/ feature_utils/pgadmin_page.py" , line 185, in find_by_partial_link_text EC.element_to_be_clickable(( By.PARTIAL_LINK_TEXT, link_text)) File "/home/pivotal/workspace/ pgadmin4/web/regression/ feature_utils/pgadmin_page.py" , line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/ versions/python36/lib/python3. 6/site-packages/selenium/ webdriver/support/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions. TimeoutException: Message: Timed out waiting for link with text "Server..." ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.xss_ checks_panels_and_query_tool_ test.CheckForXssFeatureTest) Test XSS check for panels and query tool ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/ pgadmin4/web/regression/ feature_utils/base_feature_ test.py", line 66, in tearDown self.after() File "/home/pivotal/workspace/ pgadmin4/web/pgadmin/feature_ tests/xss_checks_panels_and_ query_tool_test.py", line 69, in after self.page.remove_server(self. server) File "/home/pivotal/workspace/ pgadmin4/web/regression/ feature_utils/pgadmin_page.py" , line 122, in remove_server "' and @class='aciTreeItem']") File "/home/pivotal/workspace/ pgadmin4/web/regression/ feature_utils/pgadmin_page.py" , line 169, in find_by_xpath lambda driver: driver.find_element_by_xpath( xpath) File "/home/pivotal/workspace/ pgadmin4/web/regression/ feature_utils/pgadmin_page.py" , line 261, in wait_for_element return self._wait_for("element to exist", element_if_it_exists) File "/home/pivotal/workspace/ pgadmin4/web/regression/ feature_utils/pgadmin_page.py" , line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/ versions/python36/lib/python3. 6/site-packages/selenium/ webdriver/support/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions. TimeoutException: Message: Timed out waiting for element to exist ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.xss_ checks_pgadmin_debugger_test. CheckDebuggerForXssFeatureTest ) Tests to check if Debugger is vulnerable to XSS ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/ pgadmin4/web/pgadmin/feature_ tests/xss_checks_pgadmin_ debugger_test.py", line 41, in runTest self.page.add_server(self. server) File "/home/pivotal/workspace/ pgadmin4/web/regression/ feature_utils/pgadmin_page.py" , line 55, in add_server self.find_by_partial_link_ text("Server...").click() File "/home/pivotal/workspace/ pgadmin4/web/regression/ feature_utils/pgadmin_page.py" , line 185, in find_by_partial_link_text EC.element_to_be_clickable(( By.PARTIAL_LINK_TEXT, link_text)) File "/home/pivotal/workspace/ pgadmin4/web/regression/ feature_utils/pgadmin_page.py" , line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/ versions/python36/lib/python3. 6/site-packages/selenium/ webdriver/support/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions. TimeoutException: Message: Timed out waiting for link with text "Server..." ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.xss_ checks_pgadmin_debugger_test. CheckDebuggerForXssFeatureTest ) Tests to check if Debugger is vulnerable to XSS ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/ pgadmin4/web/regression/ feature_utils/base_feature_ test.py", line 66, in tearDown self.after() File "/home/pivotal/workspace/ pgadmin4/web/pgadmin/feature_ tests/xss_checks_pgadmin_ debugger_test.py", line 46, in after self.page.remove_server(self. server) File "/home/pivotal/workspace/ pgadmin4/web/regression/ feature_utils/pgadmin_page.py" , line 122, in remove_server "' and @class='aciTreeItem']") File "/home/pivotal/workspace/ pgadmin4/web/regression/ feature_utils/pgadmin_page.py" , line 169, in find_by_xpath lambda driver: driver.find_element_by_xpath( xpath) File "/home/pivotal/workspace/ pgadmin4/web/regression/ feature_utils/pgadmin_page.py" , line 261, in wait_for_element return self._wait_for("element to exist", element_if_it_exists) File "/home/pivotal/workspace/ pgadmin4/web/regression/ feature_utils/pgadmin_page.py" , line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/ versions/python36/lib/python3. 6/site-packages/selenium/ webdriver/support/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions. TimeoutException: Message: Timed out waiting for element to exist ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.xss_ checks_roles_control_test. CheckRoleMembershipControlFeat ureTest) Tests to check if Role membership control is vulnerable to XSS ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/ pgadmin4/web/pgadmin/feature_ tests/xss_checks_roles_ control_test.py", line 37, in runTest self.page.add_server(self. server) File "/home/pivotal/workspace/ pgadmin4/web/regression/ feature_utils/pgadmin_page.py" , line 55, in add_server self.find_by_partial_link_ text("Server...").click() File "/home/pivotal/workspace/ pgadmin4/web/regression/ feature_utils/pgadmin_page.py" , line 185, in find_by_partial_link_text EC.element_to_be_clickable(( By.PARTIAL_LINK_TEXT, link_text)) File "/home/pivotal/workspace/ pgadmin4/web/regression/ feature_utils/pgadmin_page.py" , line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/ versions/python36/lib/python3. 6/site-packages/selenium/ webdriver/support/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions. TimeoutException: Message: Timed out waiting for link with text "Server..." ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.xss_ checks_roles_control_test. CheckRoleMembershipControlFeat ureTest) Tests to check if Role membership control is vulnerable to XSS ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/ pgadmin4/web/regression/ feature_utils/base_feature_ test.py", line 66, in tearDown self.after() File "/home/pivotal/workspace/ pgadmin4/web/pgadmin/feature_ tests/xss_checks_roles_ control_test.py", line 42, in after self.page.remove_server(self. server) File "/home/pivotal/workspace/ pgadmin4/web/regression/ feature_utils/pgadmin_page.py" , line 122, in remove_server "' and @class='aciTreeItem']") File "/home/pivotal/workspace/ pgadmin4/web/regression/ feature_utils/pgadmin_page.py" , line 169, in find_by_xpath lambda driver: driver.find_element_by_xpath( xpath) File "/home/pivotal/workspace/ pgadmin4/web/regression/ feature_utils/pgadmin_page.py" , line 261, in wait_for_element return self._wait_for("element to exist", element_if_it_exists) File "/home/pivotal/workspace/ pgadmin4/web/regression/ feature_utils/pgadmin_page.py" , line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/ versions/python36/lib/python3. 6/site-packages/selenium/ webdriver/support/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions. TimeoutException: Message: Timed out waiting for element to exist ------------------------------ ------------------------------ ---------- Ran 11 tests in 441.881s FAILED (errors=13) ============================== ============================== ========== Test Result Summary ============================== ============================== ========== PostgreSQL 10: 2 tests passed 9 tests failed: CopySelectedQueryResultsFeatur eTest (Copy rows, column using button and keyboard shortcut) PGDataypeFeatureTest (Test checks for PG data-types output) QueryToolJourneyTest (Tests the path through the query tool) QueryToolFeatureTest (Query tool feature test) CheckForViewDataTest (Validate Insert, Update operations in View/Edit data with given test data) CheckFileManagerFeatureTest (Tests to check if File manager is vulnerable to XSS) CheckForXssFeatureTest (Test XSS check for panels and query tool) CheckDebuggerForXssFeatureTest (Tests to check if Debugger is vulnerable to XSS) CheckRoleMembershipControlFeat ureTest (Tests to check if Role membership control is vulnerable to XSS) 0 tests skipped ============================== ============================== ========== All the above tests fail in the following place:Also the tests will never end because firefox is waiting for the user to click "Leave the page" button.ThanksVictoria & JoaoHi Hackers,On Mon, Apr 23, 2018 at 9:07 PM, Anthony Emengo <aemengo@pivotal.io> wrote:We also tried running the tests with this patch. It didn't launch without some code changes and several tests were failing. We should really defer pulling this in until we have more robust results on FirefoxIn order to have the tests running we had to do the following change:diff --git a/web/regression/feature_utils/app_starter.py b/web/regression/feature_ utils/app_starter.py index 77b0400c..50d3e307 100644--- a/web/regression/feature_utils/app_starter.py +++ b/web/regression/feature_utils/app_starter.py @@ -42,10 +44,18 @@ class AppStarter:)self.driver.set_window_size(1280, 1024) - self.driver.get(- "http://" + self.app_config.DEFAULT_SERVER + ":" +- random_server_port- )+ # self.driver.implicitly_wait(60) ++ def launch_browser():+ try:+ self.driver.get(+ "http://" + self.app_config.DEFAULT_SERVER + ":" ++ random_server_port+ )+ except WebDriverException as e:+ time.sleep(5)+ launch_browser()+ launch_browser()This change was required because firefox was throwing an exception when we tried to get the address and the server was not running. We saw this behavior in Ubuntu.Yes I have faced the same problem in Ubuntu. As per suggestion by Dave I have added parameter in test_config.json.in and also include the above code given by Anthony.Attached is the modified patch.- Anthony and JoaoOn Mon, Apr 23, 2018 at 9:12 AM, Dave Page <dpage@pgadmin.org> wrote:HiOn Mon, Apr 23, 2018 at 2:05 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote: Hi Hackers,I have added support for running feature tests against FireFox. For that user will have to download gecko driver from https://github.com/mozilla/geckodriver/releases and follow the below steps:
- Extract the gecko driver.
- Run chmod +x geckodriver.
- Either copy the geckodriver to /usr/local/bin or the path of the geckodriver must be specified in PATH.
- Apply the attached patch.
- Change the parameter "DEFAULT_TEST_BROWSER = 'Firefox' "
- Start the feature test.
The config option needs to be in test_config.json. We don't really want test-specific config options in config.py (arguably, TEST_SQLITE_PATH shoudn't be there either, as it's useless for end users).I'm surprised to not see any updates to tests. When I tried firefox manually a few weeks back, it was failing at lot.--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Attachment
Re: [pgAdmin4][Patch] Feature #3270 Add support for running regression tests against Firefox
Any progress on this Akshay?
python runtests.py --pkg feature_tests --default_browser firefox
- We faced lots of Timeout issues, to fixed that i have increase the timeout from 0.01 seconds to 0.05 for WebDriverWait in pgadmin_page.py.
- Added time.sleep for "Tests to check if file manager is vulnerable to XSS".
ERROR: runTest (pgadmin.feature_tests.view_data_dml_queries.CheckForViewDataTest)
Validate Insert, Update operations in View/Edit data with given test data
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/akshay/Development/pgadmin4/web/pgadmin/feature_tests/view_data_dml_queries.py", line 123, in runTest
self._add_row()
File "/Users/akshay/Development/pgadmin4/web/pgadmin/feature_tests/view_data_dml_queries.py", line 296, in _add_row
self._update_cell(cell_xpath, config_data[str(idx)])
File "/Users/akshay/Development/pgadmin4/web/pgadmin/feature_tests/view_data_dml_queries.py", line 189, in _update_cell
cell_el
File "/Users/akshay/Development/Workspace_3.5/lib/python3.5/site-packages/selenium/webdriver/common/action_chains.py", line 80, in perform
self.w3c_actions.perform()
File "/Users/akshay/Development/Workspace_3.5/lib/python3.5/site-packages/selenium/webdriver/common/actions/action_builder.py", line 76, in perform
self.driver.execute(Command.W3C_ACTIONS, enc)
File "/Users/akshay/Development/Workspace_3.5/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 312, in execute
self.error_handler.check_response(response)
File "/Users/akshay/Development/Workspace_3.5/lib/python3.5/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.MoveTargetOutOfBoundsException: Message: (1120.5, 289.29998779296875) is out of bounds of viewport width (1067) and height (728)
======================================================================
FAIL: runTest (pgadmin.feature_tests.copy_selected_query_results_feature_test.CopySelectedQueryResultsFeatureTest)
Copy rows, column using button and keyboard shortcut
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/akshay/Development/pgadmin4/web/pgadmin/feature_tests/copy_selected_query_results_feature_test.py", line 64, in runTest
self._mouseup_outside_grid_still_makes_a_selection()
File "/Users/akshay/Development/pgadmin4/web/pgadmin/feature_tests/copy_selected_query_results_feature_test.py", line 203, in _mouseup_outside_grid_still_makes_a_selection
self.assertEqual('"cool info"', pyperclip.paste())
AssertionError: '"cool info"' != '"some info"\n"some other info"\n"cool info"'
- "cool info"
+ "some info"
"some other info"
"cool info"
Attached is the modified patch, please review and let me know the review comments.
On Tue, Apr 24, 2018 at 3:34 PM, Joao De Almeida Pereira <jdealmeidapereira@pivotal.io> wrote:Hi Akshay,Linter fails and tests are failing when we run the patch on our machine using Firefox. The linter output is:./regression/runtests.py:184: [E125] continuation line with same indent as next logical line./regression/runtests.py:184: [E501] line too long (80 > 79 characters)1 E125 continuation line with same indent as next logical line1 E501 line too long (80 > 79 characters)2The tests output is:=============Running the test cases for 'PostgreSQL 10'============= runTest (pgadmin.feature_tests.copy_se
lected_query_results_feature_ test.CopySelectedQueryResultsF eatureTest) Copy rows, column using button and keyboard shortcut ... ERROR runTest (pgadmin.feature_tests.keyboar d_shortcut_test.KeyboardShortc utFeatureTest) Test for keyboard shortcut ... Executing shortcut: File main menu...OK Executing shortcut: Object main menu...OK ok runTest (pgadmin.feature_tests.pg_data type_validation_test.PGDataype FeatureTest) Test checks for PG data-types output ... ERROR runTest (pgadmin.feature_tests.query_t ool_journey_test.QueryToolJour neyTest) Tests the path through the query tool ... ERROR runTest (pgadmin.feature_tests.query_t ool_tests.QueryToolFeatureTest ) Query tool feature test ... On demand query result... On demand result set on scrolling... OK. On demand result set on grid select all... OK. On demand result set on column select all... OK. Explain query with verbose and cost... ERROR runTest (pgadmin.feature_tests.table_d dl_feature_test.TableDdlFeatur eTest) Test table DDL generation ... ok runTest (pgadmin.feature_tests.view_da ta_dml_queries.CheckForViewDat aTest) Validate Insert, Update operations in View/Edit data with given test data ... ERROR ERROR runTest (pgadmin.feature_tests.xss_che cks_file_manager_test.CheckFil eManagerFeatureTest) Tests to check if File manager is vulnerable to XSS ... ERROR runTest (pgadmin.feature_tests.xss_che cks_panels_and_query_tool_test .CheckForXssFeatureTest) Test XSS check for panels and query tool ... ERROR ERROR runTest (pgadmin.feature_tests.xss_che cks_pgadmin_debugger_test.Chec kDebuggerForXssFeatureTest) Tests to check if Debugger is vulnerable to XSS ... ERROR ERROR runTest (pgadmin.feature_tests.xss_che cks_roles_control_test.CheckRo leMembershipControlFeatureTest ) Tests to check if Role membership control is vulnerable to XSS^[ ... Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/regression/python_ test_utils/test_utils.py", line 338, in create_role sql_query psycopg2.ProgrammingError: role "test_role" already exists Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/regression/python_ test_utils/test_utils.py", line 338, in create_role sql_query psycopg2.ProgrammingError: role "<h1>test</h1>" already exists ERROR ERROR ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.copy_se lected_query_results_feature_ test.CopySelectedQueryResultsF eatureTest) Copy rows, column using button and keyboard shortcut ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ copy_selected_query_results_ feature_test.py", line 57, in runTest self._copies_rows() File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ copy_selected_query_results_ feature_test.py", line 67, in _copies_rows pyperclip.copy("old clipboard contents") File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site- packages/pyperclip/__init__. py", line 574, in lazy_load_stub_copy return copy(text) File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site- packages/pyperclip/__init__. py", line 284, in __call__ raise PyperclipException(EXCEPT_MSG) pyperclip.PyperclipException: Pyperclip could not find a copy/paste mechanism for your system. For more information, please visit https://pyperclip.readthedocs. io/en/latest/introduction.html #not-implemented-error ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.pg_data type_validation_test.PGDataype FeatureTest) Test checks for PG data-types output ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ pg_datatype_validation_test. py", line 135, in runTest self._check_datatype() File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ pg_datatype_validation_test. py", line 169, in _check_datatype "contains(.,'{}')]".format(bat ch['datatype'][0]) File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site- packages/selenium/webdriver/ support/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.Tim eoutException: Message: ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.query_t ool_journey_test.QueryToolJour neyTest) Tests the path through the query tool ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ query_tool_journey_test.py", line 49, in runTest self._test_copies_rows() File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ query_tool_journey_test.py", line 54, in _test_copies_rows pyperclip.copy("old clipboard contents") File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site- packages/pyperclip/__init__. py", line 284, in __call__ raise PyperclipException(EXCEPT_MSG) pyperclip.PyperclipException: Pyperclip could not find a copy/paste mechanism for your system. For more information, please visit https://pyperclip.readthedocs. io/en/latest/introduction.html #not-implemented-error ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.query_t ool_tests.QueryToolFeatureTest ) Query tool feature test ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ query_tool_tests.py", line 59, in runTest self._query_tool_explain_with_ verbose_and_cost() File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ query_tool_tests.py", line 262, in _query_tool_explain_with_verbo se_and_cost self.page.find_by_id("btn-expl ain-costs").click() File "/home/pivotal/workspace/pgadm in4/web/regression/feature_ utils/pgadmin_page.py", line 174, in find_by_id lambda driver: driver.find_element_by_id(elem ent_id) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_ utils/pgadmin_page.py", line 261, in wait_for_element return self._wait_for("element to exist", element_if_it_exists) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_ utils/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site- packages/selenium/webdriver/ support/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.Tim eoutException: Message: Timed out waiting for element to exist ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.view_da ta_dml_queries.CheckForViewDat aTest) Validate Insert, Update operations in View/Edit data with given test data ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ view_data_dml_queries.py", line 114, in runTest self.page.add_server(self.serv er) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_ utils/pgadmin_page.py", line 55, in add_server self.find_by_partial_link_text ("Server...").click() File "/home/pivotal/workspace/pgadm in4/web/regression/feature_ utils/pgadmin_page.py", line 185, in find_by_partial_link_text EC.element_to_be_clickable((By .PARTIAL_LINK_TEXT, link_text)) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_ utils/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site- packages/selenium/webdriver/ support/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.Tim eoutException: Message: Timed out waiting for link with text "Server..." ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.view_da ta_dml_queries.CheckForViewDat aTest) Validate Insert, Update operations in View/Edit data with given test data ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/regression/feature_ utils/base_feature_test.py", line 66, in tearDown self.after() File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ view_data_dml_queries.py", line 132, in after self.page.remove_server(self.s erver) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_ utils/pgadmin_page.py", line 122, in remove_server "' and @class='aciTreeItem']") File "/home/pivotal/workspace/pgadm in4/web/regression/feature_ utils/pgadmin_page.py", line 169, in find_by_xpath lambda driver: driver.find_element_by_xpath(x path) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_ utils/pgadmin_page.py", line 261, in wait_for_element return self._wait_for("element to exist", element_if_it_exists) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_ utils/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site- packages/selenium/webdriver/ support/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.Tim eoutException: Message: Timed out waiting for element to exist ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.xss_che cks_file_manager_test.CheckFil eManagerFeatureTest) Tests to check if File manager is vulnerable to XSS ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/regression/feature_ utils/base_feature_test.py", line 43, in setUp self.before() File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ xss_checks_file_manager_test. py", line 37, in before self.page.add_server(self.serv er) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_ utils/pgadmin_page.py", line 55, in add_server self.find_by_partial_link_text ("Server...").click() File "/home/pivotal/workspace/pgadm in4/web/regression/feature_ utils/pgadmin_page.py", line 185, in find_by_partial_link_text EC.element_to_be_clickable((By .PARTIAL_LINK_TEXT, link_text)) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_ utils/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site- packages/selenium/webdriver/ support/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.Tim eoutException: Message: Timed out waiting for link with text "Server..." ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.xss_che cks_panels_and_query_tool_test .CheckForXssFeatureTest) Test XSS check for panels and query tool ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ xss_checks_panels_and_query_ tool_test.py", line 57, in runTest self.page.add_server(self.serv er) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_ utils/pgadmin_page.py", line 55, in add_server self.find_by_partial_link_text ("Server...").click() File "/home/pivotal/workspace/pgadm in4/web/regression/feature_ utils/pgadmin_page.py", line 185, in find_by_partial_link_text EC.element_to_be_clickable((By .PARTIAL_LINK_TEXT, link_text)) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_ utils/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site- packages/selenium/webdriver/ support/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.Tim eoutException: Message: Timed out waiting for link with text "Server..." ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.xss_che cks_panels_and_query_tool_test .CheckForXssFeatureTest) Test XSS check for panels and query tool ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/regression/feature_ utils/base_feature_test.py", line 66, in tearDown self.after() File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ xss_checks_panels_and_query_ tool_test.py", line 69, in after self.page.remove_server(self.s erver) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_ utils/pgadmin_page.py", line 122, in remove_server "' and @class='aciTreeItem']") File "/home/pivotal/workspace/pgadm in4/web/regression/feature_ utils/pgadmin_page.py", line 169, in find_by_xpath lambda driver: driver.find_element_by_xpath(x path) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_ utils/pgadmin_page.py", line 261, in wait_for_element return self._wait_for("element to exist", element_if_it_exists) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_ utils/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site- packages/selenium/webdriver/ support/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.Tim eoutException: Message: Timed out waiting for element to exist ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.xss_che cks_pgadmin_debugger_test.Chec kDebuggerForXssFeatureTest) Tests to check if Debugger is vulnerable to XSS ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ xss_checks_pgadmin_debugger_ test.py", line 41, in runTest self.page.add_server(self.serv er) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_ utils/pgadmin_page.py", line 55, in add_server self.find_by_partial_link_text ("Server...").click() File "/home/pivotal/workspace/pgadm in4/web/regression/feature_ utils/pgadmin_page.py", line 185, in find_by_partial_link_text EC.element_to_be_clickable((By .PARTIAL_LINK_TEXT, link_text)) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_ utils/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site- packages/selenium/webdriver/ support/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.Tim eoutException: Message: Timed out waiting for link with text "Server..." ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.xss_che cks_pgadmin_debugger_test.Chec kDebuggerForXssFeatureTest) Tests to check if Debugger is vulnerable to XSS ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/regression/feature_ utils/base_feature_test.py", line 66, in tearDown self.after() File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ xss_checks_pgadmin_debugger_ test.py", line 46, in after self.page.remove_server(self.s erver) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_ utils/pgadmin_page.py", line 122, in remove_server "' and @class='aciTreeItem']") File "/home/pivotal/workspace/pgadm in4/web/regression/feature_ utils/pgadmin_page.py", line 169, in find_by_xpath lambda driver: driver.find_element_by_xpath(x path) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_ utils/pgadmin_page.py", line 261, in wait_for_element return self._wait_for("element to exist", element_if_it_exists) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_ utils/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site- packages/selenium/webdriver/ support/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.Tim eoutException: Message: Timed out waiting for element to exist ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.xss_che cks_roles_control_test.CheckRo leMembershipControlFeatureTest ) Tests to check if Role membership control is vulnerable to XSS ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ xss_checks_roles_control_test. py", line 37, in runTest self.page.add_server(self.serv er) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_ utils/pgadmin_page.py", line 55, in add_server self.find_by_partial_link_text ("Server...").click() File "/home/pivotal/workspace/pgadm in4/web/regression/feature_ utils/pgadmin_page.py", line 185, in find_by_partial_link_text EC.element_to_be_clickable((By .PARTIAL_LINK_TEXT, link_text)) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_ utils/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site- packages/selenium/webdriver/ support/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.Tim eoutException: Message: Timed out waiting for link with text "Server..." ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.xss_che cks_roles_control_test.CheckRo leMembershipControlFeatureTest ) Tests to check if Role membership control is vulnerable to XSS ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/regression/feature_ utils/base_feature_test.py", line 66, in tearDown self.after() File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ xss_checks_roles_control_test. py", line 42, in after self.page.remove_server(self.s erver) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_ utils/pgadmin_page.py", line 122, in remove_server "' and @class='aciTreeItem']") File "/home/pivotal/workspace/pgadm in4/web/regression/feature_ utils/pgadmin_page.py", line 169, in find_by_xpath lambda driver: driver.find_element_by_xpath(x path) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_ utils/pgadmin_page.py", line 261, in wait_for_element return self._wait_for("element to exist", element_if_it_exists) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_ utils/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site- packages/selenium/webdriver/ support/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.Tim eoutException: Message: Timed out waiting for element to exist ------------------------------ ------------------------------ ---------- Ran 11 tests in 441.881s FAILED (errors=13) ============================== ============================== ========== Test Result Summary ============================== ============================== ========== PostgreSQL 10: 2 tests passed 9 tests failed: CopySelectedQueryResultsFeatur eTest (Copy rows, column using button and keyboard shortcut) PGDataypeFeatureTest (Test checks for PG data-types output) QueryToolJourneyTest (Tests the path through the query tool) QueryToolFeatureTest (Query tool feature test) CheckForViewDataTest (Validate Insert, Update operations in View/Edit data with given test data) CheckFileManagerFeatureTest (Tests to check if File manager is vulnerable to XSS) CheckForXssFeatureTest (Test XSS check for panels and query tool) CheckDebuggerForXssFeatureTest (Tests to check if Debugger is vulnerable to XSS) CheckRoleMembershipControlFeat ureTest (Tests to check if Role membership control is vulnerable to XSS) 0 tests skipped ============================== ============================== ========== All the above tests fail in the following place:Also the tests will never end because firefox is waiting for the user to click "Leave the page" button.ThanksVictoria & JoaoHi Hackers,On Mon, Apr 23, 2018 at 9:07 PM, Anthony Emengo <aemengo@pivotal.io> wrote:We also tried running the tests with this patch. It didn't launch without some code changes and several tests were failing. We should really defer pulling this in until we have more robust results on FirefoxIn order to have the tests running we had to do the following change:diff --git a/web/regression/feature_utils/app_starter.py b/web/regression/feature_utils /app_starter.py index 77b0400c..50d3e307 100644--- a/web/regression/feature_utils/app_starter.py +++ b/web/regression/feature_utils/app_starter.py @@ -42,10 +44,18 @@ class AppStarter:)self.driver.set_window_size(1280, 1024) - self.driver.get(- "http://" + self.app_config.DEFAULT_SERVER + ":" +- random_server_port- )+ # self.driver.implicitly_wait(60) ++ def launch_browser():+ try:+ self.driver.get(+ "http://" + self.app_config.DEFAULT_SERVER + ":" ++ random_server_port+ )+ except WebDriverException as e:+ time.sleep(5)+ launch_browser()+ launch_browser()This change was required because firefox was throwing an exception when we tried to get the address and the server was not running. We saw this behavior in Ubuntu.Yes I have faced the same problem in Ubuntu. As per suggestion by Dave I have added parameter in test_config.json.in and also include the above code given by Anthony.Attached is the modified patch.- Anthony and JoaoOn Mon, Apr 23, 2018 at 9:12 AM, Dave Page <dpage@pgadmin.org> wrote:HiOn Mon, Apr 23, 2018 at 2:05 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote: Hi Hackers,I have added support for running feature tests against FireFox. For that user will have to download gecko driver from https://github.com/mozilla/geckodriver/releases and follow the below steps:
- Extract the gecko driver.
- Run chmod +x geckodriver.
- Either copy the geckodriver to /usr/local/bin or the path of the geckodriver must be specified in PATH.
- Apply the attached patch.
- Change the parameter "DEFAULT_TEST_BROWSER = 'Firefox' "
- Start the feature test.
The config option needs to be in test_config.json. We don't really want test-specific config options in config.py (arguably, TEST_SQLITE_PATH shoudn't be there either, as it's useless for end users).I'm surprised to not see any updates to tests. When I tried firefox manually a few weeks back, it was failing at lot.--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Mobile: +91 976-788-8246
Attachment
Re: [pgAdmin4][Patch] Feature #3270 Add support for running regression tests against Firefox
Hi Hackers,On Fri, May 4, 2018 at 2:48 PM, Dave Page <dpage@pgadmin.org> wrote:Any progress on this Akshay?I have fixed Linter issues and try to fix the test cases as many as possible. Apart from this I have added "default_browser" parameter in "test_config.json.in" file and also added logic to provide default browser from command line. To run from command line use as below:python runtests.py --pkg feature_tests --default_browser firefox
Command line argument will overwrite the settings of "test_config.json.in" file.The showstopper issue when I run feature tests in FireFox is every time "fe_sendauth" error comes on my machine when a new server has been added for testing. Browser stops here and rest of the test cases will fail. To fix this I have added sleep of 0.5 seconds between entering the password and click on 'Save' button.Apart from above following changes I have made:As I know time.sleep is not a good idea and I am new to feature test and in learning phase, can someone correct/suggest the way to fix those issues.
- We faced lots of Timeout issues, to fixed that i have increase the timeout from 0.01 seconds to 0.05 for WebDriverWait in pgadmin_page.py.
- Added time.sleep for "Tests to check if file manager is vulnerable to XSS".
Following test cases are still failing and I am not able to resolve those:ERROR: runTest (pgadmin.feature_tests.view_
data_dml_queries. CheckForViewDataTest) Validate Insert, Update operations in View/Edit data with given test data
------------------------------
------------------------------ ---------- Traceback (most recent call last):
File "/Users/akshay/Development/
pgadmin4/web/pgadmin/feature_ tests/view_data_dml_queries. py", line 123, in runTest self._add_row()
File "/Users/akshay/Development/
pgadmin4/web/pgadmin/feature_ tests/view_data_dml_queries. py", line 296, in _add_row self._update_cell(cell_
xpath, config_data[str(idx)]) File "/Users/akshay/Development/
pgadmin4/web/pgadmin/feature_ tests/view_data_dml_queries. py", line 189, in _update_cell cell_el
File "/Users/akshay/Development/
Workspace_3.5/lib/python3.5/ site-packages/selenium/ webdriver/common/action_ chains.py", line 80, in perform self.w3c_actions.perform()
File "/Users/akshay/Development/
Workspace_3.5/lib/python3.5/ site-packages/selenium/ webdriver/common/actions/ action_builder.py", line 76, in perform self.driver.execute(Command.
W3C_ACTIONS, enc) File "/Users/akshay/Development/
Workspace_3.5/lib/python3.5/ site-packages/selenium/ webdriver/remote/webdriver.py" , line 312, in execute self.error_handler.check_
response(response) File "/Users/akshay/Development/
Workspace_3.5/lib/python3.5/ site-packages/selenium/ webdriver/remote/errorhandler. py", line 242, in check_response raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.
MoveTargetOutOfBoundsException : Message: (1120.5, 289.29998779296875) is out of bounds of viewport width (1067) and height (728)
==============================
============================== ========== FAIL: runTest (pgadmin.feature_tests.copy_
selected_query_results_ feature_test. CopySelectedQueryResultsFeatur eTest) Copy rows, column using button and keyboard shortcut
------------------------------
------------------------------ ---------- Traceback (most recent call last):
File "/Users/akshay/Development/
pgadmin4/web/pgadmin/feature_ tests/copy_selected_query_ results_feature_test.py", line 64, in runTest self._mouseup_outside_grid_
still_makes_a_selection() File "/Users/akshay/Development/
pgadmin4/web/pgadmin/feature_ tests/copy_selected_query_ results_feature_test.py", line 203, in _mouseup_outside_grid_still_ makes_a_selection self.assertEqual('"cool info"', pyperclip.paste())
AssertionError: '"cool info"' != '"some info"\n"some other info"\n"cool info"'
- "cool info"
+ "some info"
"some other info"
"cool info"
Attached is the modified patch, please review and let me know the review comments.On Tue, Apr 24, 2018 at 3:34 PM, Joao De Almeida Pereira <jdealmeidapereira@pivotal.io> wrote:Hi Akshay,Linter fails and tests are failing when we run the patch on our machine using Firefox. The linter output is:./regression/runtests.py:184: [E125] continuation line with same indent as next logical line./regression/runtests.py:184: [E501] line too long (80 > 79 characters)1 E125 continuation line with same indent as next logical line1 E501 line too long (80 > 79 characters)2The tests output is:=============Running the test cases for 'PostgreSQL 10'============= runTest (pgadmin.feature_tests.copy_se
lected_query_results_feature_t est.CopySelectedQueryResultsFe atureTest) Copy rows, column using button and keyboard shortcut ... ERROR runTest (pgadmin.feature_tests.keyboar d_shortcut_test.KeyboardShortc utFeatureTest) Test for keyboard shortcut ... Executing shortcut: File main menu...OK Executing shortcut: Object main menu...OK ok runTest (pgadmin.feature_tests.pg_data type_validation_test.PGDataype FeatureTest) Test checks for PG data-types output ... ERROR runTest (pgadmin.feature_tests.query_t ool_journey_test.QueryToolJour neyTest) Tests the path through the query tool ... ERROR runTest (pgadmin.feature_tests.query_t ool_tests.QueryToolFeatureTest ) Query tool feature test ... On demand query result... On demand result set on scrolling... OK. On demand result set on grid select all... OK. On demand result set on column select all... OK. Explain query with verbose and cost... ERROR runTest (pgadmin.feature_tests.table_d dl_feature_test.TableDdlFeatur eTest) Test table DDL generation ... ok runTest (pgadmin.feature_tests.view_da ta_dml_queries.CheckForViewDat aTest) Validate Insert, Update operations in View/Edit data with given test data ... ERROR ERROR runTest (pgadmin.feature_tests.xss_che cks_file_manager_test.CheckFil eManagerFeatureTest) Tests to check if File manager is vulnerable to XSS ... ERROR runTest (pgadmin.feature_tests.xss_che cks_panels_and_query_tool_test .CheckForXssFeatureTest) Test XSS check for panels and query tool ... ERROR ERROR runTest (pgadmin.feature_tests.xss_che cks_pgadmin_debugger_test.Chec kDebuggerForXssFeatureTest) Tests to check if Debugger is vulnerable to XSS ... ERROR ERROR runTest (pgadmin.feature_tests.xss_che cks_roles_control_test.CheckRo leMembershipControlFeatureTest ) Tests to check if Role membership control is vulnerable to XSS^[ ... Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/regression/python_test _utils/test_utils.py", line 338, in create_role sql_query psycopg2.ProgrammingError: role "test_role" already exists Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/regression/python_test _utils/test_utils.py", line 338, in create_role sql_query psycopg2.ProgrammingError: role "<h1>test</h1>" already exists ERROR ERROR ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.copy_se lected_query_results_feature_t est.CopySelectedQueryResultsFe atureTest) Copy rows, column using button and keyboard shortcut ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ copy_selected_query_results_fe ature_test.py", line 57, in runTest self._copies_rows() File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ copy_selected_query_results_fe ature_test.py", line 67, in _copies_rows pyperclip.copy("old clipboard contents") File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site-p ackages/pyperclip/__init__.py" , line 574, in lazy_load_stub_copy return copy(text) File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site-p ackages/pyperclip/__init__.py" , line 284, in __call__ raise PyperclipException(EXCEPT_MSG) pyperclip.PyperclipException: Pyperclip could not find a copy/paste mechanism for your system. For more information, please visit https://pyperclip.readthedocs. io/en/latest/introduction.html #not-implemented-error ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.pg_data type_validation_test.PGDataype FeatureTest) Test checks for PG data-types output ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ pg_datatype_validation_test.py ", line 135, in runTest self._check_datatype() File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ pg_datatype_validation_test.py ", line 169, in _check_datatype "contains(.,'{}')]".format(bat ch['datatype'][0]) File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site-p ackages/selenium/webdriver/sup port/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.Tim eoutException: Message: ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.query_t ool_journey_test.QueryToolJour neyTest) Tests the path through the query tool ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ query_tool_journey_test.py", line 49, in runTest self._test_copies_rows() File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ query_tool_journey_test.py", line 54, in _test_copies_rows pyperclip.copy("old clipboard contents") File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site-p ackages/pyperclip/__init__.py" , line 284, in __call__ raise PyperclipException(EXCEPT_MSG) pyperclip.PyperclipException: Pyperclip could not find a copy/paste mechanism for your system. For more information, please visit https://pyperclip.readthedocs. io/en/latest/introduction.html #not-implemented-error ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.query_t ool_tests.QueryToolFeatureTest ) Query tool feature test ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ query_tool_tests.py", line 59, in runTest self._query_tool_explain_with_ verbose_and_cost() File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ query_tool_tests.py", line 262, in _query_tool_explain_with_verbo se_and_cost self.page.find_by_id("btn-expl ain-costs").click() File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 174, in find_by_id lambda driver: driver.find_element_by_id(elem ent_id) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 261, in wait_for_element return self._wait_for("element to exist", element_if_it_exists) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site-p ackages/selenium/webdriver/sup port/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.Tim eoutException: Message: Timed out waiting for element to exist ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.view_da ta_dml_queries.CheckForViewDat aTest) Validate Insert, Update operations in View/Edit data with given test data ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ view_data_dml_queries.py", line 114, in runTest self.page.add_server(self.serv er) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 55, in add_server self.find_by_partial_link_text ("Server...").click() File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 185, in find_by_partial_link_text EC.element_to_be_clickable((By .PARTIAL_LINK_TEXT, link_text)) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site-p ackages/selenium/webdriver/sup port/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.Tim eoutException: Message: Timed out waiting for link with text "Server..." ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.view_da ta_dml_queries.CheckForViewDat aTest) Validate Insert, Update operations in View/Edit data with given test data ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/base_feature_test.py", line 66, in tearDown self.after() File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ view_data_dml_queries.py", line 132, in after self.page.remove_server(self.s erver) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 122, in remove_server "' and @class='aciTreeItem']") File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 169, in find_by_xpath lambda driver: driver.find_element_by_xpath(x path) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 261, in wait_for_element return self._wait_for("element to exist", element_if_it_exists) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site-p ackages/selenium/webdriver/sup port/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.Tim eoutException: Message: Timed out waiting for element to exist ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.xss_che cks_file_manager_test.CheckFil eManagerFeatureTest) Tests to check if File manager is vulnerable to XSS ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/base_feature_test.py", line 43, in setUp self.before() File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ xss_checks_file_manager_test.p y", line 37, in before self.page.add_server(self.serv er) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 55, in add_server self.find_by_partial_link_text ("Server...").click() File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 185, in find_by_partial_link_text EC.element_to_be_clickable((By .PARTIAL_LINK_TEXT, link_text)) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site-p ackages/selenium/webdriver/sup port/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.Tim eoutException: Message: Timed out waiting for link with text "Server..." ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.xss_che cks_panels_and_query_tool_test .CheckForXssFeatureTest) Test XSS check for panels and query tool ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ xss_checks_panels_and_query_to ol_test.py", line 57, in runTest self.page.add_server(self.serv er) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 55, in add_server self.find_by_partial_link_text ("Server...").click() File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 185, in find_by_partial_link_text EC.element_to_be_clickable((By .PARTIAL_LINK_TEXT, link_text)) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site-p ackages/selenium/webdriver/sup port/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.Tim eoutException: Message: Timed out waiting for link with text "Server..." ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.xss_che cks_panels_and_query_tool_test .CheckForXssFeatureTest) Test XSS check for panels and query tool ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/base_feature_test.py", line 66, in tearDown self.after() File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ xss_checks_panels_and_query_to ol_test.py", line 69, in after self.page.remove_server(self.s erver) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 122, in remove_server "' and @class='aciTreeItem']") File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 169, in find_by_xpath lambda driver: driver.find_element_by_xpath(x path) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 261, in wait_for_element return self._wait_for("element to exist", element_if_it_exists) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site-p ackages/selenium/webdriver/sup port/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.Tim eoutException: Message: Timed out waiting for element to exist ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.xss_che cks_pgadmin_debugger_test.Chec kDebuggerForXssFeatureTest) Tests to check if Debugger is vulnerable to XSS ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ xss_checks_pgadmin_debugger_te st.py", line 41, in runTest self.page.add_server(self.serv er) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 55, in add_server self.find_by_partial_link_text ("Server...").click() File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 185, in find_by_partial_link_text EC.element_to_be_clickable((By .PARTIAL_LINK_TEXT, link_text)) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site-p ackages/selenium/webdriver/sup port/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.Tim eoutException: Message: Timed out waiting for link with text "Server..." ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.xss_che cks_pgadmin_debugger_test.Chec kDebuggerForXssFeatureTest) Tests to check if Debugger is vulnerable to XSS ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/base_feature_test.py", line 66, in tearDown self.after() File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ xss_checks_pgadmin_debugger_te st.py", line 46, in after self.page.remove_server(self.s erver) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 122, in remove_server "' and @class='aciTreeItem']") File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 169, in find_by_xpath lambda driver: driver.find_element_by_xpath(x path) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 261, in wait_for_element return self._wait_for("element to exist", element_if_it_exists) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site-p ackages/selenium/webdriver/sup port/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.Tim eoutException: Message: Timed out waiting for element to exist ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.xss_che cks_roles_control_test.CheckRo leMembershipControlFeatureTest ) Tests to check if Role membership control is vulnerable to XSS ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ xss_checks_roles_control_test. py", line 37, in runTest self.page.add_server(self.serv er) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 55, in add_server self.find_by_partial_link_text ("Server...").click() File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 185, in find_by_partial_link_text EC.element_to_be_clickable((By .PARTIAL_LINK_TEXT, link_text)) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site-p ackages/selenium/webdriver/sup port/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.Tim eoutException: Message: Timed out waiting for link with text "Server..." ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.xss_che cks_roles_control_test.CheckRo leMembershipControlFeatureTest ) Tests to check if Role membership control is vulnerable to XSS ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/base_feature_test.py", line 66, in tearDown self.after() File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ xss_checks_roles_control_test. py", line 42, in after self.page.remove_server(self.s erver) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 122, in remove_server "' and @class='aciTreeItem']") File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 169, in find_by_xpath lambda driver: driver.find_element_by_xpath(x path) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 261, in wait_for_element return self._wait_for("element to exist", element_if_it_exists) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site-p ackages/selenium/webdriver/sup port/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.Tim eoutException: Message: Timed out waiting for element to exist ------------------------------ ------------------------------ ---------- Ran 11 tests in 441.881s FAILED (errors=13) ============================== ============================== ========== Test Result Summary ============================== ============================== ========== PostgreSQL 10: 2 tests passed 9 tests failed: CopySelectedQueryResultsFeatur eTest (Copy rows, column using button and keyboard shortcut) PGDataypeFeatureTest (Test checks for PG data-types output) QueryToolJourneyTest (Tests the path through the query tool) QueryToolFeatureTest (Query tool feature test) CheckForViewDataTest (Validate Insert, Update operations in View/Edit data with given test data) CheckFileManagerFeatureTest (Tests to check if File manager is vulnerable to XSS) CheckForXssFeatureTest (Test XSS check for panels and query tool) CheckDebuggerForXssFeatureTest (Tests to check if Debugger is vulnerable to XSS) CheckRoleMembershipControlFeat ureTest (Tests to check if Role membership control is vulnerable to XSS) 0 tests skipped ============================== ============================== ========== All the above tests fail in the following place:Also the tests will never end because firefox is waiting for the user to click "Leave the page" button.ThanksVictoria & JoaoHi Hackers,On Mon, Apr 23, 2018 at 9:07 PM, Anthony Emengo <aemengo@pivotal.io> wrote:We also tried running the tests with this patch. It didn't launch without some code changes and several tests were failing. We should really defer pulling this in until we have more robust results on FirefoxIn order to have the tests running we had to do the following change:diff --git a/web/regression/feature_utils/app_starter.py b/web/regression/feature_utils /app_starter.py index 77b0400c..50d3e307 100644--- a/web/regression/feature_utils/app_starter.py +++ b/web/regression/feature_utils/app_starter.py @@ -42,10 +44,18 @@ class AppStarter:)self.driver.set_window_size(1280, 1024) - self.driver.get(- "http://" + self.app_config.DEFAULT_SERVER + ":" +- random_server_port- )+ # self.driver.implicitly_wait(60) ++ def launch_browser():+ try:+ self.driver.get(+ "http://" + self.app_config.DEFAULT_SERVER + ":" ++ random_server_port+ )+ except WebDriverException as e:+ time.sleep(5)+ launch_browser()+ launch_browser()This change was required because firefox was throwing an exception when we tried to get the address and the server was not running. We saw this behavior in Ubuntu.Yes I have faced the same problem in Ubuntu. As per suggestion by Dave I have added parameter in test_config.json.in and also include the above code given by Anthony.Attached is the modified patch.- Anthony and JoaoOn Mon, Apr 23, 2018 at 9:12 AM, Dave Page <dpage@pgadmin.org> wrote:HiOn Mon, Apr 23, 2018 at 2:05 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote: Hi Hackers,I have added support for running feature tests against FireFox. For that user will have to download gecko driver from https://github.com/mozilla/geckodriver/releases and follow the below steps:
- Extract the gecko driver.
- Run chmod +x geckodriver.
- Either copy the geckodriver to /usr/local/bin or the path of the geckodriver must be specified in PATH.
- Apply the attached patch.
- Change the parameter "DEFAULT_TEST_BROWSER = 'Firefox' "
- Start the feature test.
The config option needs to be in test_config.json. We don't really want test-specific config options in config.py (arguably, TEST_SQLITE_PATH shoudn't be there either, as it's useless for end users).I'm surprised to not see any updates to tests. When I tried firefox manually a few weeks back, it was failing at lot.--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company--Akshay JoshiSr. Software ArchitectPhone: +91 20-3058-9517
Mobile: +91 976-788-8246
Mobile: +91 976-788-8246
Attachment
Re: [pgAdmin4][Patch] Feature #3270 Add support for running regression tests against Firefox
Ignore the previous patch. Attached is the latest oneOn Fri, May 4, 2018 at 2:59 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote: Hi Hackers,On Fri, May 4, 2018 at 2:48 PM, Dave Page <dpage@pgadmin.org> wrote:Any progress on this Akshay?I have fixed Linter issues and try to fix the test cases as many as possible. Apart from this I have added "default_browser" parameter in "test_config.json.in" file and also added logic to provide default browser from command line. To run from command line use as below:python runtests.py --pkg feature_tests --default_browser firefox
Command line argument will overwrite the settings of "test_config.json.in" file.The showstopper issue when I run feature tests in FireFox is every time "fe_sendauth" error comes on my machine when a new server has been added for testing. Browser stops here and rest of the test cases will fail. To fix this I have added sleep of 0.5 seconds between entering the password and click on 'Save' button.Apart from above following changes I have made:As I know time.sleep is not a good idea and I am new to feature test and in learning phase, can someone correct/suggest the way to fix those issues.
- We faced lots of Timeout issues, to fixed that i have increase the timeout from 0.01 seconds to 0.05 for WebDriverWait in pgadmin_page.py.
- Added time.sleep for "Tests to check if file manager is vulnerable to XSS".
Following test cases are still failing and I am not able to resolve those:ERROR: runTest (pgadmin.feature_tests.view_da
ta_dml_queries.CheckForViewDat aTest) Validate Insert, Update operations in View/Edit data with given test data
------------------------------
------------------------------ ---------- Traceback (most recent call last):
File "/Users/akshay/Development/pga
dmin4/web/pgadmin/feature_test s/view_data_dml_queries.py", line 123, in runTest self._add_row()
File "/Users/akshay/Development/pga
dmin4/web/pgadmin/feature_test s/view_data_dml_queries.py", line 296, in _add_row self._update_cell(cell_xpath
, config_data[str(idx)]) File "/Users/akshay/Development/pga
dmin4/web/pgadmin/feature_test s/view_data_dml_queries.py", line 189, in _update_cell cell_el
File "/Users/akshay/Development/Wor
kspace_3.5/lib/python3.5/site- packages/selenium/webdriver/ common/action_chains.py", line 80, in perform self.w3c_actions.perform()
File "/Users/akshay/Development/Wor
kspace_3.5/lib/python3.5/site- packages/selenium/webdriver/ common/actions/action_builder. py", line 76, in perform self.driver.execute(Command.
W3C_ACTIONS, enc) File "/Users/akshay/Development/Wor
kspace_3.5/lib/python3.5/site- packages/selenium/webdriver/ remote/webdriver.py", line 312, in execute self.error_handler.check_res
ponse(response) File "/Users/akshay/Development/Wor
kspace_3.5/lib/python3.5/site- packages/selenium/webdriver/ remote/errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.Mov
eTargetOutOfBoundsException: Message: (1120.5, 289.29998779296875) is out of bounds of viewport width (1067) and height (728)
==============================
============================== ========== FAIL: runTest (pgadmin.feature_tests.copy_se
lected_query_results_feature_ test.CopySelectedQueryResultsF eatureTest) Copy rows, column using button and keyboard shortcut
------------------------------
------------------------------ ---------- Traceback (most recent call last):
File "/Users/akshay/Development/pga
dmin4/web/pgadmin/feature_test s/copy_selected_query_results_ feature_test.py", line 64, in runTest self._mouseup_outside_grid_s
till_makes_a_selection() File "/Users/akshay/Development/pga
dmin4/web/pgadmin/feature_test s/copy_selected_query_results_ feature_test.py", line 203, in _mouseup_outside_grid_still_ma kes_a_selection self.assertEqual('"cool info"', pyperclip.paste())
AssertionError: '"cool info"' != '"some info"\n"some other info"\n"cool info"'
- "cool info"
+ "some info"
"some other info"
"cool info"
Attached is the modified patch, please review and let me know the review comments.On Tue, Apr 24, 2018 at 3:34 PM, Joao De Almeida Pereira <jdealmeidapereira@pivotal.io> wrote:Hi Akshay,Linter fails and tests are failing when we run the patch on our machine using Firefox. The linter output is:./regression/runtests.py:184: [E125] continuation line with same indent as next logical line./regression/runtests.py:184: [E501] line too long (80 > 79 characters)1 E125 continuation line with same indent as next logical line1 E501 line too long (80 > 79 characters)2The tests output is:=============Running the test cases for 'PostgreSQL 10'============= runTest (pgadmin.feature_tests.copy_se
lected_query_results_feature_t est.CopySelectedQueryResultsFe atureTest) Copy rows, column using button and keyboard shortcut ... ERROR runTest (pgadmin.feature_tests.keyboar d_shortcut_test.KeyboardShortc utFeatureTest) Test for keyboard shortcut ... Executing shortcut: File main menu...OK Executing shortcut: Object main menu...OK ok runTest (pgadmin.feature_tests.pg_data type_validation_test.PGDataype FeatureTest) Test checks for PG data-types output ... ERROR runTest (pgadmin.feature_tests.query_t ool_journey_test.QueryToolJour neyTest) Tests the path through the query tool ... ERROR runTest (pgadmin.feature_tests.query_t ool_tests.QueryToolFeatureTest ) Query tool feature test ... On demand query result... On demand result set on scrolling... OK. On demand result set on grid select all... OK. On demand result set on column select all... OK. Explain query with verbose and cost... ERROR runTest (pgadmin.feature_tests.table_d dl_feature_test.TableDdlFeatur eTest) Test table DDL generation ... ok runTest (pgadmin.feature_tests.view_da ta_dml_queries.CheckForViewDat aTest) Validate Insert, Update operations in View/Edit data with given test data ... ERROR ERROR runTest (pgadmin.feature_tests.xss_che cks_file_manager_test.CheckFil eManagerFeatureTest) Tests to check if File manager is vulnerable to XSS ... ERROR runTest (pgadmin.feature_tests.xss_che cks_panels_and_query_tool_test .CheckForXssFeatureTest) Test XSS check for panels and query tool ... ERROR ERROR runTest (pgadmin.feature_tests.xss_che cks_pgadmin_debugger_test.Chec kDebuggerForXssFeatureTest) Tests to check if Debugger is vulnerable to XSS ... ERROR ERROR runTest (pgadmin.feature_tests.xss_che cks_roles_control_test.CheckRo leMembershipControlFeatureTest ) Tests to check if Role membership control is vulnerable to XSS^[ ... Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/regression/python_test _utils/test_utils.py", line 338, in create_role sql_query psycopg2.ProgrammingError: role "test_role" already exists Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/regression/python_test _utils/test_utils.py", line 338, in create_role sql_query psycopg2.ProgrammingError: role "<h1>test</h1>" already exists ERROR ERROR ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.copy_se lected_query_results_feature_t est.CopySelectedQueryResultsFe atureTest) Copy rows, column using button and keyboard shortcut ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ copy_selected_query_results_fe ature_test.py", line 57, in runTest self._copies_rows() File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ copy_selected_query_results_fe ature_test.py", line 67, in _copies_rows pyperclip.copy("old clipboard contents") File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site-p ackages/pyperclip/__init__.py" , line 574, in lazy_load_stub_copy return copy(text) File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site-p ackages/pyperclip/__init__.py" , line 284, in __call__ raise PyperclipException(EXCEPT_MSG) pyperclip.PyperclipException: Pyperclip could not find a copy/paste mechanism for your system. For more information, please visit https://pyperclip.readthedocs. io/en/latest/introduction.html #not-implemented-error ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.pg_data type_validation_test.PGDataype FeatureTest) Test checks for PG data-types output ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ pg_datatype_validation_test.py ", line 135, in runTest self._check_datatype() File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ pg_datatype_validation_test.py ", line 169, in _check_datatype "contains(.,'{}')]".format(bat ch['datatype'][0]) File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site-p ackages/selenium/webdriver/sup port/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.Tim eoutException: Message: ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.query_t ool_journey_test.QueryToolJour neyTest) Tests the path through the query tool ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ query_tool_journey_test.py", line 49, in runTest self._test_copies_rows() File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ query_tool_journey_test.py", line 54, in _test_copies_rows pyperclip.copy("old clipboard contents") File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site-p ackages/pyperclip/__init__.py" , line 284, in __call__ raise PyperclipException(EXCEPT_MSG) pyperclip.PyperclipException: Pyperclip could not find a copy/paste mechanism for your system. For more information, please visit https://pyperclip.readthedocs. io/en/latest/introduction.html #not-implemented-error ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.query_t ool_tests.QueryToolFeatureTest ) Query tool feature test ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ query_tool_tests.py", line 59, in runTest self._query_tool_explain_with_ verbose_and_cost() File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ query_tool_tests.py", line 262, in _query_tool_explain_with_verbo se_and_cost self.page.find_by_id("btn-expl ain-costs").click() File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 174, in find_by_id lambda driver: driver.find_element_by_id(elem ent_id) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 261, in wait_for_element return self._wait_for("element to exist", element_if_it_exists) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site-p ackages/selenium/webdriver/sup port/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.Tim eoutException: Message: Timed out waiting for element to exist ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.view_da ta_dml_queries.CheckForViewDat aTest) Validate Insert, Update operations in View/Edit data with given test data ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ view_data_dml_queries.py", line 114, in runTest self.page.add_server(self.serv er) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 55, in add_server self.find_by_partial_link_text ("Server...").click() File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 185, in find_by_partial_link_text EC.element_to_be_clickable((By .PARTIAL_LINK_TEXT, link_text)) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site-p ackages/selenium/webdriver/sup port/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.Tim eoutException: Message: Timed out waiting for link with text "Server..." ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.view_da ta_dml_queries.CheckForViewDat aTest) Validate Insert, Update operations in View/Edit data with given test data ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/base_feature_test.py", line 66, in tearDown self.after() File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ view_data_dml_queries.py", line 132, in after self.page.remove_server(self.s erver) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 122, in remove_server "' and @class='aciTreeItem']") File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 169, in find_by_xpath lambda driver: driver.find_element_by_xpath(x path) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 261, in wait_for_element return self._wait_for("element to exist", element_if_it_exists) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site-p ackages/selenium/webdriver/sup port/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.Tim eoutException: Message: Timed out waiting for element to exist ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.xss_che cks_file_manager_test.CheckFil eManagerFeatureTest) Tests to check if File manager is vulnerable to XSS ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/base_feature_test.py", line 43, in setUp self.before() File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ xss_checks_file_manager_test.p y", line 37, in before self.page.add_server(self.serv er) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 55, in add_server self.find_by_partial_link_text ("Server...").click() File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 185, in find_by_partial_link_text EC.element_to_be_clickable((By .PARTIAL_LINK_TEXT, link_text)) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site-p ackages/selenium/webdriver/sup port/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.Tim eoutException: Message: Timed out waiting for link with text "Server..." ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.xss_che cks_panels_and_query_tool_test .CheckForXssFeatureTest) Test XSS check for panels and query tool ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ xss_checks_panels_and_query_to ol_test.py", line 57, in runTest self.page.add_server(self.serv er) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 55, in add_server self.find_by_partial_link_text ("Server...").click() File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 185, in find_by_partial_link_text EC.element_to_be_clickable((By .PARTIAL_LINK_TEXT, link_text)) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site-p ackages/selenium/webdriver/sup port/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.Tim eoutException: Message: Timed out waiting for link with text "Server..." ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.xss_che cks_panels_and_query_tool_test .CheckForXssFeatureTest) Test XSS check for panels and query tool ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/base_feature_test.py", line 66, in tearDown self.after() File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ xss_checks_panels_and_query_to ol_test.py", line 69, in after self.page.remove_server(self.s erver) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 122, in remove_server "' and @class='aciTreeItem']") File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 169, in find_by_xpath lambda driver: driver.find_element_by_xpath(x path) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 261, in wait_for_element return self._wait_for("element to exist", element_if_it_exists) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site-p ackages/selenium/webdriver/sup port/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.Tim eoutException: Message: Timed out waiting for element to exist ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.xss_che cks_pgadmin_debugger_test.Chec kDebuggerForXssFeatureTest) Tests to check if Debugger is vulnerable to XSS ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ xss_checks_pgadmin_debugger_te st.py", line 41, in runTest self.page.add_server(self.serv er) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 55, in add_server self.find_by_partial_link_text ("Server...").click() File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 185, in find_by_partial_link_text EC.element_to_be_clickable((By .PARTIAL_LINK_TEXT, link_text)) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site-p ackages/selenium/webdriver/sup port/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.Tim eoutException: Message: Timed out waiting for link with text "Server..." ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.xss_che cks_pgadmin_debugger_test.Chec kDebuggerForXssFeatureTest) Tests to check if Debugger is vulnerable to XSS ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/base_feature_test.py", line 66, in tearDown self.after() File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ xss_checks_pgadmin_debugger_te st.py", line 46, in after self.page.remove_server(self.s erver) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 122, in remove_server "' and @class='aciTreeItem']") File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 169, in find_by_xpath lambda driver: driver.find_element_by_xpath(x path) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 261, in wait_for_element return self._wait_for("element to exist", element_if_it_exists) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site-p ackages/selenium/webdriver/sup port/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.Tim eoutException: Message: Timed out waiting for element to exist ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.xss_che cks_roles_control_test.CheckRo leMembershipControlFeatureTest ) Tests to check if Role membership control is vulnerable to XSS ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ xss_checks_roles_control_test. py", line 37, in runTest self.page.add_server(self.serv er) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 55, in add_server self.find_by_partial_link_text ("Server...").click() File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 185, in find_by_partial_link_text EC.element_to_be_clickable((By .PARTIAL_LINK_TEXT, link_text)) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site-p ackages/selenium/webdriver/sup port/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.Tim eoutException: Message: Timed out waiting for link with text "Server..." ============================== ============================== ========== ERROR: runTest (pgadmin.feature_tests.xss_che cks_roles_control_test.CheckRo leMembershipControlFeatureTest ) Tests to check if Role membership control is vulnerable to XSS ------------------------------ ------------------------------ ---------- Traceback (most recent call last): File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/base_feature_test.py", line 66, in tearDown self.after() File "/home/pivotal/workspace/pgadm in4/web/pgadmin/feature_tests/ xss_checks_roles_control_test. py", line 42, in after self.page.remove_server(self.s erver) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 122, in remove_server "' and @class='aciTreeItem']") File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 169, in find_by_xpath lambda driver: driver.find_element_by_xpath(x path) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 261, in wait_for_element return self._wait_for("element to exist", element_if_it_exists) File "/home/pivotal/workspace/pgadm in4/web/regression/feature_uti ls/pgadmin_page.py", line 327, in _wait_for "Timed out waiting for " + waiting_for_message File "/home/pivotal/.pyenv/versions /python36/lib/python3.6/site-p ackages/selenium/webdriver/sup port/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.Tim eoutException: Message: Timed out waiting for element to exist ------------------------------ ------------------------------ ---------- Ran 11 tests in 441.881s FAILED (errors=13) ============================== ============================== ========== Test Result Summary ============================== ============================== ========== PostgreSQL 10: 2 tests passed 9 tests failed: CopySelectedQueryResultsFeatur eTest (Copy rows, column using button and keyboard shortcut) PGDataypeFeatureTest (Test checks for PG data-types output) QueryToolJourneyTest (Tests the path through the query tool) QueryToolFeatureTest (Query tool feature test) CheckForViewDataTest (Validate Insert, Update operations in View/Edit data with given test data) CheckFileManagerFeatureTest (Tests to check if File manager is vulnerable to XSS) CheckForXssFeatureTest (Test XSS check for panels and query tool) CheckDebuggerForXssFeatureTest (Tests to check if Debugger is vulnerable to XSS) CheckRoleMembershipControlFeat ureTest (Tests to check if Role membership control is vulnerable to XSS) 0 tests skipped ============================== ============================== ========== All the above tests fail in the following place:Also the tests will never end because firefox is waiting for the user to click "Leave the page" button.ThanksVictoria & JoaoHi Hackers,On Mon, Apr 23, 2018 at 9:07 PM, Anthony Emengo <aemengo@pivotal.io> wrote:We also tried running the tests with this patch. It didn't launch without some code changes and several tests were failing. We should really defer pulling this in until we have more robust results on FirefoxIn order to have the tests running we had to do the following change:diff --git a/web/regression/feature_utils/app_starter.py b/web/regression/feature_utils /app_starter.py index 77b0400c..50d3e307 100644--- a/web/regression/feature_utils/app_starter.py +++ b/web/regression/feature_utils/app_starter.py @@ -42,10 +44,18 @@ class AppStarter:)self.driver.set_window_size(1280, 1024) - self.driver.get(- "http://" + self.app_config.DEFAULT_SERVER + ":" +- random_server_port- )+ # self.driver.implicitly_wait(60) ++ def launch_browser():+ try:+ self.driver.get(+ "http://" + self.app_config.DEFAULT_SERVER + ":" ++ random_server_port+ )+ except WebDriverException as e:+ time.sleep(5)+ launch_browser()+ launch_browser()This change was required because firefox was throwing an exception when we tried to get the address and the server was not running. We saw this behavior in Ubuntu.Yes I have faced the same problem in Ubuntu. As per suggestion by Dave I have added parameter in test_config.json.in and also include the above code given by Anthony.Attached is the modified patch.- Anthony and JoaoOn Mon, Apr 23, 2018 at 9:12 AM, Dave Page <dpage@pgadmin.org> wrote:HiOn Mon, Apr 23, 2018 at 2:05 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote: Hi Hackers,I have added support for running feature tests against FireFox. For that user will have to download gecko driver from https://github.com/mozilla/geckodriver/releases and follow the below steps:
- Extract the gecko driver.
- Run chmod +x geckodriver.
- Either copy the geckodriver to /usr/local/bin or the path of the geckodriver must be specified in PATH.
- Apply the attached patch.
- Change the parameter "DEFAULT_TEST_BROWSER = 'Firefox' "
- Start the feature test.
The config option needs to be in test_config.json. We don't really want test-specific config options in config.py (arguably, TEST_SQLITE_PATH shoudn't be there either, as it's useless for end users).I'm surprised to not see any updates to tests. When I tried firefox manually a few weeks back, it was failing at lot.--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company--Akshay JoshiSr. Software ArchitectPhone: +91 20-3058-9517
Mobile: +91 976-788-8246--Akshay JoshiSr. Software ArchitectPhone: +91 20-3058-9517
Mobile: +91 976-788-8246
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Attachment
Re: [pgAdmin4][Patch] Feature #3270 Add support for running regression tests against Firefox
Hey Akshay,
Regarding your previous comment:
As I know time.sleep is not a good idea and I am new to feature test and in learning phase, can someone correct/suggest the way to fix those issues.
Although the feature tests already have some sleeps
, it’s generally not a best practice for browser automation. The better way is to use Waits
that the selenium API provides, mainly because they can accept a condition to poll until fulfilled for rather than blocking the main thread of execution. http://selenium-python.readthedocs.io/waits.html#explicit-waits. With regards to the "fe_sendauth" password error . I’d probably would have done it like so (I haven’t tested this):
WebDriverWait(self.driver, 10)\ .until(EC.text_to_be_present_in_element( (By.NAME, 'password', server_config['db_password']))
)
In general, I ran the tests with the Firefox option and am seeing more failures than I usually would with Chrome. I don’t feel particularly strongly about the patch since our team mostly likely won’t be running it over the course of our development. But I still couldn’t run the tests without modify the code so that the server is up and running before the browser automation starts. I think that this should be addressed.
Any thing in particular that I can help with regarding this, please let me know! 😀
Anthony
Attachment
Re: [pgAdmin4][Patch] Feature #3270 Add support for runningregression tests against Firefox
Hey Akshay,
Regarding your previous comment:
As I know time.sleep is not a good idea and I am new to feature test and in learning phase, can someone correct/suggest the way to fix those issues.Although the feature tests already have some
sleeps
, it’s generally not a best practice for browser automation. The better way is to useWaits
that the selenium API provides, mainly because they can accept a condition to poll until fulfilled for rather than blocking the main thread of execution. http://selenium-python.readthedocs.io/waits.html# explicit-waits. With regards to the "fe_sendauth" password error . I’d probably would have done it like so (I haven’t tested this): WebDriverWait(self.driver, 10)\ .until(EC.text_to_be_present_
in_element( (By.NAME, 'password', server_config['db_password'])) )
In general, I ran the tests with the Firefox option and am seeing more failures than I usually would with Chrome. I don’t feel particularly strongly about the patch since our team mostly likely won’t be running it over the course of our development. But I still couldn’t run the tests without modify the code so that the server is up and running before the browser automation starts. I think that this should be addressed.
Any thing in particular that I can help with regarding this, please let me know! 😀
Anthony
Mobile: +91 976-788-8246
Attachment
Re: [pgAdmin4][Patch] Feature #3270 Add support for running regression tests against Firefox
Hey Akshay,
Unfortunately, I’m seeing far more failures on my machine with Firefox to be sure what you’re seeing, when you run these tests. However, I was able to address one of the areas that I saw multiple sleeps
added and made the code more robust with Waits
. The changes below to the file at .../pgadmin4/web/pgadmin/feature_tests/xss_checks_file_manager_test.py
specifically wait for the element to be detached off the DOM and then to be reattached before retrieving any more attributes.
instantiate the element using an anonymous function that takes the selector method
add a new reusable method to the page object that waits for attach/detach
I’ve attached my changes as the file 0002-RM_3270_v5.patch for you to compare. If you’re unable to get some of these other issues, let me know and we can get through this!
Attachment
Re: [pgAdmin4][Patch] Feature #3270 Add support for running regression tests against Firefox
cap = DesiredCapabilities.FIREFOXBy adding above that problem is resolved. Two test cases are still failing on my machine (
cap['requireWindowFocus'] = True
cap['enablePersistentHover'] = False
Hey Akshay,
Unfortunately, I’m seeing far more failures on my machine with Firefox to be sure what you’re seeing, when you run these tests. However, I was able to address one of the areas that I saw multiple
sleeps
added and made the code more robust withWaits
. The changes below to the file at.../pgadmin4/web/pgadmin/
specifically wait for the element to be detached off the DOM and then to be reattached before retrieving any more attributes.feature_tests/xss_checks_file_ manager_test.py instantiate the element using an anonymous function that takes the selector method
add a new reusable method to the page object that waits for attach/detach
I’ve attached my changes as the file 0002-RM_3270_v5.patch for you to compare. If you’re unable to get some of these other issues, let me know and we can get through this!
Mobile: +91 976-788-8246
Attachment
Re: [pgAdmin4][Patch] Feature #3270 Add support for running regression tests against Firefox
Hey,
Thanks for the extra details. We were running them on our Ubuntu machine, but today we tried on OSX.
With CheckForViewDataTest:
The problem is that the chromedriver implicitly scrolls to an element when moveToElement
was called, but the Firefox did not.
https://github.com/mozilla/geckodriver/issues/776. To fix, we simply scrolled to the element before the action was called:
With CopySelectedQueryResultsFeatureTest:
We noticed that there’s different selection behavior between Firefox and Chrome. In Firefox, the entire column is selected, whereas only the cell is selected in Chrome. After reviewing, we think that modifying the assertion to be a assertIn more ideal.
Also, just wanted to note that we had to bump the retry attempts to 60, to see the Firefox run on our machine. Attached is the modified patch (with all of our changes). If you need anything else, let me know!
Anthony and Victoria
Attachment
Re: [pgAdmin4][Patch] Feature #3270 Add support for running regression tests against Firefox
Hey, noticed that the patch above seems to fail on our CI pipelines, which run Chrome. Please look at this revised patch that accommodates for both Chrome and Firefox with the wait_for_element_to_reload
function.
Attachment
Re: [pgAdmin4][Patch] Feature #3270 Add support for runningregression tests against Firefox
Hey, noticed that the patch above seems to fail on our CI pipelines, which run Chrome. Please look at this revised patch that accommodates for both Chrome and Firefox with the
wait_for_element_to_reload
function.
Mobile: +91 976-788-8246
Attachment
Re: [pgAdmin4][Patch] Feature #3270 Add support for running regression tests against Firefox
Thanks Anthony for fixing those two test cases. I have verified it and patch looks good to me.Attached is the modified patch where I have remove "import time" which is not required and update the retry message from 10 to 60.To be honest I have seen some intermittent "Timeout" issues on Chrome and FireFox and those issues are not consistent for any particular test case.@Hackers, Please review it and if it looks good then commit it.
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Attachment
Re: [pgAdmin4][Patch] Feature #3270 Add support for running regression tests against Firefox
HiOn Wed, May 9, 2018 at 8:10 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote: Thanks Anthony for fixing those two test cases. I have verified it and patch looks good to me.Attached is the modified patch where I have remove "import time" which is not required and update the retry message from 10 to 60.To be honest I have seen some intermittent "Timeout" issues on Chrome and FireFox and those issues are not consistent for any particular test case.@Hackers, Please review it and if it looks good then commit it.I seem to be getting the following failures consistently (screenshots attached):============================================================ ========== ERROR: runTest (pgadmin.feature_tests.pg_datatype_validation_test. PGDataypeFeatureTest) Test checks for PG data-types output------------------------------------------------------------ ---------- Traceback (most recent call last):File "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/pg_ datatype_validation_test.py", line 135, in runTest self._check_datatype()File "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/pg_ datatype_validation_test.py", line 169, in _check_datatype "contains(.,'{}')]".format(batch['datatype'][0]) File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site- packages/selenium/webdriver/ support/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace)TimeoutException: Message:
============================================================ ========== FAIL: runTest (pgadmin.feature_tests.xss_checks_file_manager_test. CheckFileManagerFeatureTest) Tests to check if File manager is vulnerable to XSS------------------------------------------------------------ ---------- Traceback (most recent call last):File "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/xss_ checks_file_manager_test.py", line 60, in runTest self._open_file_manager_and_check_xss_file() File "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/xss_ checks_file_manager_test.py", line 110, in _open_file_manager_and_check_ xss_file 'File manager'File "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/xss_ checks_file_manager_test.py", line 117, in _check_escaped_characters ) != -1, "{0} might be vulnerable to XSS ".format(source)AssertionError: File manager might be vulnerable to XSS
------------------------------------------------------------ ---------- Ran 11 tests in 475.292sFAILED (failures=1, errors=1)============================================================ ========== Test Result Summary============================================================ ========== Regression - PG 9.4:9 tests passed2 tests failed:CheckFileManagerFeatureTest (Tests to check if File manager is vulnerable to XSS)PGDataypeFeatureTest (Test checks for PG data-types output)0 tests skipped============================================================ ========== Please check output in file: /Users/dpage/git/pgadmin4/web/regression/regression.log make: *** [check-feature] Error 1
--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Mobile: +91 976-788-8246
Attachment
Re: [pgAdmin4][Patch] Feature #3270 Add support for runningregression tests against Firefox
HiOn Wed, May 9, 2018 at 6:19 PM, Dave Page <dpage@pgadmin.org> wrote:HiOn Wed, May 9, 2018 at 8:10 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote: Thanks Anthony for fixing those two test cases. I have verified it and patch looks good to me.Attached is the modified patch where I have remove "import time" which is not required and update the retry message from 10 to 60.To be honest I have seen some intermittent "Timeout" issues on Chrome and FireFox and those issues are not consistent for any particular test case.@Hackers, Please review it and if it looks good then commit it.I seem to be getting the following failures consistently (screenshots attached):============================================================ ========== ERROR: runTest (pgadmin.feature_tests.pg_datatype_validation_test.PGDataype FeatureTest) Test checks for PG data-types output------------------------------------------------------------ ---------- Traceback (most recent call last):File "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/pg_data type_validation_test.py", line 135, in runTest self._check_datatype()File "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/pg_data type_validation_test.py", line 169, in _check_datatype "contains(.,'{}')]".format(batch['datatype'][0]) File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa ges/selenium/webdriver/support /wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace)TimeoutException: Message:This is the intermittent issue I was highlighted in my previous email.
============================================================ ========== FAIL: runTest (pgadmin.feature_tests.xss_checks_file_manager_test.CheckFil eManagerFeatureTest) Tests to check if File manager is vulnerable to XSS------------------------------------------------------------ ---------- Traceback (most recent call last):File "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/xss_che cks_file_manager_test.py", line 60, in runTest self._open_file_manager_and_check_xss_file() File "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/xss_che cks_file_manager_test.py", line 110, in _open_file_manager_and_check_x ss_file 'File manager'File "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/xss_che cks_file_manager_test.py", line 117, in _check_escaped_characters ) != -1, "{0} might be vulnerable to XSS ".format(source)AssertionError: File manager might be vulnerable to XSSI have removed Anthony's patch and added time.sleep(0.05) before and after reading the content from the file.
------------------------------------------------------------ ---------- Ran 11 tests in 475.292sFAILED (failures=1, errors=1)============================================================ ========== Test Result Summary============================================================ ========== Regression - PG 9.4:9 tests passed2 tests failed:CheckFileManagerFeatureTest (Tests to check if File manager is vulnerable to XSS)PGDataypeFeatureTest (Test checks for PG data-types output)0 tests skipped============================================================ ========== Please check output in file: /Users/dpage/git/pgadmin4/web/regression/regression.log make: *** [check-feature] Error 1Attached is the modified patch with all test cases passed on my machine. I have tried couple of times (refer the attached screenshot).--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company--Akshay JoshiSr. Software ArchitectPhone: +91 20-3058-9517
Mobile: +91 976-788-8246
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Re: [pgAdmin4][Patch] Feature #3270 Add support for runningregression tests against Firefox
HiOn Wed, May 9, 2018 at 2:55 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote: HiOn Wed, May 9, 2018 at 6:19 PM, Dave Page <dpage@pgadmin.org> wrote:HiOn Wed, May 9, 2018 at 8:10 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote: Thanks Anthony for fixing those two test cases. I have verified it and patch looks good to me.Attached is the modified patch where I have remove "import time" which is not required and update the retry message from 10 to 60.To be honest I have seen some intermittent "Timeout" issues on Chrome and FireFox and those issues are not consistent for any particular test case.@Hackers, Please review it and if it looks good then commit it.I seem to be getting the following failures consistently (screenshots attached):============================================================ ========== ERROR: runTest (pgadmin.feature_tests.pg_datatype_validation_test.PGDataype FeatureTest) Test checks for PG data-types output------------------------------------------------------------ ---------- Traceback (most recent call last):File "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/pg_data type_validation_test.py", line 135, in runTest self._check_datatype()File "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/pg_data type_validation_test.py", line 169, in _check_datatype "contains(.,'{}')]".format(batch['datatype'][0]) File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa ges/selenium/webdriver/support /wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace)TimeoutException: Message:This is the intermittent issue I was highlighted in my previous email.Right - except I'm getting it consistently, on every run I've done.
============================================================ ========== FAIL: runTest (pgadmin.feature_tests.xss_checks_file_manager_test.CheckFil eManagerFeatureTest) Tests to check if File manager is vulnerable to XSS------------------------------------------------------------ ---------- Traceback (most recent call last):File "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/xss_che cks_file_manager_test.py", line 60, in runTest self._open_file_manager_and_check_xss_file() File "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/xss_che cks_file_manager_test.py", line 110, in _open_file_manager_and_check_x ss_file 'File manager'File "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/xss_che cks_file_manager_test.py", line 117, in _check_escaped_characters ) != -1, "{0} might be vulnerable to XSS ".format(source)AssertionError: File manager might be vulnerable to XSSI have removed Anthony's patch and added time.sleep(0.05) before and after reading the content from the file.That part works now; however, Anthony's method is the more correct way to handle this. Is the issue with his patch that waiting for the element to load isn't enough, and we have to wait for it to load *and* for something else to become active or dynamically load? In other words, are we waiting for the right thing?
------------------------------------------------------------ ---------- Ran 11 tests in 475.292sFAILED (failures=1, errors=1)============================================================ ========== Test Result Summary============================================================ ========== Regression - PG 9.4:9 tests passed2 tests failed:CheckFileManagerFeatureTest (Tests to check if File manager is vulnerable to XSS)PGDataypeFeatureTest (Test checks for PG data-types output)0 tests skipped============================================================ ========== Please check output in file: /Users/dpage/git/pgadmin4/web/regression/regression.log make: *** [check-feature] Error 1Attached is the modified patch with all test cases passed on my machine. I have tried couple of times (refer the attached screenshot).--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company--Akshay JoshiSr. Software ArchitectPhone: +91 20-3058-9517
Mobile: +91 976-788-8246--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Mobile: +91 976-788-8246
Re: [pgAdmin4][Patch] Feature #3270 Add support for running regression tests against Firefox
I completely apologize.
With regards to pgadmin.feature_tests.xss_checks_file_manager_test.CheckFileManagerFeatureTest
My original fix was working for Firefox but when I tried to adjust it for Chrome, it doesn’t seem to be working reliably for both browsers. What I was able to get working reliably for today was to do a check on what browser was running and run the appropriate wait function (Chrome doesn’t need it). The wait is explicitly for the element to go stale and then un-stale once more.
For what it’s worth however, I have not seen any failures today with pgadmin.feature_tests.pg_datatype_validation_test.PGDataypeFeatureTest
, on Firefox.I'm running on an Mac OSX system.
Attachment
Re: [pgAdmin4][Patch] Feature #3270 Add support for running regression tests against Firefox
I completely apologize.
With regards to
pgadmin.feature_tests.xss_
My original fix was working for Firefox but when I tried to adjust it for Chrome, it doesn’t seem to be working reliably for both browsers. What I was able to get working reliably for today was to do a check on what browser was running and run the appropriate wait function (Chrome doesn’t need it). The wait is explicitly for the element to go stale and then un-stale once more.checks_file_manager_test. CheckFileManagerFeatureTest For what it’s worth however, I have not seen any failures today with
pgadmin.feature_tests.pg_
, on Firefox.I'm running on an Mac OSX system.datatype_validation_test. PGDataypeFeatureTest Cheers and good weekend! 😀
Mobile: +91 976-788-8246
Attachment
Re: [pgAdmin4][Patch] Feature #3270 Add support for running regression tests against Firefox
Hi
Hi AnthonyThanks for updated patch, it is working fine on my machine. I have tested it couple of times.
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Attachment
Re: [pgAdmin4][Patch] Feature #3270 Add support for runningregression tests against Firefox
HiOn Mon, May 14, 2018 at 7:29 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote: Hi AnthonyThanks for updated patch, it is working fine on my machine. I have tested it couple of times.I've tested it a couple of times and still see the pgDataType failure. I've attached the screenshot; I have to wonder why that test is throwing a syntax error at all as it's only supposed to test that we display different datatypes correctly. Looking further, it seems that it's trying to execute a badly corrupted query. How did it get that way? Do we need to clear the CodeMirror box before trying to replace the query?--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Mobile: +91 976-788-8246
Re: [pgAdmin4][Patch] Feature #3270 Add support for runningregression tests against Firefox
Hi DaveOn which database server you are running this test cases, I have tested it on PG 9.6
--On Mon, May 14, 2018 at 5:45 PM, Dave Page <dpage@pgadmin.org> wrote:
HiOn Mon, May 14, 2018 at 7:29 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote: Hi AnthonyThanks for updated patch, it is working fine on my machine. I have tested it couple of times.I've tested it a couple of times and still see the pgDataType failure. I've attached the screenshot; I have to wonder why that test is throwing a syntax error at all as it's only supposed to test that we display different datatypes correctly. Looking further, it seems that it's trying to execute a badly corrupted query. How did it get that way? Do we need to clear the CodeMirror box before trying to replace the query?--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL CompanyAkshay JoshiSr. Software ArchitectPhone: +91 20-3058-9517
Mobile: +91 976-788-8246
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Re: [pgAdmin4][Patch] Feature #3270 Add support for runningregression tests against Firefox
On Mon, May 14, 2018 at 2:03 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote: Hi DaveOn which database server you are running this test cases, I have tested it on PG 9.6PG 9.4.
--On Mon, May 14, 2018 at 5:45 PM, Dave Page <dpage@pgadmin.org> wrote:
HiOn Mon, May 14, 2018 at 7:29 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote: Hi AnthonyThanks for updated patch, it is working fine on my machine. I have tested it couple of times.I've tested it a couple of times and still see the pgDataType failure. I've attached the screenshot; I have to wonder why that test is throwing a syntax error at all as it's only supposed to test that we display different datatypes correctly. Looking further, it seems that it's trying to execute a badly corrupted query. How did it get that way? Do we need to clear the CodeMirror box before trying to replace the query?--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL CompanyAkshay JoshiSr. Software ArchitectPhone: +91 20-3058-9517
Mobile: +91 976-788-8246--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Mobile: +91 976-788-8246
Re: [pgAdmin4][Patch] Feature #3270 Add support for runningregression tests against Firefox
Hi DaveOn Mon, May 14, 2018 at 6:33 PM, Dave Page <dpage@pgadmin.org> wrote:On Mon, May 14, 2018 at 2:03 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote: Hi DaveOn which database server you are running this test cases, I have tested it on PG 9.6PG 9.4.I have tested it with PG 9.4 on Mac OSX and Ubuntu 16, working absolutely fine. Can you please provide the postgresql.conf is there any parameter changed? OR is there any change in "datatype_test.json" file ?--On Mon, May 14, 2018 at 5:45 PM, Dave Page <dpage@pgadmin.org> wrote:
HiOn Mon, May 14, 2018 at 7:29 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote: Hi AnthonyThanks for updated patch, it is working fine on my machine. I have tested it couple of times.I've tested it a couple of times and still see the pgDataType failure. I've attached the screenshot; I have to wonder why that test is throwing a syntax error at all as it's only supposed to test that we display different datatypes correctly. Looking further, it seems that it's trying to execute a badly corrupted query. How did it get that way? Do we need to clear the CodeMirror box before trying to replace the query?--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL CompanyAkshay JoshiSr. Software ArchitectPhone: +91 20-3058-9517
Mobile: +91 976-788-8246--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company--Akshay JoshiSr. Software ArchitectPhone: +91 20-3058-9517
Mobile: +91 976-788-8246
Re: [pgAdmin4][Patch] Feature #3270 Add support for runningregression tests against Firefox
Hi DaveOn Mon, May 14, 2018 at 6:33 PM, Dave Page <dpage@pgadmin.org> wrote:On Mon, May 14, 2018 at 2:03 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote: Hi DaveOn which database server you are running this test cases, I have tested it on PG 9.6PG 9.4.I have tested it with PG 9.4 on Mac OSX and Ubuntu 16, working absolutely fine. Can you please provide the postgresql.conf is there any parameter changed? OR is there any change in "datatype_test.json" file ?
--On Mon, May 14, 2018 at 5:45 PM, Dave Page <dpage@pgadmin.org> wrote:
HiOn Mon, May 14, 2018 at 7:29 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote: Hi AnthonyThanks for updated patch, it is working fine on my machine. I have tested it couple of times.I've tested it a couple of times and still see the pgDataType failure. I've attached the screenshot; I have to wonder why that test is throwing a syntax error at all as it's only supposed to test that we display different datatypes correctly. Looking further, it seems that it's trying to execute a badly corrupted query. How did it get that way? Do we need to clear the CodeMirror box before trying to replace the query?--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL CompanyAkshay JoshiSr. Software ArchitectPhone: +91 20-3058-9517
Mobile: +91 976-788-8246--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company--Akshay JoshiSr. Software ArchitectPhone: +91 20-3058-9517
Mobile: +91 976-788-8246
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Attachment
Re: [pgAdmin4][Patch] Feature #3270 Add support for runningregression tests against Firefox
Hi Dave,I suggest check which keyboard you are using, US or UK. If UK, try with US keyboard.(might work)
Thanks and Regards,Aditya ToshniwalSoftware Engineer | EnterpriseDB Software Solutions | Pune"Don't Complain about Heat, Plant a tree"On Tue, May 15, 2018 at 11:35 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote: Hi DaveOn Mon, May 14, 2018 at 6:33 PM, Dave Page <dpage@pgadmin.org> wrote:On Mon, May 14, 2018 at 2:03 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote: Hi DaveOn which database server you are running this test cases, I have tested it on PG 9.6PG 9.4.I have tested it with PG 9.4 on Mac OSX and Ubuntu 16, working absolutely fine. Can you please provide the postgresql.conf is there any parameter changed? OR is there any change in "datatype_test.json" file ?--On Mon, May 14, 2018 at 5:45 PM, Dave Page <dpage@pgadmin.org> wrote:
HiOn Mon, May 14, 2018 at 7:29 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote: Hi AnthonyThanks for updated patch, it is working fine on my machine. I have tested it couple of times.I've tested it a couple of times and still see the pgDataType failure. I've attached the screenshot; I have to wonder why that test is throwing a syntax error at all as it's only supposed to test that we display different datatypes correctly. Looking further, it seems that it's trying to execute a badly corrupted query. How did it get that way? Do we need to clear the CodeMirror box before trying to replace the query?--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL CompanyAkshay JoshiSr. Software ArchitectPhone: +91 20-3058-9517
Mobile: +91 976-788-8246--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company--Akshay JoshiSr. Software ArchitectPhone: +91 20-3058-9517
Mobile: +91 976-788-8246
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Re: [pgAdmin4][Patch] Feature #3270 Add support for runningregression tests against Firefox
HiOn Tue, May 15, 2018 at 1:24 PM, Aditya Toshniwal <aditya.toshniwal@enterprisedb.com> wrote: Hi Dave,I suggest check which keyboard you are using, US or UK. If UK, try with US keyboard.(might work)How would that make any difference? (and yes, I am using a UK keyboard).
Thanks and Regards,Aditya ToshniwalSoftware Engineer | EnterpriseDB Software Solutions | Pune"Don't Complain about Heat, Plant a tree"On Tue, May 15, 2018 at 11:35 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote: Hi DaveOn Mon, May 14, 2018 at 6:33 PM, Dave Page <dpage@pgadmin.org> wrote:On Mon, May 14, 2018 at 2:03 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote: Hi DaveOn which database server you are running this test cases, I have tested it on PG 9.6PG 9.4.I have tested it with PG 9.4 on Mac OSX and Ubuntu 16, working absolutely fine. Can you please provide the postgresql.conf is there any parameter changed? OR is there any change in "datatype_test.json" file ?--On Mon, May 14, 2018 at 5:45 PM, Dave Page <dpage@pgadmin.org> wrote:
HiOn Mon, May 14, 2018 at 7:29 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote: Hi AnthonyThanks for updated patch, it is working fine on my machine. I have tested it couple of times.I've tested it a couple of times and still see the pgDataType failure. I've attached the screenshot; I have to wonder why that test is throwing a syntax error at all as it's only supposed to test that we display different datatypes correctly. Looking further, it seems that it's trying to execute a badly corrupted query. How did it get that way? Do we need to clear the CodeMirror box before trying to replace the query?--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL CompanyAkshay JoshiSr. Software ArchitectPhone: +91 20-3058-9517
Mobile: +91 976-788-8246--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company--Akshay JoshiSr. Software ArchitectPhone: +91 20-3058-9517
Mobile: +91 976-788-8246--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Re: [pgAdmin4][Patch] Feature #3270 Add support for runningregression tests against Firefox
On Tue, May 15, 2018 at 6:05 PM, Dave Page <dpage@pgadmin.org> wrote:HiOn Tue, May 15, 2018 at 1:24 PM, Aditya Toshniwal <aditya.toshniwal@enterprisedb.com> wrote: Hi Dave,I suggest check which keyboard you are using, US or UK. If UK, try with US keyboard.(might work)How would that make any difference? (and yes, I am using a UK keyboard).There are few cases reported in Selenium github where they are facing issues for non-US keyboard layouts. Refer below link,It is possible the issues still exist and so we can try with US keyboard once.
Thanks and Regards,Aditya ToshniwalSoftware Engineer | EnterpriseDB Software Solutions | Pune"Don't Complain about Heat, Plant a tree"On Tue, May 15, 2018 at 11:35 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote: Hi DaveOn Mon, May 14, 2018 at 6:33 PM, Dave Page <dpage@pgadmin.org> wrote:On Mon, May 14, 2018 at 2:03 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote: Hi DaveOn which database server you are running this test cases, I have tested it on PG 9.6PG 9.4.I have tested it with PG 9.4 on Mac OSX and Ubuntu 16, working absolutely fine. Can you please provide the postgresql.conf is there any parameter changed? OR is there any change in "datatype_test.json" file ?--On Mon, May 14, 2018 at 5:45 PM, Dave Page <dpage@pgadmin.org> wrote:
HiOn Mon, May 14, 2018 at 7:29 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote: Hi AnthonyThanks for updated patch, it is working fine on my machine. I have tested it couple of times.I've tested it a couple of times and still see the pgDataType failure. I've attached the screenshot; I have to wonder why that test is throwing a syntax error at all as it's only supposed to test that we display different datatypes correctly. Looking further, it seems that it's trying to execute a badly corrupted query. How did it get that way? Do we need to clear the CodeMirror box before trying to replace the query?--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL CompanyAkshay JoshiSr. Software ArchitectPhone: +91 20-3058-9517
Mobile: +91 976-788-8246--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company--Akshay JoshiSr. Software ArchitectPhone: +91 20-3058-9517
Mobile: +91 976-788-8246--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Re: [pgAdmin4][Patch] Feature #3270 Add support for runningregression tests against Firefox
On Tue, May 15, 2018 at 1:45 PM, Aditya Toshniwal <aditya.toshniwal@enterprisedb.com> wrote:On Tue, May 15, 2018 at 6:05 PM, Dave Page <dpage@pgadmin.org> wrote:HiOn Tue, May 15, 2018 at 1:24 PM, Aditya Toshniwal <aditya.toshniwal@enterprisedb.com> wrote:Hi Dave,I suggest check which keyboard you are using, US or UK. If UK, try with US keyboard.(might work)How would that make any difference? (and yes, I am using a UK keyboard).There are few cases reported in Selenium github where they are facing issues for non-US keyboard layouts. Refer below link,It is possible the issues still exist and so we can try with US keyboard once.Hmm, interesting. I checked in the Keyboard Preferences on my mac, and it said I had a US input device. I added UK as well, and even though it makes no difference to the keyboard that I can see, that test does now seem to be passing.So, I'm not really sure what's going on...Anyway, it works so patch applied. Thanks!
Thanks and Regards,Aditya ToshniwalSoftware Engineer | EnterpriseDB Software Solutions | Pune"Don't Complain about Heat, Plant a tree"On Tue, May 15, 2018 at 11:35 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:Hi DaveOn Mon, May 14, 2018 at 6:33 PM, Dave Page <dpage@pgadmin.org> wrote:On Mon, May 14, 2018 at 2:03 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:Hi DaveOn which database server you are running this test cases, I have tested it on PG 9.6PG 9.4.I have tested it with PG 9.4 on Mac OSX and Ubuntu 16, working absolutely fine. Can you please provide the postgresql.conf is there any parameter changed? OR is there any change in "datatype_test.json" file ?--On Mon, May 14, 2018 at 5:45 PM, Dave Page <dpage@pgadmin.org> wrote:
HiOn Mon, May 14, 2018 at 7:29 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:Hi AnthonyThanks for updated patch, it is working fine on my machine. I have tested it couple of times.I've tested it a couple of times and still see the pgDataType failure. I've attached the screenshot; I have to wonder why that test is throwing a syntax error at all as it's only supposed to test that we display different datatypes correctly. Looking further, it seems that it's trying to execute a badly corrupted query. How did it get that way? Do we need to clear the CodeMirror box before trying to replace the query?--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL CompanyAkshay JoshiSr. Software ArchitectPhone: +91 20-3058-9517
Mobile: +91 976-788-8246--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company--Akshay JoshiSr. Software ArchitectPhone: +91 20-3058-9517
Mobile: +91 976-788-8246--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Re: [pgAdmin4][Patch] Feature #3270 Add support for runningregression tests against Firefox
On Tue, 15 May 2018, 19:40 Dave Page, <dpage@pgadmin.org> wrote:On Tue, May 15, 2018 at 1:45 PM, Aditya Toshniwal <aditya.toshniwal@enterprisedb.com> wrote: On Tue, May 15, 2018 at 6:05 PM, Dave Page <dpage@pgadmin.org> wrote:HiOn Tue, May 15, 2018 at 1:24 PM, Aditya Toshniwal <aditya.toshniwal@enterprisedb.com> wrote: Hi Dave,I suggest check which keyboard you are using, US or UK. If UK, try with US keyboard.(might work)How would that make any difference? (and yes, I am using a UK keyboard).There are few cases reported in Selenium github where they are facing issues for non-US keyboard layouts. Refer below link,It is possible the issues still exist and so we can try with US keyboard once.Hmm, interesting. I checked in the Keyboard Preferences on my mac, and it said I had a US input device. I added UK as well, and even though it makes no difference to the keyboard that I can see, that test does now seem to be passing.So, I'm not really sure what's going on...Anyway, it works so patch applied. Thanks!I have also tried this same thing but it didn't work for me. Still I am facing the same issue with Ubuntu.
Thanks and Regards,Aditya ToshniwalSoftware Engineer | EnterpriseDB Software Solutions | Pune"Don't Complain about Heat, Plant a tree"On Tue, May 15, 2018 at 11:35 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote: Hi DaveOn Mon, May 14, 2018 at 6:33 PM, Dave Page <dpage@pgadmin.org> wrote:On Mon, May 14, 2018 at 2:03 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote: Hi DaveOn which database server you are running this test cases, I have tested it on PG 9.6PG 9.4.I have tested it with PG 9.4 on Mac OSX and Ubuntu 16, working absolutely fine. Can you please provide the postgresql.conf is there any parameter changed? OR is there any change in "datatype_test.json" file ?--On Mon, May 14, 2018 at 5:45 PM, Dave Page <dpage@pgadmin.org> wrote:
HiOn Mon, May 14, 2018 at 7:29 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote: Hi AnthonyThanks for updated patch, it is working fine on my machine. I have tested it couple of times.I've tested it a couple of times and still see the pgDataType failure. I've attached the screenshot; I have to wonder why that test is throwing a syntax error at all as it's only supposed to test that we display different datatypes correctly. Looking further, it seems that it's trying to execute a badly corrupted query. How did it get that way? Do we need to clear the CodeMirror box before trying to replace the query?--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL CompanyAkshay JoshiSr. Software ArchitectPhone: +91 20-3058-9517
Mobile: +91 976-788-8246--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company--Akshay JoshiSr. Software ArchitectPhone: +91 20-3058-9517
Mobile: +91 976-788-8246--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Re: [pgAdmin4][Patch] Feature #3270 Add support for runningregression tests against Firefox
On Tue, May 15, 2018 at 3:24 PM, Khushboo Vashi <khushboo.vashi@enterprisedb.com> wrote:On Tue, 15 May 2018, 19:40 Dave Page, <dpage@pgadmin.org> wrote:On Tue, May 15, 2018 at 1:45 PM, Aditya Toshniwal <aditya.toshniwal@enterprisedb.com> wrote:On Tue, May 15, 2018 at 6:05 PM, Dave Page <dpage@pgadmin.org> wrote:HiOn Tue, May 15, 2018 at 1:24 PM, Aditya Toshniwal <aditya.toshniwal@enterprisedb.com> wrote:Hi Dave,I suggest check which keyboard you are using, US or UK. If UK, try with US keyboard.(might work)How would that make any difference? (and yes, I am using a UK keyboard).There are few cases reported in Selenium github where they are facing issues for non-US keyboard layouts. Refer below link,It is possible the issues still exist and so we can try with US keyboard once.Hmm, interesting. I checked in the Keyboard Preferences on my mac, and it said I had a US input device. I added UK as well, and even though it makes no difference to the keyboard that I can see, that test does now seem to be passing.So, I'm not really sure what's going on...Anyway, it works so patch applied. Thanks!I have also tried this same thing but it didn't work for me. Still I am facing the same issue with Ubuntu.Oh - the exact same failure? What do you get in the query text when it errors?
Thanks and Regards,Aditya ToshniwalSoftware Engineer | EnterpriseDB Software Solutions | Pune"Don't Complain about Heat, Plant a tree"On Tue, May 15, 2018 at 11:35 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:Hi DaveOn Mon, May 14, 2018 at 6:33 PM, Dave Page <dpage@pgadmin.org> wrote:On Mon, May 14, 2018 at 2:03 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:Hi DaveOn which database server you are running this test cases, I have tested it on PG 9.6PG 9.4.I have tested it with PG 9.4 on Mac OSX and Ubuntu 16, working absolutely fine. Can you please provide the postgresql.conf is there any parameter changed? OR is there any change in "datatype_test.json" file ?--On Mon, May 14, 2018 at 5:45 PM, Dave Page <dpage@pgadmin.org> wrote:
HiOn Mon, May 14, 2018 at 7:29 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:Hi AnthonyThanks for updated patch, it is working fine on my machine. I have tested it couple of times.I've tested it a couple of times and still see the pgDataType failure. I've attached the screenshot; I have to wonder why that test is throwing a syntax error at all as it's only supposed to test that we display different datatypes correctly. Looking further, it seems that it's trying to execute a badly corrupted query. How did it get that way? Do we need to clear the CodeMirror box before trying to replace the query?--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL CompanyAkshay JoshiSr. Software ArchitectPhone: +91 20-3058-9517
Mobile: +91 976-788-8246--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company--Akshay JoshiSr. Software ArchitectPhone: +91 20-3058-9517
Mobile: +91 976-788-8246--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company