Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fXj04-0005Fn-Rn for pgadmin-hackers@arkaria.postgresql.org; Tue, 26 Jun 2018 08:06:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fXj03-0001Ec-A6 for pgadmin-hackers@arkaria.postgresql.org; Tue, 26 Jun 2018 08:06: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.89) (envelope-from ) id 1fXig5-0006fu-0Z for pgadmin-hackers@lists.postgresql.org; Tue, 26 Jun 2018 07:46:17 +0000 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fXifx-0007Vr-3W for pgadmin-hackers@postgresql.org; Tue, 26 Jun 2018 07:46:15 +0000 Received: by mail-wr0-x243.google.com with SMTP id h10-v6so16120475wrq.8 for ; Tue, 26 Jun 2018 00:46:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=3kfiRNArzALkvkm+n2PPIKz3xXgFGuu5Vdbh4R2ePs4=; b=X6iU4Iop0SGzXLYJ9ZVAqP77qUk7gfI92Vm6/wQaITzAOVU3IWNzU3/bjkMBO5R+Lg GmyLwKYHR/jmRfwtvOqsAibF7PUvlI6rh3BkZ3Dzneq93e03VtNr/1HIqZDb5qHl0rk4 L6hHE3jTHNq9lfs3hFu0j6XMNyHMXzv/GzPzNpNgZRzv/BuWMz2yDSIA6y7HhLYxWob/ MenFpYvOkvzoD0xN6RJUswdxMuHpH1J6Q8O7Oxw8XrkPmRc492kVFEicckJ95d+Gwysg gwYklZ8JmQE7MRoX/rk3RvcaMM/lp/36giLi/xd/2lU57AjwvgW4HiAkYQ3pZ4P4y9fl iPQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=3kfiRNArzALkvkm+n2PPIKz3xXgFGuu5Vdbh4R2ePs4=; b=JUZuY0VwU8W+2F7DnU0+m2lCGZuLkRYVmc6nt4o0PHTEl4ApcenA3S2OUgn0Rgvz2h biXir/4LzBARglqi1p/t21abbSJUQWWaC1XCqqVE/wVFxpVyrD4g4gelZj0PzyItDG5T LyEFjnE43rCjU4VLem66/Oc3dfvOYE32zyc+TD462ORtSR6eFMUx1a+rVj9vzxUdGn7E f4ZfaJbUVAupU0JLPwnwLkRZHd/I6T+qkkLSzZ3ySLfbJCn0GKaHsDl+hI72qk4OAy9M tirN8YZAiZ14/NZGm+EwdHKmjmtd1Cff71UCeOQlinuyHvdOfs9x2+hyEmRESQUMF71q 1k9A== X-Gm-Message-State: APt69E16QP0VXbuEzLJTNpIB2l2eZqbNhaplflSqHDXbMJVCkxOzxaZH ZaFWS348Syv4Suo9EN6iv2pc6Hbh9w10N1W1ddN0WA== X-Google-Smtp-Source: AAOMgpd9cS1+yjQjHdM2Wd9PgilL9oSZxRK7GK/ATdPckJKEy6ziqHQVcnm2lUv5EGTi5Av6khqxIhMA98ZVsvTqu9s= X-Received: by 2002:adf:e644:: with SMTP id b4-v6mr464472wrn.254.1529999167439; Tue, 26 Jun 2018 00:46:07 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:adf:8527:0:0:0:0:0 with HTTP; Tue, 26 Jun 2018 00:45:46 -0700 (PDT) In-Reply-To: References: From: Shubham Agarwal Date: Tue, 26 Jun 2018 03:45:46 -0400 Message-ID: Subject: Re: pgadmin_page functions updated To: Dave Page Cc: Khushboo Vashi , pgadmin-hackers Content-Type: multipart/mixed; boundary="000000000000e20f79056f86b039" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --000000000000e20f79056f86b039 Content-Type: multipart/alternative; boundary="000000000000e20f77056f86b037" --000000000000e20f77056f86b037 Content-Type: text/plain; charset="UTF-8" Hi Team, I have modified the patch and used CSS Selector in add_server() function. I have also tried different approaches to eliminate XPATH in click_tab() function but failed to do so due to following reasons-: 1. :contains() function doesnt work with CSS selector in selenium and since in most of the anchor tags there is no specific attribute present by which we can make the locator generic so that it can work for any tab. 2. Tried using link_text or partial_link_text locators but since click_tab() is a generic function which can click on any of the provided tab name and in our case we do not have every tab having href attribute, we have span tag as the tab as well (ex. Query tool tab) so link_text is not the right option for it since it work only with the href attribute or anchor tag. I found that in such cases XPATH is the only option to continue with. If anybody is having some another idea to achieve this using CSS Selector than please suggest. Thanks and Regards, Shubham Agarwal On Fri, Jun 15, 2018 at 4:11 AM, Dave Page wrote: > > > On Fri, Jun 15, 2018 at 6:32 AM, Khushboo Vashi < > khushboo.vashi@enterprisedb.com> wrote: > >> Hi Shubham, >> >> On Thu, Jun 14, 2018 at 3:25 PM, Shubham Agarwal < >> shubham.agarwal@enterprisedb.com> wrote: >> >>> Hi Team, >>> >>> I have modified following two functions in pgadmin_page.py :- >>> >>> 1. click_tab() -> Added wait till element is clickable, test cases are >>> failing since the function attempts to click the tab which is not yet in >>> the state to be clicked. >>> >>> 2. add_server() -> Replaced the sleep statement with wait till element >>> to be clickable. >>> >>> Please find the attached patch. >>> >>> We should start using CSS selectors instead of xpath, otherwise the >> patch works fine and also changes look good to me. >> > > Yes, and we should update files as and when we touch them as part of our > ongoing refactoring. > > Shubham; please go through the files your patch touches, and replace any > xpath selectors with CSS selectors. Aside from that, the patch looked to > me too, and Pivotal's patch-bot seems happy with it. > > Thanks. > > -- > Dave Page > Blog: http://pgsnake.blogspot.com > Twitter: @pgsnake > > EnterpriseDB UK: http://www.enterprisedb.com > The Enterprise PostgreSQL Company > -- Thanks & Regards, Shubham Agarwal EnterpriseDB Corporation The Postgres Database Company --000000000000e20f77056f86b037 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Team,

