Thread: [pgAdmin4][Patch] Feature #3270 Add support for running regressiontests 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.  
Please review it.

--
Akshay Joshi
Sr. Software Architect


Phone: +91 20-3058-9517
Mobile: +91 976-788-8246
Attachment
Hi

On 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
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 Firefox

In 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 Joao

On Mon, Apr 23, 2018 at 9:12 AM, Dave Page <dpage@pgadmin.org> wrote:
Hi

On 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

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 Firefox

In 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 Joao

On Mon, Apr 23, 2018 at 9:12 AM, Dave Page <dpage@pgadmin.org> wrote:
Hi

On 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




--
Akshay Joshi
Sr. Software Architect


Phone: +91 20-3058-9517
Mobile: +91 976-788-8246
Attachment

Re: [pgAdmin4][Patch] Feature #3270 Add support for running regression tests against Firefox

From
Joao De Almeida Pereira
Date:
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 line
1 E501 line too long (80 > 79 characters)
2

The tests output is:
=============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

======================================================================

All the above tests fail in the following place:
CheckDebuggerForXssFeatureTest-2018.04.24_10.28.27-Python-3.6.4.png


Also the tests will never end because firefox is waiting for the user to click "Leave the page" button.

Thanks
Victoria & Joao

On Tue, Apr 24, 2018 at 2:26 AM Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
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 Firefox

In 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 Joao

On Mon, Apr 23, 2018 at 9:12 AM, Dave Page <dpage@pgadmin.org> wrote:
Hi

On 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


--
Akshay Joshi
Sr. Software Architect


Attachment
Interestingly, the new CI system I'm putting together seems to be suffering from intermittent failures at the start of the feature tests as well. Chrome is trying to load the page before the server is ready to go, and then timing out and failing the first test.

On the plus side, the rest of the feature tests seem to be quite stable on this system :-D

On Mon, Apr 23, 2018 at 4:37 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 Firefox

In 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 Joao

On Mon, Apr 23, 2018 at 9:12 AM, Dave Page <dpage@pgadmin.org> wrote:
Hi

On 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
Any progress on this Akshay?

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 line
1 E501 line too long (80 > 79 characters)
2

The tests output is:
=============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

======================================================================

All the above tests fail in the following place:
CheckDebuggerForXssFeatureTest-2018.04.24_10.28.27-Python-3.6.4.png


Also the tests will never end because firefox is waiting for the user to click "Leave the page" button.

Thanks
Victoria & Joao

On Tue, Apr 24, 2018 at 2:26 AM Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
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 Firefox

In 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 Joao

On Mon, Apr 23, 2018 at 9:12 AM, Dave Page <dpage@pgadmin.org> wrote:
Hi

On 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


--
Akshay Joshi
Sr. Software Architect





--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Attachment
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:
  • 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".
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. 

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.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 line
1 E501 line too long (80 > 79 characters)
2

The tests output is:
=============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

======================================================================

All the above tests fail in the following place:
CheckDebuggerForXssFeatureTest-2018.04.24_10.28.27-Python-3.6.4.png


Also the tests will never end because firefox is waiting for the user to click "Leave the page" button.

Thanks
Victoria & Joao

On Tue, Apr 24, 2018 at 2:26 AM Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
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 Firefox

In 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 Joao

On Mon, Apr 23, 2018 at 9:12 AM, Dave Page <dpage@pgadmin.org> wrote:
Hi

On 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


--
Akshay Joshi
Sr. Software Architect





--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



--
Akshay Joshi
Sr. Software Architect


Phone: +91 20-3058-9517
Mobile: +91 976-788-8246
Attachment
Ignore the previous patch. Attached is the latest one

On 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:
  • 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".
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. 

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.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 line
1 E501 line too long (80 > 79 characters)
2

The tests output is:
=============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

======================================================================

All the above tests fail in the following place:
CheckDebuggerForXssFeatureTest-2018.04.24_10.28.27-Python-3.6.4.png


Also the tests will never end because firefox is waiting for the user to click "Leave the page" button.

Thanks
Victoria & Joao

On Tue, Apr 24, 2018 at 2:26 AM Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
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 Firefox

In 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 Joao

