Обсуждение: [pgadmin-hackers] [pgAdmin4] Feature tests fails on smaller screen resolution
[pgadmin-hackers] [pgAdmin4] Feature tests fails on smaller screen resolution
От
Murtuza Zabuawala
Дата:
Hello Pivotal team,
Trace:-
Need your suggestion on given issue, We have noticed that feature tests do not run when we have smaller screen resolutions.
Is there any generic way to handle different screen resolutions of host system in feature tests?
Steps to re-produce the issue on macOS(10.10.5)
1) Go to "System preference..."
2) Select "Display"
3) Choose "Resolution" -> Scaled
4) Select "Larger Text"
5) Run the feature tests now
You will notice that all of the feature tests fails on server creation dialog.
Screen resolution where all tests fails,
--![Inline image 1](/media/maillist_attaches/pgadmin-hackers/2017/05/30/CAKKotZTNmLsxw1_RqakhtDa2Tdy0fOzJHw0O9m2hJ-+uN+bfKA@mail.gmail.com/image.png)
![Inline image 1](/media/maillist_attaches/pgadmin-hackers/2017/05/30/CAKKotZTNmLsxw1_RqakhtDa2Tdy0fOzJHw0O9m2hJ-+uN+bfKA@mail.gmail.com/image.png)
Trace:-
======================================================================
ERROR: runTest (pgadmin.feature_tests.connect_to_server_feature_test.ConnectsToServerFeatureTest)
Test database connection
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/murtuza/Documents/projects/pgadmin4/web/pgadmin/feature_tests/connect_to_server_feature_test.py", line 41, in runTest
self._connects_to_server()
File "/Users/murtuza/Documents/projects/pgadmin4/web/pgadmin/feature_tests/connect_to_server_feature_test.py", line 69, in _connects_to_server
self.page.find_by_xpath("//button[contains(.,'Save')]").click()
File "/Users/murtuza/Documents/projects/pgadmin4/web/regression/feature_utils/pgadmin_page.py", line 87, in find_by_xpath
return self.wait_for_element(lambda driver: driver.find_element_by_xpath(xpath))
File "/Users/murtuza/Documents/projects/pgadmin4/web/regression/feature_utils/pgadmin_page.py", line 152, in wait_for_element
return self._wait_for("element to exist", element_if_it_exists)
File "/Users/murtuza/Documents/projects/pgadmin4/web/regression/feature_utils/pgadmin_page.py", line 188, in _wait_for
"Timed out waiting for " + waiting_for_message)
File "/Users/murtuza/Documents/projects/venv_pg4/lib/python3.5/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
======================================================================
Please suggest.
Regards,
Вложения
Re: [pgadmin-hackers] [pgAdmin4] Feature tests fails on smaller screen resolution
От
Matthew Kleiman
Дата:
Hi Murtuza!
I've attached a diff that shows one way you might accomplish zooming the elements on the page during a feature test. I watched this test run and I'll admit that the view looks a little weird when zoomed in. It does not have exactly the same visual effect as if you changed the resolution of your monitor. I couldn't figure out how to make selenium change the zoom of the entire browser. However, all of the text elements' fonts are clearly 25% larger and the feature test fails when I include this code so I'm hoping this will be sufficient for you to write a test that covers us against larger scale resolution monitors.
Let us know if this helps or how we can further help.
Best,
Matt
On Tue, May 30, 2017 at 7:59 AM, Murtuza Zabuawala <murtuza.zabuawala@enterprisedb.com> wrote:
Hello Pivotal team,Need your suggestion on given issue, We have noticed that feature tests do not run when we have smaller screen resolutions.Is there any generic way to handle different screen resolutions of host system in feature tests?Steps to re-produce the issue on macOS(10.10.5)1) Go to "System preference..."2) Select "Display"3) Choose "Resolution" -> Scaled4) Select "Larger Text"5) Run the feature tests nowYou will notice that all of the feature tests fails on server creation dialog.Screen resolution where all tests fails,--
Trace:-============================================================ ========== ERROR: runTest (pgadmin.feature_tests.connect_to_server_feature_ test. ConnectsToServerFeatureTest) Test database connection------------------------------------------------------------ ---------- Traceback (most recent call last):File "/Users/murtuza/Documents/projects/pgadmin4/web/pgadmin/ feature_tests/connect_to_ server_feature_test.py", line 41, in runTest self._connects_to_server()File "/Users/murtuza/Documents/projects/pgadmin4/web/pgadmin/ feature_tests/connect_to_ server_feature_test.py", line 69, in _connects_to_server self.page.find_by_xpath("//button[contains(.,'Save')]"). click() File "/Users/murtuza/Documents/projects/pgadmin4/web/ regression/feature_utils/ pgadmin_page.py", line 87, in find_by_xpath return self.wait_for_element(lambda driver: driver.find_element_by_xpath(xpath)) File "/Users/murtuza/Documents/projects/pgadmin4/web/ regression/feature_utils/ pgadmin_page.py", line 152, in wait_for_element return self._wait_for("element to exist", element_if_it_exists)File "/Users/murtuza/Documents/projects/pgadmin4/web/ regression/feature_utils/ pgadmin_page.py", line 188, in _wait_for "Timed out waiting for " + waiting_for_message)File "/Users/murtuza/Documents/projects/venv_pg4/lib/python3. 5/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 ============================================================ ========== Please suggest.Regards,
Вложения
Re: [pgadmin-hackers] [pgAdmin4] Feature tests fails on smaller screen resolution
От
Murtuza Zabuawala
Дата:
Hi Dave,
As suggested by Matt, I tried zoom in and zoom out page but still selenium is not able to find elements from page :(
I also tried scrolling the page (Suggested by Ashesh & Harshal) but that did not work either because in tests sometime we click on Browser tree, some time Menu option, Some time Alertify dialog, Slickgrid etc, So it is very hard to decide when to scroll and how much we need to scroll to reach the target element for current screen size.
--
Regards,
On Thu, Jun 1, 2017 at 1:36 AM, Matthew Kleiman <mkleiman@pivotal.io> wrote:
Hi Murtuza!I've attached a diff that shows one way you might accomplish zooming the elements on the page during a feature test. I watched this test run and I'll admit that the view looks a little weird when zoomed in. It does not have exactly the same visual effect as if you changed the resolution of your monitor. I couldn't figure out how to make selenium change the zoom of the entire browser. However, all of the text elements' fonts are clearly 25% larger and the feature test fails when I include this code so I'm hoping this will be sufficient for you to write a test that covers us against larger scale resolution monitors.Let us know if this helps or how we can further help.Best,MattOn Tue, May 30, 2017 at 7:59 AM, Murtuza Zabuawala <murtuza.zabuawala@enterprisedb.com> wrote: Hello Pivotal team,Need your suggestion on given issue, We have noticed that feature tests do not run when we have smaller screen resolutions.Is there any generic way to handle different screen resolutions of host system in feature tests?Steps to re-produce the issue on macOS(10.10.5)1) Go to "System preference..."2) Select "Display"3) Choose "Resolution" -> Scaled4) Select "Larger Text"5) Run the feature tests nowYou will notice that all of the feature tests fails on server creation dialog.Screen resolution where all tests fails,--
Trace:-============================================================ ========== ERROR: runTest (pgadmin.feature_tests.connect_to_server_feature_test.Connec tsToServerFeatureTest) Test database connection------------------------------------------------------------ ---------- Traceback (most recent call last):File "/Users/murtuza/Documents/projects/pgadmin4/web/pgadmin/feat ure_tests/connect_to_server_ feature_test.py", line 41, in runTest self._connects_to_server()File "/Users/murtuza/Documents/projects/pgadmin4/web/pgadmin/feat ure_tests/connect_to_server_ feature_test.py", line 69, in _connects_to_server self.page.find_by_xpath("//button[contains(.,'Save')]").clic k() File "/Users/murtuza/Documents/projects/pgadmin4/web/regression/ feature_utils/pgadmin_page.py" , line 87, in find_by_xpath return self.wait_for_element(lambda driver: driver.find_element_by_xpath(xpath)) File "/Users/murtuza/Documents/projects/pgadmin4/web/regression/ feature_utils/pgadmin_page.py" , line 152, in wait_for_element return self._wait_for("element to exist", element_if_it_exists)File "/Users/murtuza/Documents/projects/pgadmin4/web/regression/ feature_utils/pgadmin_page.py" , line 188, in _wait_for "Timed out waiting for " + waiting_for_message)File "/Users/murtuza/Documents/projects/venv_pg4/lib/python3.5/ site-packages/selenium/webdriv er/support/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace)selenium.common.exceptions.TimeoutException: Message: Timed out waiting for element to exist ============================================================ ========== Please suggest.Regards,
Вложения
Hi
--
On Fri, Jun 2, 2017 at 8:01 AM, Murtuza Zabuawala <murtuza.zabuawala@enterprisedb.com> wrote:
Hi Dave,As suggested by Matt, I tried zoom in and zoom out page but still selenium is not able to find elements from page :(I also tried scrolling the page (Suggested by Ashesh & Harshal) but that did not work either because in tests sometime we click on Browser tree, some time Menu option, Some time Alertify dialog, Slickgrid etc, So it is very hard to decide when to scroll and how much we need to scroll to reach the target element for current screen size.
So what is the patch trying to do?
Can't you just scroll 50px or so at a time until the position of the element is within the viewport of it's container? That shouldn't be too hard to calculate I don't think (it seems like it's the sort of problem that likely happens a lot - maybe there's a solution on Google)?
--Regards,On Thu, Jun 1, 2017 at 1:36 AM, Matthew Kleiman <mkleiman@pivotal.io> wrote:Hi Murtuza!I've attached a diff that shows one way you might accomplish zooming the elements on the page during a feature test. I watched this test run and I'll admit that the view looks a little weird when zoomed in. It does not have exactly the same visual effect as if you changed the resolution of your monitor. I couldn't figure out how to make selenium change the zoom of the entire browser. However, all of the text elements' fonts are clearly 25% larger and the feature test fails when I include this code so I'm hoping this will be sufficient for you to write a test that covers us against larger scale resolution monitors.Let us know if this helps or how we can further help.Best,MattOn Tue, May 30, 2017 at 7:59 AM, Murtuza Zabuawala <murtuza.zabuawala@enterprisedb.com> wrote: Hello Pivotal team,Need your suggestion on given issue, We have noticed that feature tests do not run when we have smaller screen resolutions.Is there any generic way to handle different screen resolutions of host system in feature tests?Steps to re-produce the issue on macOS(10.10.5)1) Go to "System preference..."2) Select "Display"3) Choose "Resolution" -> Scaled4) Select "Larger Text"5) Run the feature tests nowYou will notice that all of the feature tests fails on server creation dialog.Screen resolution where all tests fails,--
Trace:-============================================================ ========== ERROR: runTest (pgadmin.feature_tests.connect_to_server_feature_test.Connec tsToServerFeatureTest) Test database connection------------------------------------------------------------ ---------- Traceback (most recent call last):File "/Users/murtuza/Documents/projects/pgadmin4/web/pgadmin/feat ure_tests/connect_to_server_fe ature_test.py", line 41, in runTest self._connects_to_server()File "/Users/murtuza/Documents/projects/pgadmin4/web/pgadmin/feat ure_tests/connect_to_server_fe ature_test.py", line 69, in _connects_to_server self.page.find_by_xpath("//button[contains(.,'Save')]").clic k() File "/Users/murtuza/Documents/projects/pgadmin4/web/regression/f eature_utils/pgadmin_page.py", line 87, in find_by_xpath return self.wait_for_element(lambda driver: driver.find_element_by_xpath(xpath)) File "/Users/murtuza/Documents/projects/pgadmin4/web/regression/f eature_utils/pgadmin_page.py", line 152, in wait_for_element return self._wait_for("element to exist", element_if_it_exists)File "/Users/murtuza/Documents/projects/pgadmin4/web/regression/f eature_utils/pgadmin_page.py", line 188, in _wait_for "Timed out waiting for " + waiting_for_message)File "/Users/murtuza/Documents/projects/venv_pg4/lib/python3.5/si te-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 ============================================================ ========== Please suggest.Regards,
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Вложения
Re: [pgadmin-hackers] [pgAdmin4] Feature tests fails on smaller screen resolution
От
Murtuza Zabuawala
Дата:
On Mon, Jun 5, 2017 at 2:49 PM, Dave Page <dpage@pgadmin.org> wrote:
HiOn Fri, Jun 2, 2017 at 8:01 AM, Murtuza Zabuawala <murtuza.zabuawala@enterprisedb.com> wrote: Hi Dave,As suggested by Matt, I tried zoom in and zoom out page but still selenium is not able to find elements from page :(I also tried scrolling the page (Suggested by Ashesh & Harshal) but that did not work either because in tests sometime we click on Browser tree, some time Menu option, Some time Alertify dialog, Slickgrid etc, So it is very hard to decide when to scroll and how much we need to scroll to reach the target element for current screen size.So what is the patch trying to do?
In patch I was trying to zoom in/out page.
Can't you just scroll 50px or so at a time until the position of the element is within the viewport of it's container? That shouldn't be too hard to calculate I don't think (it seems like it's the sort of problem that likely happens a lot - maybe there's a solution on Google)?
I tried scrolling complete page while doing that element timeout occurs from selenium driver, let me try the approach what you have suggested.
--Regards,On Thu, Jun 1, 2017 at 1:36 AM, Matthew Kleiman <mkleiman@pivotal.io> wrote:Hi Murtuza!I've attached a diff that shows one way you might accomplish zooming the elements on the page during a feature test. I watched this test run and I'll admit that the view looks a little weird when zoomed in. It does not have exactly the same visual effect as if you changed the resolution of your monitor. I couldn't figure out how to make selenium change the zoom of the entire browser. However, all of the text elements' fonts are clearly 25% larger and the feature test fails when I include this code so I'm hoping this will be sufficient for you to write a test that covers us against larger scale resolution monitors.Let us know if this helps or how we can further help.Best,MattOn Tue, May 30, 2017 at 7:59 AM, Murtuza Zabuawala <murtuza.zabuawala@enterprisedb.com> wrote: Hello Pivotal team,Need your suggestion on given issue, We have noticed that feature tests do not run when we have smaller screen resolutions.Is there any generic way to handle different screen resolutions of host system in feature tests?Steps to re-produce the issue on macOS(10.10.5)1) Go to "System preference..."2) Select "Display"3) Choose "Resolution" -> Scaled4) Select "Larger Text"5) Run the feature tests nowYou will notice that all of the feature tests fails on server creation dialog.Screen resolution where all tests fails,--
Trace:-============================================================ ========== ERROR: runTest (pgadmin.feature_tests.connect_to_server_feature_test.Connec tsToServerFeatureTest) Test database connection------------------------------------------------------------ ---------- Traceback (most recent call last):File "/Users/murtuza/Documents/projects/pgadmin4/web/pgadmin/feat ure_tests/connect_to_server_fe ature_test.py", line 41, in runTest self._connects_to_server()File "/Users/murtuza/Documents/projects/pgadmin4/web/pgadmin/feat ure_tests/connect_to_server_fe ature_test.py", line 69, in _connects_to_server self.page.find_by_xpath("//button[contains(.,'Save')]").clic k() File "/Users/murtuza/Documents/projects/pgadmin4/web/regression/f eature_utils/pgadmin_page.py", line 87, in find_by_xpath return self.wait_for_element(lambda driver: driver.find_element_by_xpath(xpath)) File "/Users/murtuza/Documents/projects/pgadmin4/web/regression/f eature_utils/pgadmin_page.py", line 152, in wait_for_element return self._wait_for("element to exist", element_if_it_exists)File "/Users/murtuza/Documents/projects/pgadmin4/web/regression/f eature_utils/pgadmin_page.py", line 188, in _wait_for "Timed out waiting for " + waiting_for_message)File "/Users/murtuza/Documents/projects/venv_pg4/lib/python3.5/si te-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 ============================================================ ========== Please suggest.Regards,--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company