Re: [pgAdmin4][Patch][RM_2400]: Columns with defaults set to NULL when removing contents after pasting in the edit grid

From: Surinder Kumar <surinder(dot)kumar(at)enterprisedb(dot)com>
To: Dave Page <dpage(at)pgadmin(dot)org>
Cc: Joao Pedro De Almeida Pereira <jdealmeidapereira(at)pivotal(dot)io>, Shruti B Iyer <siyer(at)pivotal(dot)io>, pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: [pgAdmin4][Patch][RM_2400]: Columns with defaults set to NULL when removing contents after pasting in the edit grid
Date: 2017-06-02 19:55:52
Message-ID: CAM5-9D-WhtWQr+5ZOsv6twB1i52aJdV0m=qxCJv6f47CmK0Q4g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hi Dave,

Please find updated patch with following changes:

1) Locate grid row by div's style attribute 'top'(i.e. 'top:0px' for first
row), instead of by div class-name because the order of rendered rows is
not always same.

2) Increase the wait timeout of WebDriverWait to 5 seconds in
'_compare_cell_value(...)' method.

3) Add a new utils method 'find_by_css_selector' in pgadmin_page.py to
locate css element with wait_for method.

4) Add a new utils method 'wait_for_element_to_stale' in pgadmin_page.py.
It is useful when "StaleElementReferenceException" exception is raised and
element is not attached to the page while finding element by xpath.

5) Instead of finding each cell value by xpath and compare with actual
value, now a row is located using xpath and all of cell values are
extracted into an array and then compared with actual values. It eliminates
the use of wait_timeout.

Also, I added a print statement for debugging where a TimeoutException was
occurred last time.

On Sun, May 28, 2017 at 1:58 AM, Dave Page <dpage(at)pgadmin(dot)org> wrote:

> Here's the screenshot.
>
> On Sat, May 27, 2017 at 4:26 PM, Dave Page <dpage(at)pgadmin(dot)org> wrote:
> > Hi
> >
> > On Sat, May 27, 2017 at 4:03 PM, Surinder Kumar
> > <surinder(dot)kumar(at)enterprisedb(dot)com> wrote:
> >> Hi Dave
> >>
> >> Please find update Feature test cases patch.
> >>
> >> On Sun, May 28, 2017 at 12:40 AM, Dave Page <dpage(at)pgadmin(dot)org> wrote:
> >>>
> >>> Thanks - I committed the code changes, as they seem to work very well.
> >>> The regression tests are failing for me though :-(. Can you take
> >>> another look please? Note that I'm running under Python 2.7 on Mal
> >>
> >> Actually i used the generic close_query_tool method to close view data
> panel
> >> which popup with unsaved changes. but in my case nothing popups as
> there as
> >> no unsaved changes, so clicking on [x] button close the panel. So I
> write
> >> close_data_grid method in pgadmin_page.py file.
> >
> > It passed with PG 9.4, but then failed (twice) under 9.6:
> >
> > ======================================================================
> > ERROR: runTest (pgadmin.feature_tests.view_data_dml_queries.
> CheckForViewDataTest)
> > Validate Insert, Update operations in View data with given test data
> > ----------------------------------------------------------------------
> > Traceback (most recent call last):
> > File "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/
> view_data_dml_queries.py",
> > line 105, in runTest
> > self._copy_paste_row()
> > File "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/
> view_data_dml_queries.py",
> > line 250, in _copy_paste_row
> > self._verify_row_data(False)
> > File "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/
> view_data_dml_queries.py",
> > line 275, in _verify_row_data
> > self._compare_cell_value(cell_xpath, config_data[str(idx)][1])
> > File "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/
> view_data_dml_queries.py",
> > line 142, in _compare_cell_value
> > CheckForViewDataTest.TIMEOUT_STRING
> > 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: Timed out waiting for div element to appear
> >
> >
> > ----------------------------------------------------------------------
> >
> >
> > --
> > 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
>

Attachment Content-Type Size
Feature_test_cases_view_data_v5.patch application/octet-stream 16.2 KB

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Surinder Kumar 2017-06-05 05:30:07 Re: [pgAdmin4] [PATCH] History Tab rewrite in React
Previous Message Murtuza Zabuawala 2017-06-02 15:22:45 [pgAdmin4][PATCH] Display Security Labels in SQL (PPAS9.2+)