On Mon, Apr 23, 2018 at 9:12 AM, Dave Page <dpage@pgadmin.org> wrote:
Hi

On 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


--
Akshay Joshi
Sr. Software Architect





--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



--
Akshay Joshi
Sr. Software Architect


Phone: +91 20-3058-9517
Mobile: +91 976-788-8246



--
Akshay Joshi
Sr. Software Architect


Phone: +91 20-3058-9517
Mobile: +91 976-788-8246
Attachment
Thanks Akshay. The patch looks basically OK to me, except:

- I also see the same test failures
- The option added to test_config.json should be moved to the top section of the file, alongside the headless_chrome option.
- I dislike the the sleeps. I'd really like to find a way around those if we can.

Joao, Anthony; can you provide any input on this?

Thanks!

On Fri, May 4, 2018 at 10:32 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Ignore the previous patch. Attached is the latest one

On 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:
  • 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".
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. 

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.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 line
1 E501 line too long (80 > 79 characters)
2

The tests output is:
=============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

======================================================================

All the above tests fail in the following place:
CheckDebuggerForXssFeatureTest-2018.04.24_10.28.27-Python-3.6.4.png


Also the tests will never end because firefox is waiting for the user to click "Leave the page" button.

Thanks
Victoria & Joao

On Tue, Apr 24, 2018 at 2:26 AM Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
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 Firefox

In 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 Joao

On Mon, Apr 23, 2018 at 9:12 AM, Dave Page <dpage@pgadmin.org> wrote:
Hi

On 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


--
Akshay Joshi
Sr. Software Architect





--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



--
Akshay Joshi
Sr. Software Architect


Phone: +91 20-3058-9517
Mobile: +91 976-788-8246



--
Akshay Joshi
Sr. Software Architect


Phone: +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
Attachment

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
Hi Hackers,

On Sat, May 5, 2018 at 2:45 AM, Anthony Emengo <aemengo@pivotal.io> wrote:

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']))
)

   Tried the above, but not able to fix the issue. time.sleep(0.5) will work.
 

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! 😀

    Attached is the modified patch where I have added "driver.implicitly_wait(1)" call only for Firefox browser. Only two test cases are failing on my machine and I am not able to fix those. Please someone look into it and help me out. 

Anthony






--
Akshay Joshi
Sr. Software Architect


Phone: +91 20-3058-9517
Mobile: +91 976-788-8246
Attachment

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

Screenshot from 2018-05-07 13-17-40.png

add a new reusable method to the page object that waits for attach/detach

Screenshot from 2018-05-07 13-18-40.png

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
Hi Anthony 