I have modified the patch and = used CSS Selector in add_server() function.

I have= also tried different approaches to eliminate XPATH in click_tab() function= but failed to do so due to following reasons-:=C2=A0

<= div>=C2=A0 =C2=A01. :contains() function doesnt work with CSS selector in s= elenium and since in most of the anchor tags there is no specific attribute= present by which we can make the locator generic so that it can work for a= ny tab.

=C2=A0 =C2=A02. Tried using link_text or p= artial_link_text locators but since click_tab() is a generic function which= can click on any of the provided tab name and in our case we do not have e= very tab having href attribute, we have span tag as the tab as well (ex. Qu= ery tool tab) so link_text is not the right option for it since it work onl= y with the href attribute or anchor tag.

I found t= hat in such cases XPATH is the only option to continue with.

=
If anybody is having some another idea to achieve this using CSS= Selector than please suggest.

Thanks and Regards,=
Shubham Agarwal

On Fri, Jun 15, 2018 at 4:11 AM, Dave Page <dpage@p= gadmin.org> wrote:


On Fri, Jun 15, 2018 at 6:32 AM, Khushboo Vashi <khushboo.vashi@enterprisedb.com> wrote:
Hi Shubham,

On Thu, Jun 14, 2018 at 3:25 PM, S= hubham Agarwal <shubham.agarwal@enterprisedb.com&g= t; wrote:
Hi Team= ,

I have modified following two functions in pgadmin_pag= e.py :-

1. click_tab() -> Added wait till eleme= nt is clickable, test cases are failing since the function attempts to clic= k the tab which is not yet in the state to be clicked.

=
2. add_server() -> Replaced the sleep statement with wait till elem= ent to be clickable.=C2=A0

Please find the attache= d patch.<= font color=3D"#888888">

We should start using CSS selectors instead= of xpath, otherwise the patch works fine and also changes look good to me.=

Yes, and we= should update files as and when we touch them as part of our ongoing refac= toring.

Shubham; please go through the files your = patch touches, and replace any xpath selectors with CSS selectors.=C2=A0 As= ide from that, the patch looked to me too, and Pivotal's patch-bot seem= s happy with it.

Thanks.

--
Dave Pa= ge
Blog: http:= //pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterpris= edb.com
The Enterprise PostgreSQL Company



--
Thanks = & Regards,
Shubham Agarwal
EnterpriseDB Cor= poration

