From 3ee6cbfe0be7a99438074d3e0e5497ccaa8eba3a Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Wed, 17 Jun 2020 19:16:17 -0700 Subject: [PATCH 1/5] Fix grammar. Prep for 3.0 release. --- contributing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contributing.md b/contributing.md index 48d7324a..4f5fd549 100644 --- a/contributing.md +++ b/contributing.md @@ -164,7 +164,7 @@ If you ever have problems building packages, you can always unlink it. #### Xvfb Xvfb is a X virtual framebuffer to run graphics in memory and on a server instead of forwarding the display to a desktop display using X11 forwarding and Xwindows. -macOS web browsers do not X11 and therefore do not need Xvfb. +macOS web browsers do not use X11 and therefore do not need Xvfb. However Linux systems require it. Install Xvfb on Linux (Debian). From 01a3045cfaefec9df715ba7f127fa5aa6f53fa48 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Thu, 18 Jun 2020 01:38:19 -0700 Subject: [PATCH 2/5] Remove Xvfb mentions --- contributing.md | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/contributing.md b/contributing.md index 4f5fd549..bbbf3c6b 100644 --- a/contributing.md +++ b/contributing.md @@ -49,8 +49,6 @@ We use the following for running functional tests. If you add or change a feature that reduces test coverage or causes a functional test to fail, then you also must submit a pull request to the [deformdemo](https://github.com/pylons/deformdemo) repository to go along with your functional test change to Deform. -:warning: Functional tests behave differently depending on whether you are looking at the browser window or using Xvfb. - :information_source: Tests might not run correctly on Chrome due to various timing issues. Some effort was put forth to fix this many years ago, but it was a never ending swamp. [The situation might have improved recently](https://developers.google.com/web/updates/2017/04/headless-chrome). @@ -161,20 +159,6 @@ If you ever have problems building packages, you can always unlink it. apt-get install gettext apt-get install gettext-base -#### Xvfb - -Xvfb is a X virtual framebuffer to run graphics in memory and on a server instead of forwarding the display to a desktop display using X11 forwarding and Xwindows. -macOS web browsers do not use X11 and therefore do not need Xvfb. -However Linux systems require it. -Install Xvfb on Linux (Debian). - - apt-get install xvfb - -Set display and start Xvfb in the background. - - export DISPLAY=:99 - Xvfb :99 & - #### Selenium From 539230b283826e3bfcf4d821785744fb19436c38 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Thu, 18 Jun 2020 01:49:57 -0700 Subject: [PATCH 3/5] Clean up setting of environment variables docs --- contributing.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/contributing.md b/contributing.md index bbbf3c6b..7721787d 100644 --- a/contributing.md +++ b/contributing.md @@ -96,9 +96,13 @@ We will assume that you put your projects in your user directory, although you c cd ~/projects/deform/ -Set an environment variable to add your local checkout of Deform to your PATH. +Set an environment variable to add your local checkout of Deform to your `PATH`. +Set a second environment variable `WEBDRIVER` to the executable file itself instead of the directory where it is extracted. +It must to be set before running tox or nosetest, otherwise Firefox or chorm will not start and will return an error message of "driver not found". export PATH=~/projects/deform/:$PATH + export WEBDRIVER= + #### Firefox latest From 5c02044ddc0a7d523302f6a15a89bd7f86ca3b48 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Thu, 18 Jun 2020 02:13:58 -0700 Subject: [PATCH 4/5] Clean up testing of Chrome/Chromium, and move to the end. - Challenge accepted! --- contributing.md | 38 +++++++++++++++----------------------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/contributing.md b/contributing.md index 7721787d..47503f34 100644 --- a/contributing.md +++ b/contributing.md @@ -49,12 +49,6 @@ We use the following for running functional tests. If you add or change a feature that reduces test coverage or causes a functional test to fail, then you also must submit a pull request to the [deformdemo](https://github.com/pylons/deformdemo) repository to go along with your functional test change to Deform. -:information_source: Tests might not run correctly on Chrome due to various timing issues. -Some effort was put forth to fix this many years ago, but it was a never ending swamp. -[The situation might have improved recently](https://developers.google.com/web/updates/2017/04/headless-chrome). -We welcome pull requests to add this functionality. -To use google-chrome or Chromium, download the browser and respective webdriver, [chromiumdriver](https://chromedriver.chromium.org/downloads). - For functional tests, tox runs the shell script [run-selenium-tests.bash](https://github.com/Pylons/deform/blob/master/run-selenium-tests.bash), located at the root of the Deform repository. See its comments for a description. @@ -72,22 +66,6 @@ Run a single test. tox -e functional3 -- deformdemo.test:SequenceOfMaskedTextInputs.test_submit_one_filled -To run/edit/fix functional tests. -:note: This section has not worked for years, but could be improved for Firefox. - - source .tox/functional3/bin/activate - cd deformdemo # Checked out by tox functional3 - pserve demo.ini # Start web server - - # Run functional test suite using Chrome - WEBDRIVER="chrome" nosetests -x - - # Run functional test suite using Chrome, stop on pdb on exception - WEBDRIVER="chrome" nosetests -x --pdb - - # Run one functional test case using Chrome - WEBDRIVER="chrome" nosetests -x deformdemo.test:SequenceOfDateInputs - ### Preparing a functional testing environment @@ -104,7 +82,6 @@ It must to be set before running tox or nosetest, otherwise Firefox or chorm wil export WEBDRIVER= - #### Firefox latest ##### macOS @@ -167,3 +144,18 @@ If you ever have problems building packages, you can always unlink it. #### Selenium Selenium is installed automatically by tox via `pip install -e .["testing"]`. + + +### Testing on Chrome or Chromium + +Tests might not run correctly on Chrome due to various timing issues. +Some effort was put forth to fix this many years ago, but it was a never ending swamp. +However, [the situation might have improved recently](https://developers.google.com/web/updates/2017/04/headless-chrome). + +If you accept the challenge, we welcome pull requests to this contributing guide, along with tests to support testing on Chrome. +The following are some clues to get you started. + +- To use google-chrome or Chromium, download the web browser and respective webdriver, [chromiumdriver](https://chromedriver.chromium.org/downloads). + These would be used instead of Firefox and geckodriver. +- Set the `WEBDRIVER` environment variable to chromiumdriver instead of geckodriver. +- Profit! Fun! World domination! From 235dc70ddd912e6a56e0b57d1881c82df68a25cd Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Thu, 18 Jun 2020 12:31:17 -0700 Subject: [PATCH 5/5] Spelling and path corrections --- contributing.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contributing.md b/contributing.md index 47503f34..a12236b1 100644 --- a/contributing.md +++ b/contributing.md @@ -76,9 +76,9 @@ We will assume that you put your projects in your user directory, although you c Set an environment variable to add your local checkout of Deform to your `PATH`. Set a second environment variable `WEBDRIVER` to the executable file itself instead of the directory where it is extracted. -It must to be set before running tox or nosetest, otherwise Firefox or chorm will not start and will return an error message of "driver not found". +It must to be set before running tox or nosetest, otherwise Firefox or Chrome will not start and will return an error message of "driver not found". - export PATH=~/projects/deform/:$PATH + export PATH=~/projects/deform/firefox:$PATH export WEBDRIVER=