On which operating system you were running the test cases. On my OSX machine only two test cases are failing which I have mentioned in my previous email, but when I tried it on Ubuntu 16, most of the test cases are failing because FireFox unable to mouse hover on "Object -> Create->" menu to open the "Server" sub menu to add new server. To fix that I have added following code:
cap = DesiredCapabilities.FIREFOX
cap['requireWindowFocus'] = True
cap['enablePersistentHover'] = False
By adding above that problem is resolved. Two test cases are still failing on my machine (CopySelectedQueryResultsFeatureTest and CheckForViewDataTest). Attached is the modified patch (included Anthony's patch).

On Mon, May 7, 2018 at 10:59 PM, Anthony Emengo <aemengo@pivotal.io> wrote:

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

Screenshot from 2018-05-07 13-17-40.png

add a new reusable method to the page object that waits for attach/detach

Screenshot from 2018-05-07 13-18-40.png

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!






--
Akshay Joshi
Sr. Software Architect


Phone: +91 20-3058-9517
Mobile: +91 976-788-8246
Attachment

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:

Screen Shot 2018-05-08 at 11.25.00 AM.png

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.

CopySelectedQueryResultsFeatureTest-2018.05.08_11.27.56-Python-3.6.5.png
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

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
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. 

On Wed, May 9, 2018 at 3:58 AM, Anthony Emengo <aemengo@pivotal.io> wrote:

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.




--
Akshay Joshi
Sr. Software Architect


Phone: +91 20-3058-9517
Mobile: +91 976-788-8246
Attachment
Hi

On 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.292s

FAILED (failures=1, errors=1)

======================================================================
Test Result Summary
======================================================================

Regression - PG 9.4:

9 tests passed
2 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
Attachment
Hi

On Wed, May 9, 2018 at 6:19 PM, Dave Page <dpage@pgadmin.org> wrote:
Hi

On 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: 

    This is the intermittent issue I was highlighted in my previous email.  


======================================================================
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 

    I 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.292s

FAILED (failures=1, errors=1)

======================================================================
Test Result Summary
======================================================================

Regression - PG 9.4:

9 tests passed
2 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



   Attached 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 Joshi
Sr. Software Architect


Phone: +91 20-3058-9517
Mobile: +91 976-788-8246
Attachment
Hi

On Wed, May 9, 2018 at 2:55 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Hi

On Wed, May 9, 2018 at 6:19 PM, Dave Page <dpage@pgadmin.org> wrote:
Hi

On 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: 

    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.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 

    I 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.292s

FAILED (failures=1, errors=1)

======================================================================
Test Result Summary
======================================================================

Regression - PG 9.4:

9 tests passed
2 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



   Attached 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 Joshi
Sr. Software Architect


Phone: +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
Hi Dave

On Thu, May 10, 2018 at 2:03 PM, Dave Page <dpage@pgadmin.org> wrote:
Hi

On Wed, May 9, 2018 at 2:55 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Hi

On Wed, May 9, 2018 at 6:19 PM, Dave Page <dpage@pgadmin.org> wrote:
Hi

On 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: 

    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.

    Today I have tried more than 10 times and every time test case gets passed. Not sure how to fix that. As per the above stack trace line no 169 is wait statement of WebDriverWait().  
 


======================================================================
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 

    I 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?

    Yes, Anthony's method is more correct way, but that was not working at all. I have tried a lot with different type of ExpectedCondtions (EC.<condition>) but no success. 
     Problem here is When we open file manager dialog from query tool and select "/tmp" directory and send keys Keys.RETURN that time we need some kind of wait(sleep) so that content of "/tmp" folder should be rendered, and then second wait(sleep) will be required when content should be read from the dialog, but without sleep "Cancel" button has been clicked. Not sure what kind of wait statement required here. 

    @Anthony can you please suggest something.   
  
 

----------------------------------------------------------------------
Ran 11 tests in 475.292s

FAILED (failures=1, errors=1)

======================================================================
Test Result Summary
======================================================================

Regression - PG 9.4:

9 tests passed
2 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



   Attached 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 Joshi
Sr. Software Architect


Phone: +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 Joshi
Sr. Software Architect


Phone: +91 20-3058-9517
Mobile: +91 976-788-8246

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.

Screen Shot 2018-05-11 at 5.55.54 PM.png

Screen Shot 2018-05-11 at 5.55.40 PM.png

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.

Cheers and good weekend! 😀
Attachment
Hi Anthony 

Thanks for updated patch, it is working fine on my machine. I have tested it couple of times.

On Sat, May 12, 2018 at 3:48 AM, Anthony Emengo <aemengo@pivotal.io> wrote:

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.

Screen Shot 2018-05-11 at 5.55.54 PM.png

Screen Shot 2018-05-11 at 5.55.40 PM.png

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.

Cheers and good weekend! 😀



--
Akshay Joshi
Sr. Software Architect


Phone: +91 20-3058-9517
Mobile: +91 976-788-8246
Attachment

Hi

On Mon, May 14, 2018 at 7:29 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Hi Anthony 

Thanks 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
Attachment
Hi Dave 

On 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:

Hi

On Mon, May 14, 2018 at 7:29 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Hi Anthony 

Thanks 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



--
Akshay Joshi
Sr. Software Architect


Phone: +91 20-3058-9517
Mobile: +91 976-788-8246


On Mon, May 14, 2018 at 2:03 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Hi Dave 

On which database server you are running this test cases, I have tested it on PG 9.6  

PG 9.4.
 

On Mon, May 14, 2018 at 5:45 PM, Dave Page <dpage@pgadmin.org> wrote:

Hi

On Mon, May 14, 2018 at 7:29 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Hi Anthony 

Thanks 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



--
Akshay Joshi
Sr. Software Architect


Phone: +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
Hi Dave

On 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 Dave 

On which database server you are running this test cases, I have tested it on PG 9.6  

PG 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:

Hi

On Mon, May 14, 2018 at 7:29 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Hi Anthony 

Thanks 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



--
Akshay Joshi
Sr. Software Architect


Phone: +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 Joshi
Sr. Software Architect


Phone: +91 20-3058-9517
Mobile: +91 976-788-8246
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 Toshniwal
Software 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 Dave

On 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 Dave 

On which database server you are running this test cases, I have tested it on PG 9.6  

PG 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:

Hi

On Mon, May 14, 2018 at 7:29 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Hi Anthony 

Thanks 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



--
Akshay Joshi
Sr. Software Architect


Phone: +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 Joshi
Sr. Software Architect


Phone: +91 20-3058-9517
Mobile: +91 976-788-8246

Hi

On Tue, May 15, 2018 at 7:05 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Hi Dave

On 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 Dave 

On which database server you are running this test cases, I have tested it on PG 9.6  

PG 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 ?

postgresql.conf attached (though there's nothing unusual in it afaics). There are no changes in datatype_test.json.

Server is PostgreSQL 9.4.10 on x86_64-apple-darwin, compiled by i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00), 64-bit

Cluster encoding is UTF-8, locale is C.
 
 

On Mon, May 14, 2018 at 5:45 PM, Dave Page <dpage@pgadmin.org> wrote:

Hi

On Mon, May 14, 2018 at 7:29 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Hi Anthony 

Thanks 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



--
Akshay Joshi
Sr. Software Architect


Phone: +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 Joshi
Sr. Software Architect


Phone: +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
Attachment
Hi

On 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 Toshniwal
Software 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 Dave

On 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 Dave 

On which database server you are running this test cases, I have tested it on PG 9.6  

PG 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:

Hi

On Mon, May 14, 2018 at 7:29 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Hi Anthony 

Thanks 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



--
Akshay Joshi
Sr. Software Architect


Phone: +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 Joshi
Sr. Software Architect


Phone: +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

On Tue, May 15, 2018 at 6:05 PM, Dave Page <dpage@pgadmin.org> wrote:
Hi

On 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 Toshniwal
Software 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 Dave

On 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 Dave 

On which database server you are running this test cases, I have tested it on PG 9.6  

PG 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:

Hi

On Mon, May 14, 2018 at 7:29 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Hi Anthony 

Thanks 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



--
Akshay Joshi
Sr. Software Architect


Phone: +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 Joshi
Sr. Software Architect


Phone: +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



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:
Hi

On 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 Toshniwal
Software 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 Dave

On 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 Dave 

On which database server you are running this test cases, I have tested it on PG 9.6  

PG 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:

Hi

On Mon, May 14, 2018 at 7:29 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Hi Anthony 

Thanks 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



--
Akshay Joshi
Sr. Software Architect


Phone: +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 Joshi
Sr. Software Architect


Phone: +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


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:
Hi

On 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 Toshniwal
Software 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 Dave

On 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 Dave 

On which database server you are running this test cases, I have tested it on PG 9.6  

PG 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:

Hi

On Mon, May 14, 2018 at 7:29 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Hi Anthony 

Thanks 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



--
Akshay Joshi
Sr. Software Architect


Phone: +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 Joshi
Sr. Software Architect


Phone: +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


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:
Hi

On 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 Toshniwal
Software 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 Dave

On 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 Dave 

On which database server you are running this test cases, I have tested it on PG 9.6  

PG 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:

Hi

On Mon, May 14, 2018 at 7:29 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Hi Anthony 

Thanks 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



--
Akshay Joshi
Sr. Software Architect


Phone: +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 Joshi
Sr. Software Architect


Phone: +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


On Tue, 15 May 2018, 19:56 Dave Page, <dpage@pgadmin.org> wrote:


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:
Hi

On 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?
Yes, the same error you were getting.


 
 

Thanks and Regards,
Aditya Toshniwal
Software 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 Dave

On 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 Dave 

On which database server you are running this test cases, I have tested it on PG 9.6  

PG 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:

Hi

On Mon, May 14, 2018 at 7:29 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Hi Anthony 

Thanks 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



--
Akshay Joshi
Sr. Software Architect


Phone: +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 Joshi
Sr. Software Architect


Phone: +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