The Postgres D= atabase Company
--000000000000e20f77056f86b037-- --000000000000e20f79056f86b039 Content-Type: text/x-patch; charset="US-ASCII"; name="pgadmin_page.patch" Content-Disposition: attachment; filename="pgadmin_page.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_jivdyjsj0 ZGlmZiAtLWdpdCBhL3dlYi9yZWdyZXNzaW9uL2ZlYXR1cmVfdXRpbHMvcGdhZG1pbl9wYWdlLnB5 IGIvd2ViL3JlZ3Jlc3Npb24vZmVhdHVyZV91dGlscy9wZ2FkbWluX3BhZ2UucHkKaW5kZXggNzg1 NzhhMi4uY2U5YmZhMyAxMDA2NDQKLS0tIGEvd2ViL3JlZ3Jlc3Npb24vZmVhdHVyZV91dGlscy9w Z2FkbWluX3BhZ2UucHkKKysrIGIvd2ViL3JlZ3Jlc3Npb24vZmVhdHVyZV91dGlscy9wZ2FkbWlu X3BhZ2UucHkKQEAgLTYwLDkgKzYwLDkgQEAgY2xhc3MgUGdhZG1pblBhZ2U6CiAgICAgICAgIHNl bGYuZmlsbF9pbnB1dF9ieV9maWVsZF9uYW1lKCJwb3J0Iiwgc2VydmVyX2NvbmZpZ1sncG9ydCdd KQogICAgICAgICBzZWxmLmZpbGxfaW5wdXRfYnlfZmllbGRfbmFtZSgidXNlcm5hbWUiLCBzZXJ2 ZXJfY29uZmlnWyd1c2VybmFtZSddKQogICAgICAgICBzZWxmLmZpbGxfaW5wdXRfYnlfZmllbGRf bmFtZSgicGFzc3dvcmQiLCBzZXJ2ZXJfY29uZmlnWydkYl9wYXNzd29yZCddKQotICAgICAgICAj IFJlcXVpcmVkIHNsZWVwIHRvIGF2b2lkICJmZV9zZW5kYXV0aCIgcGFzc3dvcmQgZXJyb3IuCi0g ICAgICAgIHRpbWUuc2xlZXAoMC41KQotICAgICAgICBzZWxmLmZpbmRfYnlfeHBhdGgoIi8vYnV0 dG9uW2NvbnRhaW5zKC4sJ1NhdmUnKV0iKS5jbGljaygpCisgICAgICAgIFdlYkRyaXZlcldhaXQo c2VsZi5kcml2ZXIsIDEwKS51bnRpbChFQy5lbGVtZW50X3RvX2JlX2NsaWNrYWJsZSgKKyAgICAg ICAgICAgIChCeS5DU1NfU0VMRUNUT1IsICJidXR0b25bdHlwZT0nc2F2ZSddLmJ0bi5idG4tcHJp bWFyeSIpKSkKKyAgICAgICAgc2VsZi5maW5kX2J5X2Nzc19zZWxlY3RvcigiYnV0dG9uW3R5cGU9 J3NhdmUnXS5idG4uYnRuLXByaW1hcnkiKS5jbGljaygpCiAKICAgICAgICAgc2VsZi5maW5kX2J5 X3hwYXRoKAogICAgICAgICAgICAgIi8vKltAaWQ9J3RyZWUnXS8vKlsuPSciICsgc2VydmVyX2Nv bmZpZ1snbmFtZSddICsgIiddIikKQEAgLTI0NSw2ICsyNDUsMTEgQEAgY2xhc3MgUGdhZG1pblBh Z2U6CiAgICAgICAgIGFjdGlvbi5wZXJmb3JtKCkKIAogICAgIGRlZiBjbGlja190YWIoc2VsZiwg dGFiX25hbWUpOgorICAgICAgICBXZWJEcml2ZXJXYWl0KHNlbGYuZHJpdmVyLCAxMCkudW50aWwo RUMuZWxlbWVudF90b19iZV9jbGlja2FibGUoCisgICAgICAgICAgICAoQnkuWFBBVEgsICIvLypb Y29udGFpbnMoQGNsYXNzLCd3Y1RhYlRvcCcpXS8vIgorICAgICAgICAgICAgICAgICAgICAgICAi Kltjb250YWlucyhAY2xhc3MsJ3djUGFuZWxUYWInKSAiCisgICAgICAgICAgICAgICAgICAgICAg ICJhbmQgY29udGFpbnMoLiwnIiArIHRhYl9uYW1lICsgIicpXSIpKSkKKwogICAgICAgICB0YWIg PSBzZWxmLmZpbmRfYnlfeHBhdGgoIi8vKltjb250YWlucyhAY2xhc3MsJ3djVGFiVG9wJyldLy8i CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiKltjb250YWlucyhAY2xhc3MsJ3dj UGFuZWxUYWInKSAiCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiYW5kIGNvbnRh aW5zKC4sJyIgKyB0YWJfbmFtZSArICInKV0iKQo= --000000000000e20f79056f86b039--