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

From: Akshay Joshi <akshay(dot)joshi(at)enterprisedb(dot)com>
To: Anthony Emengo <aemengo(at)pivotal(dot)io>
Cc: Dave Page <dpage(at)pgadmin(dot)org>, pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: [pgAdmin4][Patch] Feature #3270 Add support for running regression tests against Firefox
Date: 2018-04-24 06:26:18
Message-ID: CANxoLDcX2Qw60JS2uMkkE+HEguds=gLmzAM=9B3WCXp=OCMWkA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hi Hackers,

On Mon, Apr 23, 2018 at 9:07 PM, Anthony Emengo <aemengo(at)pivotal(dot)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(at)pgadmin(dot)org> wrote:
>
>> Hi
>>
>> On Mon, Apr 23, 2018 at 2:05 PM, Akshay Joshi <
>> akshay(dot)joshi(at)enterprisedb(dot)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-9517Mobile: +91 976-788-8246*

Attachment Content-Type Size
RM_3270_v2.patch application/octet-stream 3.3 KB

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Murtuza Zabuawala 2018-04-24 07:45:36 Re: [pgAdmin4][RM#3155] Allow user to lock the Layout
Previous Message Anthony Emengo 2018-04-23 15:37:44 Re: [pgAdmin4][Patch] Feature #3270 Add support for running regression tests against Firefox