Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cTWKZ-0003RJ-UC for pgadmin-hackers@arkaria.postgresql.org; Tue, 17 Jan 2017 16:09:56 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cTWKZ-00020V-H4 for pgadmin-hackers@arkaria.postgresql.org; Tue, 17 Jan 2017 16:09:55 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cTWKY-0001xy-My for pgadmin-hackers@postgresql.org; Tue, 17 Jan 2017 16:09:54 +0000 Received: from mail-yw0-x22c.google.com ([2607:f8b0:4002:c05::22c]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1cTWKV-0005N0-9U for pgadmin-hackers@postgresql.org; Tue, 17 Jan 2017 16:09:53 +0000 Received: by mail-yw0-x22c.google.com with SMTP id v200so17057543ywc.3 for ; Tue, 17 Jan 2017 08:09:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pivotal-io.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to:cc; bh=aR7+RZu18qDt0R2QWkLYyWjlO5gYMpzNs94l1zPbx/Q=; b=AOggZR9G6MT2CenKTHfBbgz7aIY9MqBlUxSabClvAwZZfej1BOFcjR92I7+15QG4Pm wLh75n/uJl77GKq/vHQxruA1qhlZu2BKWwkrYZ4Pt8jEiyjz13wTQY/YFyRdzGf0jkrd hi+xb+05vBI6TtLTyD4DnyrKdNuUAfnO6tppBZBOmRQYQ+jrr4zgQxAixPhixT2J5KT+ vRlXgj6LmhOuU0NR18E++dK+711uOpvsqeYFk1J4sw0sB5AmuVmCSF9Az9P5hOCsBfJX cCI8H0/FHf5eXpZRqlMWyn9cTb03+q4/RxtEv4Nus8elGn+GXusogKvc8d64Tyf2pgtY 15BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=aR7+RZu18qDt0R2QWkLYyWjlO5gYMpzNs94l1zPbx/Q=; b=Mr2wL2AxPb9xKC1rtfsIiNgiA3v6/6GbpzAxu78fxjBNBnwuiH5KB5AzJQqdHTp30b 6Om9q4P2UHGOX08wOvWdcBHc0jk80krDzuD8ahBbafoNEf2F2aj4qxxa0wLyFjv3ixIX KDEXqdPg76GN+FsLK5nbYtmgo409fJeKXWT4iB27KRhMsx7fbyaV9kJb56wBnsWy9aQA 4llBCfInCjtNKhltwy6qlPcOnKcDz/4KescowFT+mvqsMg55+F33pBYW6zCAHAlNtgse NlhCHHJ0KMwL7EEAshQ0Q16AMuUNyS9mwC48z6C3aGZw6LpIB28HliEfHpRoXywbzWo3 oXrQ== X-Gm-Message-State: AIkVDXKwnX+BGdTzWeyPIOI+Josr5+V8vWUWpWQFSbyU57oHBEdo3LH31EeeJGsux5fX8Z3MDNej+4vBNVxDVyQ/ X-Received: by 10.55.65.66 with SMTP id o63mr14414384qka.252.1484669388547; Tue, 17 Jan 2017 08:09:48 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.102.16 with HTTP; Tue, 17 Jan 2017 08:09:48 -0800 (PST) From: Atira Odhner Date: Tue, 17 Jan 2017 11:09:48 -0500 Message-ID: Subject: Re: Acceptance Tests against a browser (WIP) To: pgadmin-hackers@postgresql.org Cc: George Gelashvili Content-Type: multipart/alternative; boundary=001a114ac04883821c05464c87cc X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgadmin-hackers Precedence: bulk Sender: pgadmin-hackers-owner@postgresql.org --001a114ac04883821c05464c87cc Content-Type: text/plain; charset=UTF-8 Thanks for your feedback, Dave! We can put the tests under the regression directory. I think that makes sense. I'm not picturing these tests being module specific, but we may want to enable running it as a separate suite of tests. Thanks for the callout about the port and title. We'll make sure those are pulled from config or that the pgAdmin server is spun up by the test with specific values. I have a couple ideas about why the test might not have been running for you. I think the patch we attached didn't spin up its own pgAdmin yet and it definitely doesn't fill in username/password if your app is running that way. That's part of the WIP-ness :-P -Tira Hi On Thu, Jan 12, 2017 at 10:41 PM, George Gelashvili wrote: > here's the patch we forgot to attach. Also, you can see work on our branch > at: > https://github.com/pivotalsoftware/pgadmin4/tree/pivotal/acceptance-tests > > On Thu, Jan 12, 2017 at 5:26 PM, George Gelashvili > wrote: >> >> Hi there, >> >> We are working on browser-automation-based acceptance tests that exercise >> pgAdmin4 the way a user might. Nice! >> The first "connect to database" test works, but at the moment depends on >> Chrome and chromedriver. We would appreciate feedback on any possible >> license or code style issues at this point, as well as any thoughts on >> adding this sort of test to the codebase. A few thoughts: - If these tests are to run as part of the regression suite, the framework for them should live under that directory. - Are any of the tests likely to be module-specific? If so, they should really be part of the relevant module as the regression tests are. If they're more general/less tightly coupled, then I don't see a problem with them residing where they are. - Please take care not to include changes to .gitgnore files that aren't relevant to the rest of us. - The port number is hard-coded in the test. - You've hard-coded the string "pgAdmin 4". We've tried to keep that title as a config option in config.py, so you should pull the string from there rather than hard-coding it. - The connect test fails for me (Mac, Python 2.7). I have a suspicion that this may be because when the test starts chromedriver, OS X prompts the user about whether a listening port should be opened, but the tests don't wait (though, I tested with 3 servers configured and it failed with the same error on the second and third as well, long after I clicked OK on the prompt): Traceback (most recent call last): File "/Users/dpage/git/pgadmin4/web/acceptance/test_connects_to_database.py", line 32, in runTest self.assertEqual("pgAdmin 4", self.driver.title) AssertionError: 'pgAdmin 4' != u'localhost' - Please keep tests in the pgadmin. namespace (pgadmin.acceptance.??). - It looks like running a single test won't work yet (because of TestsGeneratorRegistry.load_generators('pgadmin.%s.tests' % arguments['pkg'])) Thanks! -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company --001a114ac04883821c05464c87cc Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thanks for your feedback, Dave!

<= div>We can put the tests under the regression directory. I think that makes= sense.=C2=A0
I'm not picturing these tests being module spec= ific, but we may want to enable running it as a separate suite of tests.=C2= =A0

Thanks for the callout about the port and titl= e. We'll make sure those are pulled from config or that the pgAdmin ser= ver is spun up by the test with specific values.=C2=A0

=
I have a couple ideas about why the test might not have been running f= or you. I think the patch we attached didn't spin up its own pgAdmin ye= t and it definitely doesn't fill in username/password if your app is ru= nning that way. That's part of the WIP-ness :-P

-Tira

Hi

On Thu, Jan 12, 2017 at 10:41 PM, George Gelashvili
<ggelashvili(at)pivotal(dot)io> wrote:
> here's the patch we forgot to attach. Also, you can see work on ou=
r branch
> at:
> https://gith=
ub.com/pivotalsoftware/pgadmin4/tree/pivotal/acceptance-tests
>
> On Thu, Jan 12, 2017 at 5:26 PM, George Gelashvili <ggelashvili(at)=
pivotal(dot)io>
> wrote:
>>
>> Hi there,
>>
>> We are working on browser-automation-based acceptance tests that e=
xercise
>> pgAdmin4 the way a user might.

Nice!

>> The first "connect to database" test works, but at the m=
oment depends on
>> Chrome and chromedriver. We would appreciate feedback on any possi=
ble
>> license or code style issues at this point, as well as any thought=
s on
>> adding this sort of test to the codebase.

A few thoughts:

- If these tests are to run as part of the regression suite, the
framework for them should live under that directory.

- Are any of the tests likely to be module-specific? If so, they
should really be part of the relevant module as the regression tests
are. If they're more general/less tightly coupled, then I don't see=
 a
problem with them residing where they are.

- Please take care not to include changes to .gitgnore files that
aren't relevant to the rest of us.

- The port number is hard-coded in the test.

- You've hard-coded the string "pgAdmin 4". We've tried t=
o keep that
title as a config option in config.py, so you should pull the string
from there rather than hard-coding it.

- The connect test fails for me (Mac, Python 2.7). I have a suspicion
that this may be because when the test starts chromedriver, OS X
prompts the user about whether a listening port should be opened, but
the tests don't wait (though, I tested with 3 servers configured and
it failed with the same error on the second and third as well, long
after I clicked OK on the prompt):

Traceback (most recent call last):
  File "/Users/dpage/git/pgadmin4/web/acceptance/test_connects_to_data=
base.py",
line 32, in runTest
    self.assertEqual("pgAdmin 4", self.driver.title)
AssertionError: 'pgAdmin 4' !=3D u'localhost'

- Please keep tests in the pgadmin. namespace (pgadmin.acceptance.??).

- It looks like running a single test won't work yet (because of
TestsGeneratorRegistry.load_generators('pgadmin.%s.tests' %
arguments['pkg']))

Thanks!

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

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

--001a114ac04883821c05464c87cc--