Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interacting with driver clears open modal #1171

Closed
elliterate opened this issue Feb 10, 2018 · 8 comments
Closed

Interacting with driver clears open modal #1171

elliterate opened this issue Feb 10, 2018 · 8 comments

Comments

@elliterate
Copy link

This is true whether you're trying to navigate away or simply query for elements.

System

  • Version: 0.19.1
  • Platform: macOS 10.11.6
  • Firefox: 59.0b8; 60.0a1 (passes with 58.0.2)
  • Selenium: py/3.9.0

Testcase

test_handle_alert.py

import inspect
import os.path
from time import sleep
from unittest import TestCase, main

from selenium import webdriver
from selenium.common.exceptions import UnexpectedAlertPresentException
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities


_DIR = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))

def _get_fixture_url(filename):
    return "file://{}".format(os.path.join(_DIR, filename))


class TestHandleAlert(TestCase):
    @classmethod
    def setUpClass(cls):
        capabilities = DesiredCapabilities.FIREFOX.copy()
        capabilities["marionette"] = True
        capabilities["unexpectedAlertBehaviour"] = "ignore"
        capabilities["moz:firefoxOptions"] = {"log": {"level": "trace"}}
        cls.driver = webdriver.Firefox(capabilities=capabilities)

    @classmethod
    def tearDownClass(cls):
        cls.driver.quit()
        
    def test_querying_while_an_alert_exists(self):
        self.driver.get(_get_fixture_url("with_alert.html"))
        self.assertIn("This page has an inline alert.",
            self.driver.find_element_by_tag_name("p").text)

        self.driver.find_element_by_link_text("Hello?").click()

        with self.assertRaises(UnexpectedAlertPresentException):
            self.driver.get(_get_fixture_url("other.html"))

        self.driver.switch_to.alert.accept()
        self.driver.get(_get_fixture_url("other.html"))

        sleep(0.25)
        self.assertIn("This is some other page.",
            self.driver.find_element_by_tag_name("p").text)


if __name__ == "__main__":
    main()

with_alert.html

<html>
  <body>
    <p>This page has an inline alert.</p>
    
    <a href="#" onclick="alert('Boo!')">Hello?</a>
  </body>
</html>

other.html

<html>
  <body>
    <p>This is some other page.</p>
  </body>
</html>

Stacktrace

$ python test_handle_alert.py
E
======================================================================
ERROR: test_querying_while_an_alert_exists (__main__.TestHandleAlert)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_handle_alert.py", line 40, in test_querying_while_an_alert_exists
    self.driver.switch_to.alert.accept()
  File "/Users/ian/.pyenv/versions/2.7.9/lib/python2.7/site-packages/selenium/webdriver/remote/switch_to.py", line 55, in alert
    alert.text
  File "/Users/ian/.pyenv/versions/2.7.9/lib/python2.7/site-packages/selenium/webdriver/common/alert.py", line 67, in text
    return self.driver.execute(Command.W3C_GET_ALERT_TEXT)["value"]
  File "/Users/ian/.pyenv/versions/2.7.9/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 312, in execute
    self.error_handler.check_response(response)
  File "/Users/ian/.pyenv/versions/2.7.9/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
NoAlertPresentException: Message: No modal dialog is currently open


----------------------------------------------------------------------
Ran 1 test in 5.134s

FAILED (errors=1)

Trace-level log

geckodriver.log.txt

@elliterate elliterate changed the title Interacting with driver dismisses open modal Interacting with driver clears open modal Feb 10, 2018
@elliterate
Copy link
Author

For context, this is especially troublesome when you can't know whether the page uses an unload alert, as when capybara-py attempts to reset the browser between tests. capybara-py attempts to:

  1. navigate to "about:blank" and then
  2. verify that it arrived by polling the body until it sees that it's empty.

If the navigation triggers an unload alert, the verification check will fail because of the unexpected modal. But, with the behavior reported above, the verification check will also inadvertently clear the modal and cancel the navigation.

@cgoldberg
Copy link

@elliterate
Copy link
Author

For further context, this worked at the beginning of January and no longer worked at the end of January (both times on v0.18.0). That, along with the fact that this works on Firefox 58.0.2, leads me to suspect this is a recent regression in Firefox.

@whimboo
Copy link
Collaborator

whimboo commented Feb 12, 2018

Yes, that was an expected change as landed by @AutomatedTester for Firefox 59 via https://bugzilla.mozilla.org/show_bug.cgi?id=1416284.

@AutomatedTester
Copy link
Contributor

This is expected and aligns Geckodriver with the other drivers

@whimboo
Copy link
Collaborator

whimboo commented Feb 12, 2018

Reopening because we are not complete on that.

@whimboo whimboo reopened this Feb 12, 2018
@AutomatedTester
Copy link
Contributor

since this issue is talking about https://bugzilla.mozilla.org/show_bug.cgi?id=1416284 and not https://bugzilla.mozilla.org/show_bug.cgi?id=1264259 let's not conflate issues by reopening it.

redshiftzero added a commit to zenmonkeykstop/securedrop that referenced this issue Sep 28, 2018
We were getting a NoAlertPresentException due to new behavior in
geckodriver [0] where interacting with the driver closes the modal.
Thus, we do not need to explicitly accept the modal here.

[0] mozilla/geckodriver#1171
msheiny pushed a commit to freedomofpress/securedrop that referenced this issue Oct 5, 2018
We were getting a NoAlertPresentException due to new behavior in
geckodriver [0] where interacting with the driver closes the modal.
Thus, we do not need to explicitly accept the modal here.

[0] mozilla/geckodriver#1171
redshiftzero added a commit to freedomofpress/securedrop that referenced this issue Oct 12, 2018
We were getting a NoAlertPresentException due to new behavior in
geckodriver [0] where interacting with the driver closes the modal.
Thus, we do not need to explicitly accept the modal here.

[0] mozilla/geckodriver#1171
redshiftzero added a commit to freedomofpress/securedrop that referenced this issue Nov 30, 2018
We were getting a NoAlertPresentException due to new behavior in
geckodriver [0] where interacting with the driver closes the modal.
Thus, we do not need to explicitly accept the modal here.

[0] mozilla/geckodriver#1171
redshiftzero added a commit to freedomofpress/securedrop that referenced this issue Dec 21, 2018
We were getting a NoAlertPresentException due to new behavior in
geckodriver [0] where interacting with the driver closes the modal.
Thus, we do not need to explicitly accept the modal here.

[0] mozilla/geckodriver#1171
redshiftzero added a commit to freedomofpress/securedrop that referenced this issue Dec 21, 2018
We were getting a NoAlertPresentException due to new behavior in
geckodriver [0] where interacting with the driver closes the modal.
Thus, we do not need to explicitly accept the modal here.

[0] mozilla/geckodriver#1171
rmol pushed a commit to rmol/securedrop that referenced this issue Apr 12, 2019
stupid utility to create an test admin user fast

Working tbselineum tests for most part.

fixes two typos in readme of tor based tests

Fixes directory path in README

Hardcoded onion addresse work

Test for tor broser asking high security in slider

Reads instance information from a json file

Uses clean variable name

Configure the sleep amount between clicks

Just tests admin/journalist login and cookies

Tests working once again.

Use firefox to login for downloads in selenium tests

Updates README

Matches with 0.6-rc2 functional tests

We are using TBB 7.5

We need more time and click to test logout

Fixes the assert statement

Updates based on current upstream

TB functional tests: Gitignore instance config

This prevents the accidental commit of private information.

TB functional tests: Merge tbselenium dir

Updates the ansible files for tbb

Updates to the Dockerfile for tbb

Updates as suggested in the PR review for ansible and dockerfile

Missing tor key

Removes duplicated 'when' line from app-test logic

The 'when' conditional detecting a grsec kernel, used for running the
paxctl commands on the TBB binary, was needlessly duplicated on the
relevant task. Fortunately that didn't cause breakage, because the
'when' lines were identical, but only one was active.

Updates functional test container image

Now installs Firefox 52 ESR, rather than Firefox 46, for use inside the
test container.

Includes changes to run-test shell script:

    TOR_FORCE_NET_CONFIG=0 is required to directly connect to Tor
    network, otherwise it will wait for userinput to either connect
    or to configure

    The `run_xvfb` invocation is no longer necessary, since the test suite
    code bootstraps the headless server now.

Creates local test server inside the container

Bootstrapping the application services within the functional test suite.
Includes some cleanup, culling unused debugging code, and also cleans up
the various print statements.

Ignore functional test firefox logs (thanks, @msheiny!)

Adds retries for tor network connection failure, using the pre-existing
logic.

Uses nc rather than torsocks in functional tests

The version of torsocks in the Trusty repos isn't recent enough to
support custom ports. Rather than install from other sources, which
requires manual package verification (or configuring non-trusty repos,
which could break other packages), let's fall back to good ol' nc.

Creates proper orbot specific project to test

We need to create a new firefox profile to test the orbot specific
warning. This works for both locally and over Tor.

Updates test_make_account_changes for Tor

Now we can safely execute the account changes in the tests running
on the Tor browser. The logic update makes sure to create different
user for this test than any other test.

Reduces sleep durations in functional tests

We don't have to sleep for too long if we are running against
local instance. The ultimate goal remains to remove hardcoded sleeps
altogether, but we'll circle back and eliminate those calls once the
test suite is passing reliably.

Increases CircleCI timeout to 20m

The functional tests can take a long time, so let's instruct CircleCI to
continue waiting, to give the test suite a chance to finish
successfully.

Updates README for the functional tests

Mostly correcting a typo in the `instance_information.json` config
filename, but also updated some of the example commands. The notes
regarding potentially failing tests also seemed out of date, as several
members of the team have confirmed working functional tests under the
new TB Selenium logic recently.

Removes temporary testing related directories

We need to clean up any temporary test directory before running
any test, as the previous can create a bad state in the database.
For example, one of our pages-layout test adds 123456 as hotp value
to the test account, and it will never be able to login again.

Adds missing steps for pages-layout tests over tor

We can now generate thousands of random journalist names using
the generator. Only the first 3 names are used in the functional
tests, the rest are being used in the pages-layout.

We also added back _source_delete_key function for one the test.
Rest of the updates are to add sleep function calls or to have
better error message.

Adds comment about the user generator and lint fixes

We have get_journalist_usernames generator which can generate
unlimited number of users for many tests.

Moves around all driver creation functions into one place

We now have the functional/functional_test.py to handle all
driver creation logic. For the pages-layout tests, we are creating
only a Firefox driver to connect to the local container itself.

This logic does not work against any external server as of now.

Updates test user creation logic inside of container

Removing old method calls from user creation logic, this is only
used inside of the container for the functional testing.

Downloads data from server using requests over Tor

The test requirements now have requests[socks] as dependency.
Using the same we are now directly downloading the files/messages
from the .onion address for functional tests.

The old external command file also got removed this committ.

We are creating the gpg object for both container based local
testing and external testing (in functional tests).
Fixes: freedomofpress#3691 freedomofpress#3687

Removed xvfb, tor browser, and firefox installs from app-staging - functional tests now run remotely

fix to pass make ci-lint

Cleans up flake8 errors in functional tests

Resolves some lingering flake8 formatting violations that were causing
lint checks to fail. These changes are unrelated to the current PR, but
better late than never.

Written by @msheiny, committed by @conorsch during branch collab.

Signed-off-by: Conor Schaefer <conor@freedom.press>

Adds --staging flag create-dev-data.py for tests

We now have --staging flag to the create-dev-data.py script so
that we can easily create an user in the staging or prodcution test
and then use the functional tests to test the instance.

Add fact gatherer for extracting tor app onion details

This is really for functional testing in staging environments, but the
script doesnt hurt to be installed in prod. It doesn't elevate
permissions or expose any sensitive details - you need to run as root in
order to gain useful data.

Logic to dump app tor onion data to func config

This commit adds logic to the test runner so that a functional test json
config gets dumped for usage in the tbb selenium test tools against
staging.

Wire-up current app-test role to our upgrade scenario

Without this change, the upgrade scenario would utilize the app-test
logic from the old repo. Which is not what we want. This is of course
kind of "hacky". I welcome the opportunity to improve this with feedback
:)

Move tor fact logic from tor role --> app-test role

I'm not sure we are ready to shove this on prod instances AND I was
running into weird old/new role logic under the molecule scenario.
Ideally the fact should be in both roles but I dunno.. this seemed like
an easier short-term fix.

ansible spacing' and tag nits

Testinfra: Update test dependencies for app-staging

In freedomofpress#3697, we removed the application testing pip dependencies.
This commit updates the testinfra test variables accordingly.

Fix linting failures

One of these was introduced in freedomofpress#3672, but not discovered due to
other CI failures (e.g. python not found when running the lint job)

Use absolute pathing in i18n testing

I'm hoping this shakes out some really weird test failures we were
seeing only under CircleCI only under the functional testing branch at a
certain point in time. Really wild behavior. *fingers crossed*

Set selenium webdriver test output to WARNING

Originally was on DEBUG and was sending out mountains of output into the
pytest process which made it difficult to assess anything.

(cherry picked from commit a1f0134)

removed duplicate entry in test requirements

Dockerfile: Update Tor Browser to 8.0

Docker development environment: Update Tor signing key

Dockerfile: Update geckodriver and firefox-esr

Swap x11vnc with tightvncserver

Basically installed this because it can be used with pyvirtualdisplay as
a backend AND because it brings in the Xvnc tooling which will start an
X11 server as well as a VNC server.

Wire-up VNC server and helper command for func tests

Had to remove x11 display logic inside test scaffolding (initially tried
to integrate it there but it kept building and destroying the VNC server
per test).

Made a VNC helper command with support for GNOME desktop and macOS (havent
tested it on mac yet). Updated the docs

Bump functional test sleep time

10 seconds is way too short.. 160 seconds.. maybe too long? Fingers
crossed I can work with the team to get the wait_for logic running

Add functionality to prepare boxes for functional testing

Typically these actions were done manually but lets get our good old
friend ansible to run them for us (at least under the upgrade env).

Added auth to VNC in test container, for OS X compatibility.

Bump TBB/ESR to 8.0.1 and 60.2.0esr combo

https://blog.torproject.org/new-release-tor-browser-801

Updated geckodriver to 0.22.0

added ini file to get around remote-viewer password prompt

Functional tests: xfail test_warning_appears_if_tor_browser_not_in_use

Due to defect freedomofpress#3793, when using Firefox Quantum, the incorrect message
is displayed on the source interface. This test will not pass until that
is resolved.

Functional tests: Fix firefox path

Testinfra: Fix test failure due to non-DRY variables files

staging.yml is a concatenation of multiple other variables files,
one was updated during rebase, one was not.

Testinfra: Update Flask version to 1.0.2

fixed VNC port being defined twice when running 'make dev'

Tests: Modify viewport size for parity between dev and CI env

In CI we are getting MoveTargetOutOfBoundsException, but not locally.
We have had errors in the past due to different viewport sizes in CI
and locally, so setting this to a standard size for the pages layout
tests (where the exception is occurring).

Functional tests: Resolve NoAlertPresentException

We were getting a NoAlertPresentException due to new behavior in
geckodriver [0] where interacting with the driver closes the modal.
Thus, we do not need to explicitly accept the modal here.

[0] mozilla/geckodriver#1171

Replaced parameterized time.sleep()s with self.waitfor()s

Stability fixes layout tests, added new functests from develop, updated TBB

fixed flaky page layout tests that were broken by long fr_FR strings causing UI elements to wrap.

fixed flake8, added explicit scroll to elements before click, stability fixes

Dockerfile: get key from Mozilla keyserver

For whatever reason, this Firefox signing key was not available on
the keyserver in the prior diff, but was available on Mozilla's
keyserver.

deps: Update requests due to CVE-2018-18074

functional tests: Add wait_for prior to clicking submit

functional tests: Remove sleeps and reduce flakiness around modal

functional tests: Remove sleeps around js alerts

functional tests: use sleep_time as default timeout

functional tests: Remove remainder of time.sleeps in source steps

Don't clobber existing custom logo

Minimal changes to remove external server testing functionality

Merge from develop
rmol pushed a commit to rmol/securedrop that referenced this issue Apr 15, 2019
stupid utility to create an test admin user fast

Working tbselineum tests for most part.

fixes two typos in readme of tor based tests

Fixes directory path in README

Hardcoded onion addresse work

Test for tor broser asking high security in slider

Reads instance information from a json file

Uses clean variable name

Configure the sleep amount between clicks

Just tests admin/journalist login and cookies

Tests working once again.

Use firefox to login for downloads in selenium tests

Updates README

Matches with 0.6-rc2 functional tests

We are using TBB 7.5

We need more time and click to test logout

Fixes the assert statement

Updates based on current upstream

TB functional tests: Gitignore instance config

This prevents the accidental commit of private information.

TB functional tests: Merge tbselenium dir

Updates the ansible files for tbb

Updates to the Dockerfile for tbb

Updates as suggested in the PR review for ansible and dockerfile

Missing tor key

Removes duplicated 'when' line from app-test logic

The 'when' conditional detecting a grsec kernel, used for running the
paxctl commands on the TBB binary, was needlessly duplicated on the
relevant task. Fortunately that didn't cause breakage, because the
'when' lines were identical, but only one was active.

Updates functional test container image

Now installs Firefox 52 ESR, rather than Firefox 46, for use inside the
test container.

Includes changes to run-test shell script:

    TOR_FORCE_NET_CONFIG=0 is required to directly connect to Tor
    network, otherwise it will wait for userinput to either connect
    or to configure

    The `run_xvfb` invocation is no longer necessary, since the test suite
    code bootstraps the headless server now.

Creates local test server inside the container

Bootstrapping the application services within the functional test suite.
Includes some cleanup, culling unused debugging code, and also cleans up
the various print statements.

Ignore functional test firefox logs (thanks, @msheiny!)

Adds retries for tor network connection failure, using the pre-existing
logic.

Uses nc rather than torsocks in functional tests

The version of torsocks in the Trusty repos isn't recent enough to
support custom ports. Rather than install from other sources, which
requires manual package verification (or configuring non-trusty repos,
which could break other packages), let's fall back to good ol' nc.

Creates proper orbot specific project to test

We need to create a new firefox profile to test the orbot specific
warning. This works for both locally and over Tor.

Updates test_make_account_changes for Tor

Now we can safely execute the account changes in the tests running
on the Tor browser. The logic update makes sure to create different
user for this test than any other test.

Reduces sleep durations in functional tests

We don't have to sleep for too long if we are running against
local instance. The ultimate goal remains to remove hardcoded sleeps
altogether, but we'll circle back and eliminate those calls once the
test suite is passing reliably.

Increases CircleCI timeout to 20m

The functional tests can take a long time, so let's instruct CircleCI to
continue waiting, to give the test suite a chance to finish
successfully.

Updates README for the functional tests

Mostly correcting a typo in the `instance_information.json` config
filename, but also updated some of the example commands. The notes
regarding potentially failing tests also seemed out of date, as several
members of the team have confirmed working functional tests under the
new TB Selenium logic recently.

Removes temporary testing related directories

We need to clean up any temporary test directory before running
any test, as the previous can create a bad state in the database.
For example, one of our pages-layout test adds 123456 as hotp value
to the test account, and it will never be able to login again.

Adds missing steps for pages-layout tests over tor

We can now generate thousands of random journalist names using
the generator. Only the first 3 names are used in the functional
tests, the rest are being used in the pages-layout.

We also added back _source_delete_key function for one the test.
Rest of the updates are to add sleep function calls or to have
better error message.

Adds comment about the user generator and lint fixes

We have get_journalist_usernames generator which can generate
unlimited number of users for many tests.

Moves around all driver creation functions into one place

We now have the functional/functional_test.py to handle all
driver creation logic. For the pages-layout tests, we are creating
only a Firefox driver to connect to the local container itself.

This logic does not work against any external server as of now.

Updates test user creation logic inside of container

Removing old method calls from user creation logic, this is only
used inside of the container for the functional testing.

Downloads data from server using requests over Tor

The test requirements now have requests[socks] as dependency.
Using the same we are now directly downloading the files/messages
from the .onion address for functional tests.

The old external command file also got removed this committ.

We are creating the gpg object for both container based local
testing and external testing (in functional tests).
Fixes: freedomofpress#3691 freedomofpress#3687

Removed xvfb, tor browser, and firefox installs from app-staging - functional tests now run remotely

fix to pass make ci-lint

Cleans up flake8 errors in functional tests

Resolves some lingering flake8 formatting violations that were causing
lint checks to fail. These changes are unrelated to the current PR, but
better late than never.

Written by @msheiny, committed by @conorsch during branch collab.

Signed-off-by: Conor Schaefer <conor@freedom.press>

Adds --staging flag create-dev-data.py for tests

We now have --staging flag to the create-dev-data.py script so
that we can easily create an user in the staging or prodcution test
and then use the functional tests to test the instance.

Add fact gatherer for extracting tor app onion details

This is really for functional testing in staging environments, but the
script doesnt hurt to be installed in prod. It doesn't elevate
permissions or expose any sensitive details - you need to run as root in
order to gain useful data.

Logic to dump app tor onion data to func config

This commit adds logic to the test runner so that a functional test json
config gets dumped for usage in the tbb selenium test tools against
staging.

Wire-up current app-test role to our upgrade scenario

Without this change, the upgrade scenario would utilize the app-test
logic from the old repo. Which is not what we want. This is of course
kind of "hacky". I welcome the opportunity to improve this with feedback
:)

Move tor fact logic from tor role --> app-test role

I'm not sure we are ready to shove this on prod instances AND I was
running into weird old/new role logic under the molecule scenario.
Ideally the fact should be in both roles but I dunno.. this seemed like
an easier short-term fix.

ansible spacing' and tag nits

Testinfra: Update test dependencies for app-staging

In freedomofpress#3697, we removed the application testing pip dependencies.
This commit updates the testinfra test variables accordingly.

Fix linting failures

One of these was introduced in freedomofpress#3672, but not discovered due to
other CI failures (e.g. python not found when running the lint job)

Use absolute pathing in i18n testing

I'm hoping this shakes out some really weird test failures we were
seeing only under CircleCI only under the functional testing branch at a
certain point in time. Really wild behavior. *fingers crossed*

Set selenium webdriver test output to WARNING

Originally was on DEBUG and was sending out mountains of output into the
pytest process which made it difficult to assess anything.

(cherry picked from commit a1f0134)

removed duplicate entry in test requirements

Dockerfile: Update Tor Browser to 8.0

Docker development environment: Update Tor signing key

Dockerfile: Update geckodriver and firefox-esr

Swap x11vnc with tightvncserver

Basically installed this because it can be used with pyvirtualdisplay as
a backend AND because it brings in the Xvnc tooling which will start an
X11 server as well as a VNC server.

Wire-up VNC server and helper command for func tests

Had to remove x11 display logic inside test scaffolding (initially tried
to integrate it there but it kept building and destroying the VNC server
per test).

Made a VNC helper command with support for GNOME desktop and macOS (havent
tested it on mac yet). Updated the docs

Bump functional test sleep time

10 seconds is way too short.. 160 seconds.. maybe too long? Fingers
crossed I can work with the team to get the wait_for logic running

Add functionality to prepare boxes for functional testing

Typically these actions were done manually but lets get our good old
friend ansible to run them for us (at least under the upgrade env).

Added auth to VNC in test container, for OS X compatibility.

Bump TBB/ESR to 8.0.1 and 60.2.0esr combo

https://blog.torproject.org/new-release-tor-browser-801

Updated geckodriver to 0.22.0

added ini file to get around remote-viewer password prompt

Functional tests: xfail test_warning_appears_if_tor_browser_not_in_use

Due to defect freedomofpress#3793, when using Firefox Quantum, the incorrect message
is displayed on the source interface. This test will not pass until that
is resolved.

Functional tests: Fix firefox path

Testinfra: Fix test failure due to non-DRY variables files

staging.yml is a concatenation of multiple other variables files,
one was updated during rebase, one was not.

Testinfra: Update Flask version to 1.0.2

fixed VNC port being defined twice when running 'make dev'

Tests: Modify viewport size for parity between dev and CI env

In CI we are getting MoveTargetOutOfBoundsException, but not locally.
We have had errors in the past due to different viewport sizes in CI
and locally, so setting this to a standard size for the pages layout
tests (where the exception is occurring).

Functional tests: Resolve NoAlertPresentException

We were getting a NoAlertPresentException due to new behavior in
geckodriver [0] where interacting with the driver closes the modal.
Thus, we do not need to explicitly accept the modal here.

[0] mozilla/geckodriver#1171

Replaced parameterized time.sleep()s with self.waitfor()s

Stability fixes layout tests, added new functests from develop, updated TBB

fixed flaky page layout tests that were broken by long fr_FR strings causing UI elements to wrap.

fixed flake8, added explicit scroll to elements before click, stability fixes

Dockerfile: get key from Mozilla keyserver

For whatever reason, this Firefox signing key was not available on
the keyserver in the prior diff, but was available on Mozilla's
keyserver.

deps: Update requests due to CVE-2018-18074

functional tests: Add wait_for prior to clicking submit

functional tests: Remove sleeps and reduce flakiness around modal

functional tests: Remove sleeps around js alerts

functional tests: use sleep_time as default timeout

functional tests: Remove remainder of time.sleeps in source steps

Don't clobber existing custom logo

Minimal changes to remove external server testing functionality

Merge from develop
rmol pushed a commit to rmol/securedrop that referenced this issue Apr 17, 2019
stupid utility to create an test admin user fast

Working tbselineum tests for most part.

fixes two typos in readme of tor based tests

Fixes directory path in README

Hardcoded onion addresse work

Test for tor broser asking high security in slider

Reads instance information from a json file

Uses clean variable name

Configure the sleep amount between clicks

Just tests admin/journalist login and cookies

Tests working once again.

Use firefox to login for downloads in selenium tests

Updates README

Matches with 0.6-rc2 functional tests

We are using TBB 7.5

We need more time and click to test logout

Fixes the assert statement

Updates based on current upstream

TB functional tests: Gitignore instance config

This prevents the accidental commit of private information.

TB functional tests: Merge tbselenium dir

Updates the ansible files for tbb

Updates to the Dockerfile for tbb

Updates as suggested in the PR review for ansible and dockerfile

Missing tor key

Removes duplicated 'when' line from app-test logic

The 'when' conditional detecting a grsec kernel, used for running the
paxctl commands on the TBB binary, was needlessly duplicated on the
relevant task. Fortunately that didn't cause breakage, because the
'when' lines were identical, but only one was active.

Updates functional test container image

Now installs Firefox 52 ESR, rather than Firefox 46, for use inside the
test container.

Includes changes to run-test shell script:

    TOR_FORCE_NET_CONFIG=0 is required to directly connect to Tor
    network, otherwise it will wait for userinput to either connect
    or to configure

    The `run_xvfb` invocation is no longer necessary, since the test suite
    code bootstraps the headless server now.

Creates local test server inside the container

Bootstrapping the application services within the functional test suite.
Includes some cleanup, culling unused debugging code, and also cleans up
the various print statements.

Ignore functional test firefox logs (thanks, @msheiny!)

Adds retries for tor network connection failure, using the pre-existing
logic.

Uses nc rather than torsocks in functional tests

The version of torsocks in the Trusty repos isn't recent enough to
support custom ports. Rather than install from other sources, which
requires manual package verification (or configuring non-trusty repos,
which could break other packages), let's fall back to good ol' nc.

Creates proper orbot specific project to test

We need to create a new firefox profile to test the orbot specific
warning. This works for both locally and over Tor.

Updates test_make_account_changes for Tor

Now we can safely execute the account changes in the tests running
on the Tor browser. The logic update makes sure to create different
user for this test than any other test.

Reduces sleep durations in functional tests

We don't have to sleep for too long if we are running against
local instance. The ultimate goal remains to remove hardcoded sleeps
altogether, but we'll circle back and eliminate those calls once the
test suite is passing reliably.

Increases CircleCI timeout to 20m

The functional tests can take a long time, so let's instruct CircleCI to
continue waiting, to give the test suite a chance to finish
successfully.

Updates README for the functional tests

Mostly correcting a typo in the `instance_information.json` config
filename, but also updated some of the example commands. The notes
regarding potentially failing tests also seemed out of date, as several
members of the team have confirmed working functional tests under the
new TB Selenium logic recently.

Removes temporary testing related directories

We need to clean up any temporary test directory before running
any test, as the previous can create a bad state in the database.
For example, one of our pages-layout test adds 123456 as hotp value
to the test account, and it will never be able to login again.

Adds missing steps for pages-layout tests over tor

We can now generate thousands of random journalist names using
the generator. Only the first 3 names are used in the functional
tests, the rest are being used in the pages-layout.

We also added back _source_delete_key function for one the test.
Rest of the updates are to add sleep function calls or to have
better error message.

Adds comment about the user generator and lint fixes

We have get_journalist_usernames generator which can generate
unlimited number of users for many tests.

Moves around all driver creation functions into one place

We now have the functional/functional_test.py to handle all
driver creation logic. For the pages-layout tests, we are creating
only a Firefox driver to connect to the local container itself.

This logic does not work against any external server as of now.

Updates test user creation logic inside of container

Removing old method calls from user creation logic, this is only
used inside of the container for the functional testing.

Downloads data from server using requests over Tor

The test requirements now have requests[socks] as dependency.
Using the same we are now directly downloading the files/messages
from the .onion address for functional tests.

The old external command file also got removed this committ.

We are creating the gpg object for both container based local
testing and external testing (in functional tests).
Fixes: freedomofpress#3691 freedomofpress#3687

Removed xvfb, tor browser, and firefox installs from app-staging - functional tests now run remotely

fix to pass make ci-lint

Cleans up flake8 errors in functional tests

Resolves some lingering flake8 formatting violations that were causing
lint checks to fail. These changes are unrelated to the current PR, but
better late than never.

Written by @msheiny, committed by @conorsch during branch collab.

Signed-off-by: Conor Schaefer <conor@freedom.press>

Adds --staging flag create-dev-data.py for tests

We now have --staging flag to the create-dev-data.py script so
that we can easily create an user in the staging or prodcution test
and then use the functional tests to test the instance.

Add fact gatherer for extracting tor app onion details

This is really for functional testing in staging environments, but the
script doesnt hurt to be installed in prod. It doesn't elevate
permissions or expose any sensitive details - you need to run as root in
order to gain useful data.

Logic to dump app tor onion data to func config

This commit adds logic to the test runner so that a functional test json
config gets dumped for usage in the tbb selenium test tools against
staging.

Wire-up current app-test role to our upgrade scenario

Without this change, the upgrade scenario would utilize the app-test
logic from the old repo. Which is not what we want. This is of course
kind of "hacky". I welcome the opportunity to improve this with feedback
:)

Move tor fact logic from tor role --> app-test role

I'm not sure we are ready to shove this on prod instances AND I was
running into weird old/new role logic under the molecule scenario.
Ideally the fact should be in both roles but I dunno.. this seemed like
an easier short-term fix.

ansible spacing' and tag nits

Testinfra: Update test dependencies for app-staging

In freedomofpress#3697, we removed the application testing pip dependencies.
This commit updates the testinfra test variables accordingly.

Fix linting failures

One of these was introduced in freedomofpress#3672, but not discovered due to
other CI failures (e.g. python not found when running the lint job)

Use absolute pathing in i18n testing

I'm hoping this shakes out some really weird test failures we were
seeing only under CircleCI only under the functional testing branch at a
certain point in time. Really wild behavior. *fingers crossed*

Set selenium webdriver test output to WARNING

Originally was on DEBUG and was sending out mountains of output into the
pytest process which made it difficult to assess anything.

(cherry picked from commit a1f0134)

removed duplicate entry in test requirements

Dockerfile: Update Tor Browser to 8.0

Docker development environment: Update Tor signing key

Dockerfile: Update geckodriver and firefox-esr

Swap x11vnc with tightvncserver

Basically installed this because it can be used with pyvirtualdisplay as
a backend AND because it brings in the Xvnc tooling which will start an
X11 server as well as a VNC server.

Wire-up VNC server and helper command for func tests

Had to remove x11 display logic inside test scaffolding (initially tried
to integrate it there but it kept building and destroying the VNC server
per test).

Made a VNC helper command with support for GNOME desktop and macOS (havent
tested it on mac yet). Updated the docs

Bump functional test sleep time

10 seconds is way too short.. 160 seconds.. maybe too long? Fingers
crossed I can work with the team to get the wait_for logic running

Add functionality to prepare boxes for functional testing

Typically these actions were done manually but lets get our good old
friend ansible to run them for us (at least under the upgrade env).

Added auth to VNC in test container, for OS X compatibility.

Bump TBB/ESR to 8.0.1 and 60.2.0esr combo

https://blog.torproject.org/new-release-tor-browser-801

Updated geckodriver to 0.22.0

added ini file to get around remote-viewer password prompt

Functional tests: xfail test_warning_appears_if_tor_browser_not_in_use

Due to defect freedomofpress#3793, when using Firefox Quantum, the incorrect message
is displayed on the source interface. This test will not pass until that
is resolved.

Functional tests: Fix firefox path

Testinfra: Fix test failure due to non-DRY variables files

staging.yml is a concatenation of multiple other variables files,
one was updated during rebase, one was not.

Testinfra: Update Flask version to 1.0.2

fixed VNC port being defined twice when running 'make dev'

Tests: Modify viewport size for parity between dev and CI env

In CI we are getting MoveTargetOutOfBoundsException, but not locally.
We have had errors in the past due to different viewport sizes in CI
and locally, so setting this to a standard size for the pages layout
tests (where the exception is occurring).

Functional tests: Resolve NoAlertPresentException

We were getting a NoAlertPresentException due to new behavior in
geckodriver [0] where interacting with the driver closes the modal.
Thus, we do not need to explicitly accept the modal here.

[0] mozilla/geckodriver#1171

Replaced parameterized time.sleep()s with self.waitfor()s

Stability fixes layout tests, added new functests from develop, updated TBB

fixed flaky page layout tests that were broken by long fr_FR strings causing UI elements to wrap.

fixed flake8, added explicit scroll to elements before click, stability fixes

Dockerfile: get key from Mozilla keyserver

For whatever reason, this Firefox signing key was not available on
the keyserver in the prior diff, but was available on Mozilla's
keyserver.

deps: Update requests due to CVE-2018-18074

functional tests: Add wait_for prior to clicking submit

functional tests: Remove sleeps and reduce flakiness around modal

functional tests: Remove sleeps around js alerts

functional tests: use sleep_time as default timeout

functional tests: Remove remainder of time.sleeps in source steps

Don't clobber existing custom logo

Minimal changes to remove external server testing functionality

Merge from develop
rmol pushed a commit to rmol/securedrop that referenced this issue Apr 17, 2019
stupid utility to create an test admin user fast

Working tbselineum tests for most part.

fixes two typos in readme of tor based tests

Fixes directory path in README

Hardcoded onion addresse work

Test for tor broser asking high security in slider

Reads instance information from a json file

Uses clean variable name

Configure the sleep amount between clicks

Just tests admin/journalist login and cookies

Tests working once again.

Use firefox to login for downloads in selenium tests

Updates README

Matches with 0.6-rc2 functional tests

We are using TBB 7.5

We need more time and click to test logout

Fixes the assert statement

Updates based on current upstream

TB functional tests: Gitignore instance config

This prevents the accidental commit of private information.

TB functional tests: Merge tbselenium dir

Updates the ansible files for tbb

Updates to the Dockerfile for tbb

Updates as suggested in the PR review for ansible and dockerfile

Missing tor key

Removes duplicated 'when' line from app-test logic

The 'when' conditional detecting a grsec kernel, used for running the
paxctl commands on the TBB binary, was needlessly duplicated on the
relevant task. Fortunately that didn't cause breakage, because the
'when' lines were identical, but only one was active.

Updates functional test container image

Now installs Firefox 52 ESR, rather than Firefox 46, for use inside the
test container.

Includes changes to run-test shell script:

    TOR_FORCE_NET_CONFIG=0 is required to directly connect to Tor
    network, otherwise it will wait for userinput to either connect
    or to configure

    The `run_xvfb` invocation is no longer necessary, since the test suite
    code bootstraps the headless server now.

Creates local test server inside the container

Bootstrapping the application services within the functional test suite.
Includes some cleanup, culling unused debugging code, and also cleans up
the various print statements.

Ignore functional test firefox logs (thanks, @msheiny!)

Adds retries for tor network connection failure, using the pre-existing
logic.

Uses nc rather than torsocks in functional tests

The version of torsocks in the Trusty repos isn't recent enough to
support custom ports. Rather than install from other sources, which
requires manual package verification (or configuring non-trusty repos,
which could break other packages), let's fall back to good ol' nc.

Creates proper orbot specific project to test

We need to create a new firefox profile to test the orbot specific
warning. This works for both locally and over Tor.

Updates test_make_account_changes for Tor

Now we can safely execute the account changes in the tests running
on the Tor browser. The logic update makes sure to create different
user for this test than any other test.

Reduces sleep durations in functional tests

We don't have to sleep for too long if we are running against
local instance. The ultimate goal remains to remove hardcoded sleeps
altogether, but we'll circle back and eliminate those calls once the
test suite is passing reliably.

Increases CircleCI timeout to 20m

The functional tests can take a long time, so let's instruct CircleCI to
continue waiting, to give the test suite a chance to finish
successfully.

Updates README for the functional tests

Mostly correcting a typo in the `instance_information.json` config
filename, but also updated some of the example commands. The notes
regarding potentially failing tests also seemed out of date, as several
members of the team have confirmed working functional tests under the
new TB Selenium logic recently.

Removes temporary testing related directories

We need to clean up any temporary test directory before running
any test, as the previous can create a bad state in the database.
For example, one of our pages-layout test adds 123456 as hotp value
to the test account, and it will never be able to login again.

Adds missing steps for pages-layout tests over tor

We can now generate thousands of random journalist names using
the generator. Only the first 3 names are used in the functional
tests, the rest are being used in the pages-layout.

We also added back _source_delete_key function for one the test.
Rest of the updates are to add sleep function calls or to have
better error message.

Adds comment about the user generator and lint fixes

We have get_journalist_usernames generator which can generate
unlimited number of users for many tests.

Moves around all driver creation functions into one place

We now have the functional/functional_test.py to handle all
driver creation logic. For the pages-layout tests, we are creating
only a Firefox driver to connect to the local container itself.

This logic does not work against any external server as of now.

Updates test user creation logic inside of container

Removing old method calls from user creation logic, this is only
used inside of the container for the functional testing.

Downloads data from server using requests over Tor

The test requirements now have requests[socks] as dependency.
Using the same we are now directly downloading the files/messages
from the .onion address for functional tests.

The old external command file also got removed this committ.

We are creating the gpg object for both container based local
testing and external testing (in functional tests).
Fixes: freedomofpress#3691 freedomofpress#3687

Removed xvfb, tor browser, and firefox installs from app-staging - functional tests now run remotely

fix to pass make ci-lint

Cleans up flake8 errors in functional tests

Resolves some lingering flake8 formatting violations that were causing
lint checks to fail. These changes are unrelated to the current PR, but
better late than never.

Written by @msheiny, committed by @conorsch during branch collab.

Signed-off-by: Conor Schaefer <conor@freedom.press>

Adds --staging flag create-dev-data.py for tests

We now have --staging flag to the create-dev-data.py script so
that we can easily create an user in the staging or prodcution test
and then use the functional tests to test the instance.

Add fact gatherer for extracting tor app onion details

This is really for functional testing in staging environments, but the
script doesnt hurt to be installed in prod. It doesn't elevate
permissions or expose any sensitive details - you need to run as root in
order to gain useful data.

Logic to dump app tor onion data to func config

This commit adds logic to the test runner so that a functional test json
config gets dumped for usage in the tbb selenium test tools against
staging.

Wire-up current app-test role to our upgrade scenario

Without this change, the upgrade scenario would utilize the app-test
logic from the old repo. Which is not what we want. This is of course
kind of "hacky". I welcome the opportunity to improve this with feedback
:)

Move tor fact logic from tor role --> app-test role

I'm not sure we are ready to shove this on prod instances AND I was
running into weird old/new role logic under the molecule scenario.
Ideally the fact should be in both roles but I dunno.. this seemed like
an easier short-term fix.

ansible spacing' and tag nits

Testinfra: Update test dependencies for app-staging

In freedomofpress#3697, we removed the application testing pip dependencies.
This commit updates the testinfra test variables accordingly.

Fix linting failures

One of these was introduced in freedomofpress#3672, but not discovered due to
other CI failures (e.g. python not found when running the lint job)

Use absolute pathing in i18n testing

I'm hoping this shakes out some really weird test failures we were
seeing only under CircleCI only under the functional testing branch at a
certain point in time. Really wild behavior. *fingers crossed*

Set selenium webdriver test output to WARNING

Originally was on DEBUG and was sending out mountains of output into the
pytest process which made it difficult to assess anything.

(cherry picked from commit a1f0134)

removed duplicate entry in test requirements

Dockerfile: Update Tor Browser to 8.0

Docker development environment: Update Tor signing key

Dockerfile: Update geckodriver and firefox-esr

Swap x11vnc with tightvncserver

Basically installed this because it can be used with pyvirtualdisplay as
a backend AND because it brings in the Xvnc tooling which will start an
X11 server as well as a VNC server.

Wire-up VNC server and helper command for func tests

Had to remove x11 display logic inside test scaffolding (initially tried
to integrate it there but it kept building and destroying the VNC server
per test).

Made a VNC helper command with support for GNOME desktop and macOS (havent
tested it on mac yet). Updated the docs

Bump functional test sleep time

10 seconds is way too short.. 160 seconds.. maybe too long? Fingers
crossed I can work with the team to get the wait_for logic running

Add functionality to prepare boxes for functional testing

Typically these actions were done manually but lets get our good old
friend ansible to run them for us (at least under the upgrade env).

Added auth to VNC in test container, for OS X compatibility.

Bump TBB/ESR to 8.0.1 and 60.2.0esr combo

https://blog.torproject.org/new-release-tor-browser-801

Updated geckodriver to 0.22.0

added ini file to get around remote-viewer password prompt

Functional tests: xfail test_warning_appears_if_tor_browser_not_in_use

Due to defect freedomofpress#3793, when using Firefox Quantum, the incorrect message
is displayed on the source interface. This test will not pass until that
is resolved.

Functional tests: Fix firefox path

Testinfra: Fix test failure due to non-DRY variables files

staging.yml is a concatenation of multiple other variables files,
one was updated during rebase, one was not.

Testinfra: Update Flask version to 1.0.2

fixed VNC port being defined twice when running 'make dev'

Tests: Modify viewport size for parity between dev and CI env

In CI we are getting MoveTargetOutOfBoundsException, but not locally.
We have had errors in the past due to different viewport sizes in CI
and locally, so setting this to a standard size for the pages layout
tests (where the exception is occurring).

Functional tests: Resolve NoAlertPresentException

We were getting a NoAlertPresentException due to new behavior in
geckodriver [0] where interacting with the driver closes the modal.
Thus, we do not need to explicitly accept the modal here.

[0] mozilla/geckodriver#1171

Replaced parameterized time.sleep()s with self.waitfor()s

Stability fixes layout tests, added new functests from develop, updated TBB

fixed flaky page layout tests that were broken by long fr_FR strings causing UI elements to wrap.

fixed flake8, added explicit scroll to elements before click, stability fixes

Dockerfile: get key from Mozilla keyserver

For whatever reason, this Firefox signing key was not available on
the keyserver in the prior diff, but was available on Mozilla's
keyserver.

deps: Update requests due to CVE-2018-18074

functional tests: Add wait_for prior to clicking submit

functional tests: Remove sleeps and reduce flakiness around modal

functional tests: Remove sleeps around js alerts

functional tests: use sleep_time as default timeout

functional tests: Remove remainder of time.sleeps in source steps

Don't clobber existing custom logo

Minimal changes to remove external server testing functionality

Merge from develop
rmol pushed a commit to rmol/securedrop that referenced this issue Apr 22, 2019
stupid utility to create an test admin user fast

Working tbselineum tests for most part.

fixes two typos in readme of tor based tests

Fixes directory path in README

Hardcoded onion addresse work

Test for tor broser asking high security in slider

Reads instance information from a json file

Uses clean variable name

Configure the sleep amount between clicks

Just tests admin/journalist login and cookies

Tests working once again.

Use firefox to login for downloads in selenium tests

Updates README

Matches with 0.6-rc2 functional tests

We are using TBB 7.5

We need more time and click to test logout

Fixes the assert statement

Updates based on current upstream

TB functional tests: Gitignore instance config

This prevents the accidental commit of private information.

TB functional tests: Merge tbselenium dir

Updates the ansible files for tbb

Updates to the Dockerfile for tbb

Updates as suggested in the PR review for ansible and dockerfile

Missing tor key

Removes duplicated 'when' line from app-test logic

The 'when' conditional detecting a grsec kernel, used for running the
paxctl commands on the TBB binary, was needlessly duplicated on the
relevant task. Fortunately that didn't cause breakage, because the
'when' lines were identical, but only one was active.

Updates functional test container image

Now installs Firefox 52 ESR, rather than Firefox 46, for use inside the
test container.

Includes changes to run-test shell script:

    TOR_FORCE_NET_CONFIG=0 is required to directly connect to Tor
    network, otherwise it will wait for userinput to either connect
    or to configure

    The `run_xvfb` invocation is no longer necessary, since the test suite
    code bootstraps the headless server now.

Creates local test server inside the container

Bootstrapping the application services within the functional test suite.
Includes some cleanup, culling unused debugging code, and also cleans up
the various print statements.

Ignore functional test firefox logs (thanks, @msheiny!)

Adds retries for tor network connection failure, using the pre-existing
logic.

Uses nc rather than torsocks in functional tests

The version of torsocks in the Trusty repos isn't recent enough to
support custom ports. Rather than install from other sources, which
requires manual package verification (or configuring non-trusty repos,
which could break other packages), let's fall back to good ol' nc.

Creates proper orbot specific project to test

We need to create a new firefox profile to test the orbot specific
warning. This works for both locally and over Tor.

Updates test_make_account_changes for Tor

Now we can safely execute the account changes in the tests running
on the Tor browser. The logic update makes sure to create different
user for this test than any other test.

Reduces sleep durations in functional tests

We don't have to sleep for too long if we are running against
local instance. The ultimate goal remains to remove hardcoded sleeps
altogether, but we'll circle back and eliminate those calls once the
test suite is passing reliably.

Increases CircleCI timeout to 20m

The functional tests can take a long time, so let's instruct CircleCI to
continue waiting, to give the test suite a chance to finish
successfully.

Updates README for the functional tests

Mostly correcting a typo in the `instance_information.json` config
filename, but also updated some of the example commands. The notes
regarding potentially failing tests also seemed out of date, as several
members of the team have confirmed working functional tests under the
new TB Selenium logic recently.

Removes temporary testing related directories

We need to clean up any temporary test directory before running
any test, as the previous can create a bad state in the database.
For example, one of our pages-layout test adds 123456 as hotp value
to the test account, and it will never be able to login again.

Adds missing steps for pages-layout tests over tor

We can now generate thousands of random journalist names using
the generator. Only the first 3 names are used in the functional
tests, the rest are being used in the pages-layout.

We also added back _source_delete_key function for one the test.
Rest of the updates are to add sleep function calls or to have
better error message.

Adds comment about the user generator and lint fixes

We have get_journalist_usernames generator which can generate
unlimited number of users for many tests.

Moves around all driver creation functions into one place

We now have the functional/functional_test.py to handle all
driver creation logic. For the pages-layout tests, we are creating
only a Firefox driver to connect to the local container itself.

This logic does not work against any external server as of now.

Updates test user creation logic inside of container

Removing old method calls from user creation logic, this is only
used inside of the container for the functional testing.

Downloads data from server using requests over Tor

The test requirements now have requests[socks] as dependency.
Using the same we are now directly downloading the files/messages
from the .onion address for functional tests.

The old external command file also got removed this committ.

We are creating the gpg object for both container based local
testing and external testing (in functional tests).
Fixes: freedomofpress#3691 freedomofpress#3687

Removed xvfb, tor browser, and firefox installs from app-staging - functional tests now run remotely

fix to pass make ci-lint

Cleans up flake8 errors in functional tests

Resolves some lingering flake8 formatting violations that were causing
lint checks to fail. These changes are unrelated to the current PR, but
better late than never.

Written by @msheiny, committed by @conorsch during branch collab.

Signed-off-by: Conor Schaefer <conor@freedom.press>

Adds --staging flag create-dev-data.py for tests

We now have --staging flag to the create-dev-data.py script so
that we can easily create an user in the staging or prodcution test
and then use the functional tests to test the instance.

Add fact gatherer for extracting tor app onion details

This is really for functional testing in staging environments, but the
script doesnt hurt to be installed in prod. It doesn't elevate
permissions or expose any sensitive details - you need to run as root in
order to gain useful data.

Logic to dump app tor onion data to func config

This commit adds logic to the test runner so that a functional test json
config gets dumped for usage in the tbb selenium test tools against
staging.

Wire-up current app-test role to our upgrade scenario

Without this change, the upgrade scenario would utilize the app-test
logic from the old repo. Which is not what we want. This is of course
kind of "hacky". I welcome the opportunity to improve this with feedback
:)

Move tor fact logic from tor role --> app-test role

I'm not sure we are ready to shove this on prod instances AND I was
running into weird old/new role logic under the molecule scenario.
Ideally the fact should be in both roles but I dunno.. this seemed like
an easier short-term fix.

ansible spacing' and tag nits

Testinfra: Update test dependencies for app-staging

In freedomofpress#3697, we removed the application testing pip dependencies.
This commit updates the testinfra test variables accordingly.

Fix linting failures

One of these was introduced in freedomofpress#3672, but not discovered due to
other CI failures (e.g. python not found when running the lint job)

Use absolute pathing in i18n testing

I'm hoping this shakes out some really weird test failures we were
seeing only under CircleCI only under the functional testing branch at a
certain point in time. Really wild behavior. *fingers crossed*

Set selenium webdriver test output to WARNING

Originally was on DEBUG and was sending out mountains of output into the
pytest process which made it difficult to assess anything.

(cherry picked from commit a1f0134)

removed duplicate entry in test requirements

Dockerfile: Update Tor Browser to 8.0

Docker development environment: Update Tor signing key

Dockerfile: Update geckodriver and firefox-esr

Swap x11vnc with tightvncserver

Basically installed this because it can be used with pyvirtualdisplay as
a backend AND because it brings in the Xvnc tooling which will start an
X11 server as well as a VNC server.

Wire-up VNC server and helper command for func tests

Had to remove x11 display logic inside test scaffolding (initially tried
to integrate it there but it kept building and destroying the VNC server
per test).

Made a VNC helper command with support for GNOME desktop and macOS (havent
tested it on mac yet). Updated the docs

Bump functional test sleep time

10 seconds is way too short.. 160 seconds.. maybe too long? Fingers
crossed I can work with the team to get the wait_for logic running

Add functionality to prepare boxes for functional testing

Typically these actions were done manually but lets get our good old
friend ansible to run them for us (at least under the upgrade env).

Added auth to VNC in test container, for OS X compatibility.

Bump TBB/ESR to 8.0.1 and 60.2.0esr combo

https://blog.torproject.org/new-release-tor-browser-801

Updated geckodriver to 0.22.0

added ini file to get around remote-viewer password prompt

Functional tests: xfail test_warning_appears_if_tor_browser_not_in_use

Due to defect freedomofpress#3793, when using Firefox Quantum, the incorrect message
is displayed on the source interface. This test will not pass until that
is resolved.

Functional tests: Fix firefox path

Testinfra: Fix test failure due to non-DRY variables files

staging.yml is a concatenation of multiple other variables files,
one was updated during rebase, one was not.

Testinfra: Update Flask version to 1.0.2

fixed VNC port being defined twice when running 'make dev'

Tests: Modify viewport size for parity between dev and CI env

In CI we are getting MoveTargetOutOfBoundsException, but not locally.
We have had errors in the past due to different viewport sizes in CI
and locally, so setting this to a standard size for the pages layout
tests (where the exception is occurring).

Functional tests: Resolve NoAlertPresentException

We were getting a NoAlertPresentException due to new behavior in
geckodriver [0] where interacting with the driver closes the modal.
Thus, we do not need to explicitly accept the modal here.

[0] mozilla/geckodriver#1171

Replaced parameterized time.sleep()s with self.waitfor()s

Stability fixes layout tests, added new functests from develop, updated TBB

fixed flaky page layout tests that were broken by long fr_FR strings causing UI elements to wrap.

fixed flake8, added explicit scroll to elements before click, stability fixes

Dockerfile: get key from Mozilla keyserver

For whatever reason, this Firefox signing key was not available on
the keyserver in the prior diff, but was available on Mozilla's
keyserver.

deps: Update requests due to CVE-2018-18074

functional tests: Add wait_for prior to clicking submit

functional tests: Remove sleeps and reduce flakiness around modal

functional tests: Remove sleeps around js alerts

functional tests: use sleep_time as default timeout

functional tests: Remove remainder of time.sleeps in source steps

Don't clobber existing custom logo

Minimal changes to remove external server testing functionality

Merge from develop
rmol pushed a commit to rmol/securedrop that referenced this issue Apr 29, 2019
stupid utility to create an test admin user fast

Working tbselineum tests for most part.

fixes two typos in readme of tor based tests

Fixes directory path in README

Hardcoded onion addresse work

Test for tor broser asking high security in slider

Reads instance information from a json file

Uses clean variable name

Configure the sleep amount between clicks

Just tests admin/journalist login and cookies

Tests working once again.

Use firefox to login for downloads in selenium tests

Updates README

Matches with 0.6-rc2 functional tests

We are using TBB 7.5

We need more time and click to test logout

Fixes the assert statement

Updates based on current upstream

TB functional tests: Gitignore instance config

This prevents the accidental commit of private information.

TB functional tests: Merge tbselenium dir

Updates the ansible files for tbb

Updates to the Dockerfile for tbb

Updates as suggested in the PR review for ansible and dockerfile

Missing tor key

Removes duplicated 'when' line from app-test logic

The 'when' conditional detecting a grsec kernel, used for running the
paxctl commands on the TBB binary, was needlessly duplicated on the
relevant task. Fortunately that didn't cause breakage, because the
'when' lines were identical, but only one was active.

Updates functional test container image

Now installs Firefox 52 ESR, rather than Firefox 46, for use inside the
test container.

Includes changes to run-test shell script:

    TOR_FORCE_NET_CONFIG=0 is required to directly connect to Tor
    network, otherwise it will wait for userinput to either connect
    or to configure

    The `run_xvfb` invocation is no longer necessary, since the test suite
    code bootstraps the headless server now.

Creates local test server inside the container

Bootstrapping the application services within the functional test suite.
Includes some cleanup, culling unused debugging code, and also cleans up
the various print statements.

Ignore functional test firefox logs (thanks, @msheiny!)

Adds retries for tor network connection failure, using the pre-existing
logic.

Uses nc rather than torsocks in functional tests

The version of torsocks in the Trusty repos isn't recent enough to
support custom ports. Rather than install from other sources, which
requires manual package verification (or configuring non-trusty repos,
which could break other packages), let's fall back to good ol' nc.

Creates proper orbot specific project to test

We need to create a new firefox profile to test the orbot specific
warning. This works for both locally and over Tor.

Updates test_make_account_changes for Tor

Now we can safely execute the account changes in the tests running
on the Tor browser. The logic update makes sure to create different
user for this test than any other test.

Reduces sleep durations in functional tests

We don't have to sleep for too long if we are running against
local instance. The ultimate goal remains to remove hardcoded sleeps
altogether, but we'll circle back and eliminate those calls once the
test suite is passing reliably.

Increases CircleCI timeout to 20m

The functional tests can take a long time, so let's instruct CircleCI to
continue waiting, to give the test suite a chance to finish
successfully.

Updates README for the functional tests

Mostly correcting a typo in the `instance_information.json` config
filename, but also updated some of the example commands. The notes
regarding potentially failing tests also seemed out of date, as several
members of the team have confirmed working functional tests under the
new TB Selenium logic recently.

Removes temporary testing related directories

We need to clean up any temporary test directory before running
any test, as the previous can create a bad state in the database.
For example, one of our pages-layout test adds 123456 as hotp value
to the test account, and it will never be able to login again.

Adds missing steps for pages-layout tests over tor

We can now generate thousands of random journalist names using
the generator. Only the first 3 names are used in the functional
tests, the rest are being used in the pages-layout.

We also added back _source_delete_key function for one the test.
Rest of the updates are to add sleep function calls or to have
better error message.

Adds comment about the user generator and lint fixes

We have get_journalist_usernames generator which can generate
unlimited number of users for many tests.

Moves around all driver creation functions into one place

We now have the functional/functional_test.py to handle all
driver creation logic. For the pages-layout tests, we are creating
only a Firefox driver to connect to the local container itself.

This logic does not work against any external server as of now.

Updates test user creation logic inside of container

Removing old method calls from user creation logic, this is only
used inside of the container for the functional testing.

Downloads data from server using requests over Tor

The test requirements now have requests[socks] as dependency.
Using the same we are now directly downloading the files/messages
from the .onion address for functional tests.

The old external command file also got removed this committ.

We are creating the gpg object for both container based local
testing and external testing (in functional tests).
Fixes: freedomofpress#3691 freedomofpress#3687

Removed xvfb, tor browser, and firefox installs from app-staging - functional tests now run remotely

fix to pass make ci-lint

Cleans up flake8 errors in functional tests

Resolves some lingering flake8 formatting violations that were causing
lint checks to fail. These changes are unrelated to the current PR, but
better late than never.

Written by @msheiny, committed by @conorsch during branch collab.

Signed-off-by: Conor Schaefer <conor@freedom.press>

Adds --staging flag create-dev-data.py for tests

We now have --staging flag to the create-dev-data.py script so
that we can easily create an user in the staging or prodcution test
and then use the functional tests to test the instance.

Add fact gatherer for extracting tor app onion details

This is really for functional testing in staging environments, but the
script doesnt hurt to be installed in prod. It doesn't elevate
permissions or expose any sensitive details - you need to run as root in
order to gain useful data.

Logic to dump app tor onion data to func config

This commit adds logic to the test runner so that a functional test json
config gets dumped for usage in the tbb selenium test tools against
staging.

Wire-up current app-test role to our upgrade scenario

Without this change, the upgrade scenario would utilize the app-test
logic from the old repo. Which is not what we want. This is of course
kind of "hacky". I welcome the opportunity to improve this with feedback
:)

Move tor fact logic from tor role --> app-test role

I'm not sure we are ready to shove this on prod instances AND I was
running into weird old/new role logic under the molecule scenario.
Ideally the fact should be in both roles but I dunno.. this seemed like
an easier short-term fix.

ansible spacing' and tag nits

Testinfra: Update test dependencies for app-staging

In freedomofpress#3697, we removed the application testing pip dependencies.
This commit updates the testinfra test variables accordingly.

Fix linting failures

One of these was introduced in freedomofpress#3672, but not discovered due to
other CI failures (e.g. python not found when running the lint job)

Use absolute pathing in i18n testing

I'm hoping this shakes out some really weird test failures we were
seeing only under CircleCI only under the functional testing branch at a
certain point in time. Really wild behavior. *fingers crossed*

Set selenium webdriver test output to WARNING

Originally was on DEBUG and was sending out mountains of output into the
pytest process which made it difficult to assess anything.

(cherry picked from commit a1f0134)

removed duplicate entry in test requirements

Dockerfile: Update Tor Browser to 8.0

Docker development environment: Update Tor signing key

Dockerfile: Update geckodriver and firefox-esr

Swap x11vnc with tightvncserver

Basically installed this because it can be used with pyvirtualdisplay as
a backend AND because it brings in the Xvnc tooling which will start an
X11 server as well as a VNC server.

Wire-up VNC server and helper command for func tests

Had to remove x11 display logic inside test scaffolding (initially tried
to integrate it there but it kept building and destroying the VNC server
per test).

Made a VNC helper command with support for GNOME desktop and macOS (havent
tested it on mac yet). Updated the docs

Bump functional test sleep time

10 seconds is way too short.. 160 seconds.. maybe too long? Fingers
crossed I can work with the team to get the wait_for logic running

Add functionality to prepare boxes for functional testing

Typically these actions were done manually but lets get our good old
friend ansible to run them for us (at least under the upgrade env).

Added auth to VNC in test container, for OS X compatibility.

Bump TBB/ESR to 8.0.1 and 60.2.0esr combo

https://blog.torproject.org/new-release-tor-browser-801

Updated geckodriver to 0.22.0

added ini file to get around remote-viewer password prompt

Functional tests: xfail test_warning_appears_if_tor_browser_not_in_use

Due to defect freedomofpress#3793, when using Firefox Quantum, the incorrect message
is displayed on the source interface. This test will not pass until that
is resolved.

Functional tests: Fix firefox path

Testinfra: Fix test failure due to non-DRY variables files

staging.yml is a concatenation of multiple other variables files,
one was updated during rebase, one was not.

Testinfra: Update Flask version to 1.0.2

fixed VNC port being defined twice when running 'make dev'

Tests: Modify viewport size for parity between dev and CI env

In CI we are getting MoveTargetOutOfBoundsException, but not locally.
We have had errors in the past due to different viewport sizes in CI
and locally, so setting this to a standard size for the pages layout
tests (where the exception is occurring).

Functional tests: Resolve NoAlertPresentException

We were getting a NoAlertPresentException due to new behavior in
geckodriver [0] where interacting with the driver closes the modal.
Thus, we do not need to explicitly accept the modal here.

[0] mozilla/geckodriver#1171

Replaced parameterized time.sleep()s with self.waitfor()s

Stability fixes layout tests, added new functests from develop, updated TBB

fixed flaky page layout tests that were broken by long fr_FR strings causing UI elements to wrap.

fixed flake8, added explicit scroll to elements before click, stability fixes

Dockerfile: get key from Mozilla keyserver

For whatever reason, this Firefox signing key was not available on
the keyserver in the prior diff, but was available on Mozilla's
keyserver.

deps: Update requests due to CVE-2018-18074

functional tests: Add wait_for prior to clicking submit

functional tests: Remove sleeps and reduce flakiness around modal

functional tests: Remove sleeps around js alerts

functional tests: use sleep_time as default timeout

functional tests: Remove remainder of time.sleeps in source steps

Don't clobber existing custom logo

Minimal changes to remove external server testing functionality

Merge from develop
rmol pushed a commit to rmol/securedrop that referenced this issue May 1, 2019
stupid utility to create an test admin user fast

Working tbselineum tests for most part.

fixes two typos in readme of tor based tests

Fixes directory path in README

Hardcoded onion addresse work

Test for tor broser asking high security in slider

Reads instance information from a json file

Uses clean variable name

Configure the sleep amount between clicks

Just tests admin/journalist login and cookies

Tests working once again.

Use firefox to login for downloads in selenium tests

Updates README

Matches with 0.6-rc2 functional tests

We are using TBB 7.5

We need more time and click to test logout

Fixes the assert statement

Updates based on current upstream

TB functional tests: Gitignore instance config

This prevents the accidental commit of private information.

TB functional tests: Merge tbselenium dir

Updates the ansible files for tbb

Updates to the Dockerfile for tbb

Updates as suggested in the PR review for ansible and dockerfile

Missing tor key

Removes duplicated 'when' line from app-test logic

The 'when' conditional detecting a grsec kernel, used for running the
paxctl commands on the TBB binary, was needlessly duplicated on the
relevant task. Fortunately that didn't cause breakage, because the
'when' lines were identical, but only one was active.

Updates functional test container image

Now installs Firefox 52 ESR, rather than Firefox 46, for use inside the
test container.

Includes changes to run-test shell script:

    TOR_FORCE_NET_CONFIG=0 is required to directly connect to Tor
    network, otherwise it will wait for userinput to either connect
    or to configure

    The `run_xvfb` invocation is no longer necessary, since the test suite
    code bootstraps the headless server now.

Creates local test server inside the container

Bootstrapping the application services within the functional test suite.
Includes some cleanup, culling unused debugging code, and also cleans up
the various print statements.

Ignore functional test firefox logs (thanks, @msheiny!)

Adds retries for tor network connection failure, using the pre-existing
logic.

Uses nc rather than torsocks in functional tests

The version of torsocks in the Trusty repos isn't recent enough to
support custom ports. Rather than install from other sources, which
requires manual package verification (or configuring non-trusty repos,
which could break other packages), let's fall back to good ol' nc.

Creates proper orbot specific project to test

We need to create a new firefox profile to test the orbot specific
warning. This works for both locally and over Tor.

Updates test_make_account_changes for Tor

Now we can safely execute the account changes in the tests running
on the Tor browser. The logic update makes sure to create different
user for this test than any other test.

Reduces sleep durations in functional tests

We don't have to sleep for too long if we are running against
local instance. The ultimate goal remains to remove hardcoded sleeps
altogether, but we'll circle back and eliminate those calls once the
test suite is passing reliably.

Increases CircleCI timeout to 20m

The functional tests can take a long time, so let's instruct CircleCI to
continue waiting, to give the test suite a chance to finish
successfully.

Updates README for the functional tests

Mostly correcting a typo in the `instance_information.json` config
filename, but also updated some of the example commands. The notes
regarding potentially failing tests also seemed out of date, as several
members of the team have confirmed working functional tests under the
new TB Selenium logic recently.

Removes temporary testing related directories

We need to clean up any temporary test directory before running
any test, as the previous can create a bad state in the database.
For example, one of our pages-layout test adds 123456 as hotp value
to the test account, and it will never be able to login again.

Adds missing steps for pages-layout tests over tor

We can now generate thousands of random journalist names using
the generator. Only the first 3 names are used in the functional
tests, the rest are being used in the pages-layout.

We also added back _source_delete_key function for one the test.
Rest of the updates are to add sleep function calls or to have
better error message.

Adds comment about the user generator and lint fixes

We have get_journalist_usernames generator which can generate
unlimited number of users for many tests.

Moves around all driver creation functions into one place

We now have the functional/functional_test.py to handle all
driver creation logic. For the pages-layout tests, we are creating
only a Firefox driver to connect to the local container itself.

This logic does not work against any external server as of now.

Updates test user creation logic inside of container

Removing old method calls from user creation logic, this is only
used inside of the container for the functional testing.

Downloads data from server using requests over Tor

The test requirements now have requests[socks] as dependency.
Using the same we are now directly downloading the files/messages
from the .onion address for functional tests.

The old external command file also got removed this committ.

We are creating the gpg object for both container based local
testing and external testing (in functional tests).
Fixes: freedomofpress#3691 freedomofpress#3687

Removed xvfb, tor browser, and firefox installs from app-staging - functional tests now run remotely

fix to pass make ci-lint

Cleans up flake8 errors in functional tests

Resolves some lingering flake8 formatting violations that were causing
lint checks to fail. These changes are unrelated to the current PR, but
better late than never.

Written by @msheiny, committed by @conorsch during branch collab.

Signed-off-by: Conor Schaefer <conor@freedom.press>

Adds --staging flag create-dev-data.py for tests

We now have --staging flag to the create-dev-data.py script so
that we can easily create an user in the staging or prodcution test
and then use the functional tests to test the instance.

Add fact gatherer for extracting tor app onion details

This is really for functional testing in staging environments, but the
script doesnt hurt to be installed in prod. It doesn't elevate
permissions or expose any sensitive details - you need to run as root in
order to gain useful data.

Logic to dump app tor onion data to func config

This commit adds logic to the test runner so that a functional test json
config gets dumped for usage in the tbb selenium test tools against
staging.

Wire-up current app-test role to our upgrade scenario

Without this change, the upgrade scenario would utilize the app-test
logic from the old repo. Which is not what we want. This is of course
kind of "hacky". I welcome the opportunity to improve this with feedback
:)

Move tor fact logic from tor role --> app-test role

I'm not sure we are ready to shove this on prod instances AND I was
running into weird old/new role logic under the molecule scenario.
Ideally the fact should be in both roles but I dunno.. this seemed like
an easier short-term fix.

ansible spacing' and tag nits

Testinfra: Update test dependencies for app-staging

In freedomofpress#3697, we removed the application testing pip dependencies.
This commit updates the testinfra test variables accordingly.

Fix linting failures

One of these was introduced in freedomofpress#3672, but not discovered due to
other CI failures (e.g. python not found when running the lint job)

Use absolute pathing in i18n testing

I'm hoping this shakes out some really weird test failures we were
seeing only under CircleCI only under the functional testing branch at a
certain point in time. Really wild behavior. *fingers crossed*

Set selenium webdriver test output to WARNING

Originally was on DEBUG and was sending out mountains of output into the
pytest process which made it difficult to assess anything.

(cherry picked from commit a1f0134)

removed duplicate entry in test requirements

Dockerfile: Update Tor Browser to 8.0

Docker development environment: Update Tor signing key

Dockerfile: Update geckodriver and firefox-esr

Swap x11vnc with tightvncserver

Basically installed this because it can be used with pyvirtualdisplay as
a backend AND because it brings in the Xvnc tooling which will start an
X11 server as well as a VNC server.

Wire-up VNC server and helper command for func tests

Had to remove x11 display logic inside test scaffolding (initially tried
to integrate it there but it kept building and destroying the VNC server
per test).

Made a VNC helper command with support for GNOME desktop and macOS (havent
tested it on mac yet). Updated the docs

Bump functional test sleep time

10 seconds is way too short.. 160 seconds.. maybe too long? Fingers
crossed I can work with the team to get the wait_for logic running

Add functionality to prepare boxes for functional testing

Typically these actions were done manually but lets get our good old
friend ansible to run them for us (at least under the upgrade env).

Added auth to VNC in test container, for OS X compatibility.

Bump TBB/ESR to 8.0.1 and 60.2.0esr combo

https://blog.torproject.org/new-release-tor-browser-801

Updated geckodriver to 0.22.0

added ini file to get around remote-viewer password prompt

Functional tests: xfail test_warning_appears_if_tor_browser_not_in_use

Due to defect freedomofpress#3793, when using Firefox Quantum, the incorrect message
is displayed on the source interface. This test will not pass until that
is resolved.

Functional tests: Fix firefox path

Testinfra: Fix test failure due to non-DRY variables files

staging.yml is a concatenation of multiple other variables files,
one was updated during rebase, one was not.

Testinfra: Update Flask version to 1.0.2

fixed VNC port being defined twice when running 'make dev'

Tests: Modify viewport size for parity between dev and CI env

In CI we are getting MoveTargetOutOfBoundsException, but not locally.
We have had errors in the past due to different viewport sizes in CI
and locally, so setting this to a standard size for the pages layout
tests (where the exception is occurring).

Functional tests: Resolve NoAlertPresentException

We were getting a NoAlertPresentException due to new behavior in
geckodriver [0] where interacting with the driver closes the modal.
Thus, we do not need to explicitly accept the modal here.

[0] mozilla/geckodriver#1171

Replaced parameterized time.sleep()s with self.waitfor()s

Stability fixes layout tests, added new functests from develop, updated TBB

fixed flaky page layout tests that were broken by long fr_FR strings causing UI elements to wrap.

fixed flake8, added explicit scroll to elements before click, stability fixes

Dockerfile: get key from Mozilla keyserver

For whatever reason, this Firefox signing key was not available on
the keyserver in the prior diff, but was available on Mozilla's
keyserver.

deps: Update requests due to CVE-2018-18074

functional tests: Add wait_for prior to clicking submit

functional tests: Remove sleeps and reduce flakiness around modal

functional tests: Remove sleeps around js alerts

functional tests: use sleep_time as default timeout

functional tests: Remove remainder of time.sleeps in source steps

Don't clobber existing custom logo

Minimal changes to remove external server testing functionality

Merge from develop
rmol pushed a commit to rmol/securedrop that referenced this issue May 9, 2019
stupid utility to create an test admin user fast

Working tbselineum tests for most part.

fixes two typos in readme of tor based tests

Fixes directory path in README

Hardcoded onion addresse work

Test for tor broser asking high security in slider

Reads instance information from a json file

Uses clean variable name

Configure the sleep amount between clicks

Just tests admin/journalist login and cookies

Tests working once again.

Use firefox to login for downloads in selenium tests

Updates README

Matches with 0.6-rc2 functional tests

We are using TBB 7.5

We need more time and click to test logout

Fixes the assert statement

Updates based on current upstream

TB functional tests: Gitignore instance config

This prevents the accidental commit of private information.

TB functional tests: Merge tbselenium dir

Updates the ansible files for tbb

Updates to the Dockerfile for tbb

Updates as suggested in the PR review for ansible and dockerfile

Missing tor key

Removes duplicated 'when' line from app-test logic

The 'when' conditional detecting a grsec kernel, used for running the
paxctl commands on the TBB binary, was needlessly duplicated on the
relevant task. Fortunately that didn't cause breakage, because the
'when' lines were identical, but only one was active.

Updates functional test container image

Now installs Firefox 52 ESR, rather than Firefox 46, for use inside the
test container.

Includes changes to run-test shell script:

    TOR_FORCE_NET_CONFIG=0 is required to directly connect to Tor
    network, otherwise it will wait for userinput to either connect
    or to configure

    The `run_xvfb` invocation is no longer necessary, since the test suite
    code bootstraps the headless server now.

Creates local test server inside the container

Bootstrapping the application services within the functional test suite.
Includes some cleanup, culling unused debugging code, and also cleans up
the various print statements.

Ignore functional test firefox logs (thanks, @msheiny!)

Adds retries for tor network connection failure, using the pre-existing
logic.

Uses nc rather than torsocks in functional tests

The version of torsocks in the Trusty repos isn't recent enough to
support custom ports. Rather than install from other sources, which
requires manual package verification (or configuring non-trusty repos,
which could break other packages), let's fall back to good ol' nc.

Creates proper orbot specific project to test

We need to create a new firefox profile to test the orbot specific
warning. This works for both locally and over Tor.

Updates test_make_account_changes for Tor

Now we can safely execute the account changes in the tests running
on the Tor browser. The logic update makes sure to create different
user for this test than any other test.

Reduces sleep durations in functional tests

We don't have to sleep for too long if we are running against
local instance. The ultimate goal remains to remove hardcoded sleeps
altogether, but we'll circle back and eliminate those calls once the
test suite is passing reliably.

Increases CircleCI timeout to 20m

The functional tests can take a long time, so let's instruct CircleCI to
continue waiting, to give the test suite a chance to finish
successfully.

Updates README for the functional tests

Mostly correcting a typo in the `instance_information.json` config
filename, but also updated some of the example commands. The notes
regarding potentially failing tests also seemed out of date, as several
members of the team have confirmed working functional tests under the
new TB Selenium logic recently.

Removes temporary testing related directories

We need to clean up any temporary test directory before running
any test, as the previous can create a bad state in the database.
For example, one of our pages-layout test adds 123456 as hotp value
to the test account, and it will never be able to login again.

Adds missing steps for pages-layout tests over tor

We can now generate thousands of random journalist names using
the generator. Only the first 3 names are used in the functional
tests, the rest are being used in the pages-layout.

We also added back _source_delete_key function for one the test.
Rest of the updates are to add sleep function calls or to have
better error message.

Adds comment about the user generator and lint fixes

We have get_journalist_usernames generator which can generate
unlimited number of users for many tests.

Moves around all driver creation functions into one place

We now have the functional/functional_test.py to handle all
driver creation logic. For the pages-layout tests, we are creating
only a Firefox driver to connect to the local container itself.

This logic does not work against any external server as of now.

Updates test user creation logic inside of container

Removing old method calls from user creation logic, this is only
used inside of the container for the functional testing.

Downloads data from server using requests over Tor

The test requirements now have requests[socks] as dependency.
Using the same we are now directly downloading the files/messages
from the .onion address for functional tests.

The old external command file also got removed this committ.

We are creating the gpg object for both container based local
testing and external testing (in functional tests).
Fixes: freedomofpress#3691 freedomofpress#3687

Removed xvfb, tor browser, and firefox installs from app-staging - functional tests now run remotely

fix to pass make ci-lint

Cleans up flake8 errors in functional tests

Resolves some lingering flake8 formatting violations that were causing
lint checks to fail. These changes are unrelated to the current PR, but
better late than never.

Written by @msheiny, committed by @conorsch during branch collab.

Signed-off-by: Conor Schaefer <conor@freedom.press>

Adds --staging flag create-dev-data.py for tests

We now have --staging flag to the create-dev-data.py script so
that we can easily create an user in the staging or prodcution test
and then use the functional tests to test the instance.

Add fact gatherer for extracting tor app onion details

This is really for functional testing in staging environments, but the
script doesnt hurt to be installed in prod. It doesn't elevate
permissions or expose any sensitive details - you need to run as root in
order to gain useful data.

Logic to dump app tor onion data to func config

This commit adds logic to the test runner so that a functional test json
config gets dumped for usage in the tbb selenium test tools against
staging.

Wire-up current app-test role to our upgrade scenario

Without this change, the upgrade scenario would utilize the app-test
logic from the old repo. Which is not what we want. This is of course
kind of "hacky". I welcome the opportunity to improve this with feedback
:)

Move tor fact logic from tor role --> app-test role

I'm not sure we are ready to shove this on prod instances AND I was
running into weird old/new role logic under the molecule scenario.
Ideally the fact should be in both roles but I dunno.. this seemed like
an easier short-term fix.

ansible spacing' and tag nits

Testinfra: Update test dependencies for app-staging

In freedomofpress#3697, we removed the application testing pip dependencies.
This commit updates the testinfra test variables accordingly.

Fix linting failures

One of these was introduced in freedomofpress#3672, but not discovered due to
other CI failures (e.g. python not found when running the lint job)

Use absolute pathing in i18n testing

I'm hoping this shakes out some really weird test failures we were
seeing only under CircleCI only under the functional testing branch at a
certain point in time. Really wild behavior. *fingers crossed*

Set selenium webdriver test output to WARNING

Originally was on DEBUG and was sending out mountains of output into the
pytest process which made it difficult to assess anything.

(cherry picked from commit a1f0134)

removed duplicate entry in test requirements

Dockerfile: Update Tor Browser to 8.0

Docker development environment: Update Tor signing key

Dockerfile: Update geckodriver and firefox-esr

Swap x11vnc with tightvncserver

Basically installed this because it can be used with pyvirtualdisplay as
a backend AND because it brings in the Xvnc tooling which will start an
X11 server as well as a VNC server.

Wire-up VNC server and helper command for func tests

Had to remove x11 display logic inside test scaffolding (initially tried
to integrate it there but it kept building and destroying the VNC server
per test).

Made a VNC helper command with support for GNOME desktop and macOS (havent
tested it on mac yet). Updated the docs

Bump functional test sleep time

10 seconds is way too short.. 160 seconds.. maybe too long? Fingers
crossed I can work with the team to get the wait_for logic running

Add functionality to prepare boxes for functional testing

Typically these actions were done manually but lets get our good old
friend ansible to run them for us (at least under the upgrade env).

Added auth to VNC in test container, for OS X compatibility.

Bump TBB/ESR to 8.0.1 and 60.2.0esr combo

https://blog.torproject.org/new-release-tor-browser-801

Updated geckodriver to 0.22.0

added ini file to get around remote-viewer password prompt

Functional tests: xfail test_warning_appears_if_tor_browser_not_in_use

Due to defect freedomofpress#3793, when using Firefox Quantum, the incorrect message
is displayed on the source interface. This test will not pass until that
is resolved.

Functional tests: Fix firefox path

Testinfra: Fix test failure due to non-DRY variables files

staging.yml is a concatenation of multiple other variables files,
one was updated during rebase, one was not.

Testinfra: Update Flask version to 1.0.2

fixed VNC port being defined twice when running 'make dev'

Tests: Modify viewport size for parity between dev and CI env

In CI we are getting MoveTargetOutOfBoundsException, but not locally.
We have had errors in the past due to different viewport sizes in CI
and locally, so setting this to a standard size for the pages layout
tests (where the exception is occurring).

Functional tests: Resolve NoAlertPresentException

We were getting a NoAlertPresentException due to new behavior in
geckodriver [0] where interacting with the driver closes the modal.
Thus, we do not need to explicitly accept the modal here.

[0] mozilla/geckodriver#1171

Replaced parameterized time.sleep()s with self.waitfor()s

Stability fixes layout tests, added new functests from develop, updated TBB

fixed flaky page layout tests that were broken by long fr_FR strings causing UI elements to wrap.

fixed flake8, added explicit scroll to elements before click, stability fixes

Dockerfile: get key from Mozilla keyserver

For whatever reason, this Firefox signing key was not available on
the keyserver in the prior diff, but was available on Mozilla's
keyserver.

deps: Update requests due to CVE-2018-18074

functional tests: Add wait_for prior to clicking submit

functional tests: Remove sleeps and reduce flakiness around modal

functional tests: Remove sleeps around js alerts

functional tests: use sleep_time as default timeout

functional tests: Remove remainder of time.sleeps in source steps

Don't clobber existing custom logo

Minimal changes to remove external server testing functionality

Merge from develop
rmol pushed a commit to rmol/securedrop that referenced this issue May 10, 2019
stupid utility to create an test admin user fast

Working tbselineum tests for most part.

fixes two typos in readme of tor based tests

Fixes directory path in README

Hardcoded onion addresse work

Test for tor broser asking high security in slider

Reads instance information from a json file

Uses clean variable name

Configure the sleep amount between clicks

Just tests admin/journalist login and cookies

Tests working once again.

Use firefox to login for downloads in selenium tests

Updates README

Matches with 0.6-rc2 functional tests

We are using TBB 7.5

We need more time and click to test logout

Fixes the assert statement

Updates based on current upstream

TB functional tests: Gitignore instance config

This prevents the accidental commit of private information.

TB functional tests: Merge tbselenium dir

Updates the ansible files for tbb

Updates to the Dockerfile for tbb

Updates as suggested in the PR review for ansible and dockerfile

Missing tor key

Removes duplicated 'when' line from app-test logic

The 'when' conditional detecting a grsec kernel, used for running the
paxctl commands on the TBB binary, was needlessly duplicated on the
relevant task. Fortunately that didn't cause breakage, because the
'when' lines were identical, but only one was active.

Updates functional test container image

Now installs Firefox 52 ESR, rather than Firefox 46, for use inside the
test container.

Includes changes to run-test shell script:

    TOR_FORCE_NET_CONFIG=0 is required to directly connect to Tor
    network, otherwise it will wait for userinput to either connect
    or to configure

    The `run_xvfb` invocation is no longer necessary, since the test suite
    code bootstraps the headless server now.

Creates local test server inside the container

Bootstrapping the application services within the functional test suite.
Includes some cleanup, culling unused debugging code, and also cleans up
the various print statements.

Ignore functional test firefox logs (thanks, @msheiny!)

Adds retries for tor network connection failure, using the pre-existing
logic.

Uses nc rather than torsocks in functional tests

The version of torsocks in the Trusty repos isn't recent enough to
support custom ports. Rather than install from other sources, which
requires manual package verification (or configuring non-trusty repos,
which could break other packages), let's fall back to good ol' nc.

Creates proper orbot specific project to test

We need to create a new firefox profile to test the orbot specific
warning. This works for both locally and over Tor.

Updates test_make_account_changes for Tor

Now we can safely execute the account changes in the tests running
on the Tor browser. The logic update makes sure to create different
user for this test than any other test.

Reduces sleep durations in functional tests

We don't have to sleep for too long if we are running against
local instance. The ultimate goal remains to remove hardcoded sleeps
altogether, but we'll circle back and eliminate those calls once the
test suite is passing reliably.

Increases CircleCI timeout to 20m

The functional tests can take a long time, so let's instruct CircleCI to
continue waiting, to give the test suite a chance to finish
successfully.

Updates README for the functional tests

Mostly correcting a typo in the `instance_information.json` config
filename, but also updated some of the example commands. The notes
regarding potentially failing tests also seemed out of date, as several
members of the team have confirmed working functional tests under the
new TB Selenium logic recently.

Removes temporary testing related directories

We need to clean up any temporary test directory before running
any test, as the previous can create a bad state in the database.
For example, one of our pages-layout test adds 123456 as hotp value
to the test account, and it will never be able to login again.

Adds missing steps for pages-layout tests over tor

We can now generate thousands of random journalist names using
the generator. Only the first 3 names are used in the functional
tests, the rest are being used in the pages-layout.

We also added back _source_delete_key function for one the test.
Rest of the updates are to add sleep function calls or to have
better error message.

Adds comment about the user generator and lint fixes

We have get_journalist_usernames generator which can generate
unlimited number of users for many tests.

Moves around all driver creation functions into one place

We now have the functional/functional_test.py to handle all
driver creation logic. For the pages-layout tests, we are creating
only a Firefox driver to connect to the local container itself.

This logic does not work against any external server as of now.

Updates test user creation logic inside of container

Removing old method calls from user creation logic, this is only
used inside of the container for the functional testing.

Downloads data from server using requests over Tor

The test requirements now have requests[socks] as dependency.
Using the same we are now directly downloading the files/messages
from the .onion address for functional tests.

The old external command file also got removed this committ.

We are creating the gpg object for both container based local
testing and external testing (in functional tests).
Fixes: freedomofpress#3691 freedomofpress#3687

Removed xvfb, tor browser, and firefox installs from app-staging - functional tests now run remotely

fix to pass make ci-lint

Cleans up flake8 errors in functional tests

Resolves some lingering flake8 formatting violations that were causing
lint checks to fail. These changes are unrelated to the current PR, but
better late than never.

Written by @msheiny, committed by @conorsch during branch collab.

Signed-off-by: Conor Schaefer <conor@freedom.press>

Adds --staging flag create-dev-data.py for tests

We now have --staging flag to the create-dev-data.py script so
that we can easily create an user in the staging or prodcution test
and then use the functional tests to test the instance.

Add fact gatherer for extracting tor app onion details

This is really for functional testing in staging environments, but the
script doesnt hurt to be installed in prod. It doesn't elevate
permissions or expose any sensitive details - you need to run as root in
order to gain useful data.

Logic to dump app tor onion data to func config

This commit adds logic to the test runner so that a functional test json
config gets dumped for usage in the tbb selenium test tools against
staging.

Wire-up current app-test role to our upgrade scenario

Without this change, the upgrade scenario would utilize the app-test
logic from the old repo. Which is not what we want. This is of course
kind of "hacky". I welcome the opportunity to improve this with feedback
:)

Move tor fact logic from tor role --> app-test role

I'm not sure we are ready to shove this on prod instances AND I was
running into weird old/new role logic under the molecule scenario.
Ideally the fact should be in both roles but I dunno.. this seemed like
an easier short-term fix.

ansible spacing' and tag nits

Testinfra: Update test dependencies for app-staging

In freedomofpress#3697, we removed the application testing pip dependencies.
This commit updates the testinfra test variables accordingly.

Fix linting failures

One of these was introduced in freedomofpress#3672, but not discovered due to
other CI failures (e.g. python not found when running the lint job)

Use absolute pathing in i18n testing

I'm hoping this shakes out some really weird test failures we were
seeing only under CircleCI only under the functional testing branch at a
certain point in time. Really wild behavior. *fingers crossed*

Set selenium webdriver test output to WARNING

Originally was on DEBUG and was sending out mountains of output into the
pytest process which made it difficult to assess anything.

(cherry picked from commit a1f0134)

removed duplicate entry in test requirements

Dockerfile: Update Tor Browser to 8.0

Docker development environment: Update Tor signing key

Dockerfile: Update geckodriver and firefox-esr

Swap x11vnc with tightvncserver

Basically installed this because it can be used with pyvirtualdisplay as
a backend AND because it brings in the Xvnc tooling which will start an
X11 server as well as a VNC server.

Wire-up VNC server and helper command for func tests

Had to remove x11 display logic inside test scaffolding (initially tried
to integrate it there but it kept building and destroying the VNC server
per test).

Made a VNC helper command with support for GNOME desktop and macOS (havent
tested it on mac yet). Updated the docs

Bump functional test sleep time

10 seconds is way too short.. 160 seconds.. maybe too long? Fingers
crossed I can work with the team to get the wait_for logic running

Add functionality to prepare boxes for functional testing

Typically these actions were done manually but lets get our good old
friend ansible to run them for us (at least under the upgrade env).

Added auth to VNC in test container, for OS X compatibility.

Bump TBB/ESR to 8.0.1 and 60.2.0esr combo

https://blog.torproject.org/new-release-tor-browser-801

Updated geckodriver to 0.22.0

added ini file to get around remote-viewer password prompt

Functional tests: xfail test_warning_appears_if_tor_browser_not_in_use

Due to defect freedomofpress#3793, when using Firefox Quantum, the incorrect message
is displayed on the source interface. This test will not pass until that
is resolved.

Functional tests: Fix firefox path

Testinfra: Fix test failure due to non-DRY variables files

staging.yml is a concatenation of multiple other variables files,
one was updated during rebase, one was not.

Testinfra: Update Flask version to 1.0.2

fixed VNC port being defined twice when running 'make dev'

Tests: Modify viewport size for parity between dev and CI env

In CI we are getting MoveTargetOutOfBoundsException, but not locally.
We have had errors in the past due to different viewport sizes in CI
and locally, so setting this to a standard size for the pages layout
tests (where the exception is occurring).

Functional tests: Resolve NoAlertPresentException

We were getting a NoAlertPresentException due to new behavior in
geckodriver [0] where interacting with the driver closes the modal.
Thus, we do not need to explicitly accept the modal here.

[0] mozilla/geckodriver#1171

Replaced parameterized time.sleep()s with self.waitfor()s

Stability fixes layout tests, added new functests from develop, updated TBB

fixed flaky page layout tests that were broken by long fr_FR strings causing UI elements to wrap.

fixed flake8, added explicit scroll to elements before click, stability fixes

Dockerfile: get key from Mozilla keyserver

For whatever reason, this Firefox signing key was not available on
the keyserver in the prior diff, but was available on Mozilla's
keyserver.

deps: Update requests due to CVE-2018-18074

functional tests: Add wait_for prior to clicking submit

functional tests: Remove sleeps and reduce flakiness around modal

functional tests: Remove sleeps around js alerts

functional tests: use sleep_time as default timeout

functional tests: Remove remainder of time.sleeps in source steps

Don't clobber existing custom logo

Minimal changes to remove external server testing functionality

Merge from develop
redshiftzero pushed a commit to rmol/securedrop that referenced this issue May 11, 2019
stupid utility to create an test admin user fast

Working tbselineum tests for most part.

fixes two typos in readme of tor based tests

Fixes directory path in README

Hardcoded onion addresse work

Test for tor broser asking high security in slider

Reads instance information from a json file

Uses clean variable name

Configure the sleep amount between clicks

Just tests admin/journalist login and cookies

Tests working once again.

Use firefox to login for downloads in selenium tests

Updates README

Matches with 0.6-rc2 functional tests

We are using TBB 7.5

We need more time and click to test logout

Fixes the assert statement

Updates based on current upstream

TB functional tests: Gitignore instance config

This prevents the accidental commit of private information.

TB functional tests: Merge tbselenium dir

Updates the ansible files for tbb

Updates to the Dockerfile for tbb

Updates as suggested in the PR review for ansible and dockerfile

Missing tor key

Removes duplicated 'when' line from app-test logic

The 'when' conditional detecting a grsec kernel, used for running the
paxctl commands on the TBB binary, was needlessly duplicated on the
relevant task. Fortunately that didn't cause breakage, because the
'when' lines were identical, but only one was active.

Updates functional test container image

Now installs Firefox 52 ESR, rather than Firefox 46, for use inside the
test container.

Includes changes to run-test shell script:

    TOR_FORCE_NET_CONFIG=0 is required to directly connect to Tor
    network, otherwise it will wait for userinput to either connect
    or to configure

    The `run_xvfb` invocation is no longer necessary, since the test suite
    code bootstraps the headless server now.

Creates local test server inside the container

Bootstrapping the application services within the functional test suite.
Includes some cleanup, culling unused debugging code, and also cleans up
the various print statements.

Ignore functional test firefox logs (thanks, @msheiny!)

Adds retries for tor network connection failure, using the pre-existing
logic.

Uses nc rather than torsocks in functional tests

The version of torsocks in the Trusty repos isn't recent enough to
support custom ports. Rather than install from other sources, which
requires manual package verification (or configuring non-trusty repos,
which could break other packages), let's fall back to good ol' nc.

Creates proper orbot specific project to test

We need to create a new firefox profile to test the orbot specific
warning. This works for both locally and over Tor.

Updates test_make_account_changes for Tor

Now we can safely execute the account changes in the tests running
on the Tor browser. The logic update makes sure to create different
user for this test than any other test.

Reduces sleep durations in functional tests

We don't have to sleep for too long if we are running against
local instance. The ultimate goal remains to remove hardcoded sleeps
altogether, but we'll circle back and eliminate those calls once the
test suite is passing reliably.

Increases CircleCI timeout to 20m

The functional tests can take a long time, so let's instruct CircleCI to
continue waiting, to give the test suite a chance to finish
successfully.

Updates README for the functional tests

Mostly correcting a typo in the `instance_information.json` config
filename, but also updated some of the example commands. The notes
regarding potentially failing tests also seemed out of date, as several
members of the team have confirmed working functional tests under the
new TB Selenium logic recently.

Removes temporary testing related directories

We need to clean up any temporary test directory before running
any test, as the previous can create a bad state in the database.
For example, one of our pages-layout test adds 123456 as hotp value
to the test account, and it will never be able to login again.

Adds missing steps for pages-layout tests over tor

We can now generate thousands of random journalist names using
the generator. Only the first 3 names are used in the functional
tests, the rest are being used in the pages-layout.

We also added back _source_delete_key function for one the test.
Rest of the updates are to add sleep function calls or to have
better error message.

Adds comment about the user generator and lint fixes

We have get_journalist_usernames generator which can generate
unlimited number of users for many tests.

Moves around all driver creation functions into one place

We now have the functional/functional_test.py to handle all
driver creation logic. For the pages-layout tests, we are creating
only a Firefox driver to connect to the local container itself.

This logic does not work against any external server as of now.

Updates test user creation logic inside of container

Removing old method calls from user creation logic, this is only
used inside of the container for the functional testing.

Downloads data from server using requests over Tor

The test requirements now have requests[socks] as dependency.
Using the same we are now directly downloading the files/messages
from the .onion address for functional tests.

The old external command file also got removed this committ.

We are creating the gpg object for both container based local
testing and external testing (in functional tests).
Fixes: freedomofpress#3691 freedomofpress#3687

Removed xvfb, tor browser, and firefox installs from app-staging - functional tests now run remotely

fix to pass make ci-lint

Cleans up flake8 errors in functional tests

Resolves some lingering flake8 formatting violations that were causing
lint checks to fail. These changes are unrelated to the current PR, but
better late than never.

Written by @msheiny, committed by @conorsch during branch collab.

Signed-off-by: Conor Schaefer <conor@freedom.press>

Adds --staging flag create-dev-data.py for tests

We now have --staging flag to the create-dev-data.py script so
that we can easily create an user in the staging or prodcution test
and then use the functional tests to test the instance.

Add fact gatherer for extracting tor app onion details

This is really for functional testing in staging environments, but the
script doesnt hurt to be installed in prod. It doesn't elevate
permissions or expose any sensitive details - you need to run as root in
order to gain useful data.

Logic to dump app tor onion data to func config

This commit adds logic to the test runner so that a functional test json
config gets dumped for usage in the tbb selenium test tools against
staging.

Wire-up current app-test role to our upgrade scenario

Without this change, the upgrade scenario would utilize the app-test
logic from the old repo. Which is not what we want. This is of course
kind of "hacky". I welcome the opportunity to improve this with feedback
:)

Move tor fact logic from tor role --> app-test role

I'm not sure we are ready to shove this on prod instances AND I was
running into weird old/new role logic under the molecule scenario.
Ideally the fact should be in both roles but I dunno.. this seemed like
an easier short-term fix.

ansible spacing' and tag nits

Testinfra: Update test dependencies for app-staging

In freedomofpress#3697, we removed the application testing pip dependencies.
This commit updates the testinfra test variables accordingly.

Fix linting failures

One of these was introduced in freedomofpress#3672, but not discovered due to
other CI failures (e.g. python not found when running the lint job)

Use absolute pathing in i18n testing

I'm hoping this shakes out some really weird test failures we were
seeing only under CircleCI only under the functional testing branch at a
certain point in time. Really wild behavior. *fingers crossed*

Set selenium webdriver test output to WARNING

Originally was on DEBUG and was sending out mountains of output into the
pytest process which made it difficult to assess anything.

(cherry picked from commit a1f0134)

removed duplicate entry in test requirements

Dockerfile: Update Tor Browser to 8.0

Docker development environment: Update Tor signing key

Dockerfile: Update geckodriver and firefox-esr

Swap x11vnc with tightvncserver

Basically installed this because it can be used with pyvirtualdisplay as
a backend AND because it brings in the Xvnc tooling which will start an
X11 server as well as a VNC server.

Wire-up VNC server and helper command for func tests

Had to remove x11 display logic inside test scaffolding (initially tried
to integrate it there but it kept building and destroying the VNC server
per test).

Made a VNC helper command with support for GNOME desktop and macOS (havent
tested it on mac yet). Updated the docs

Bump functional test sleep time

10 seconds is way too short.. 160 seconds.. maybe too long? Fingers
crossed I can work with the team to get the wait_for logic running

Add functionality to prepare boxes for functional testing

Typically these actions were done manually but lets get our good old
friend ansible to run them for us (at least under the upgrade env).

Added auth to VNC in test container, for OS X compatibility.

Bump TBB/ESR to 8.0.1 and 60.2.0esr combo

https://blog.torproject.org/new-release-tor-browser-801

Updated geckodriver to 0.22.0

added ini file to get around remote-viewer password prompt

Functional tests: xfail test_warning_appears_if_tor_browser_not_in_use

Due to defect freedomofpress#3793, when using Firefox Quantum, the incorrect message
is displayed on the source interface. This test will not pass until that
is resolved.

Functional tests: Fix firefox path

Testinfra: Fix test failure due to non-DRY variables files

staging.yml is a concatenation of multiple other variables files,
one was updated during rebase, one was not.

Testinfra: Update Flask version to 1.0.2

fixed VNC port being defined twice when running 'make dev'

Tests: Modify viewport size for parity between dev and CI env

In CI we are getting MoveTargetOutOfBoundsException, but not locally.
We have had errors in the past due to different viewport sizes in CI
and locally, so setting this to a standard size for the pages layout
tests (where the exception is occurring).

Functional tests: Resolve NoAlertPresentException

We were getting a NoAlertPresentException due to new behavior in
geckodriver [0] where interacting with the driver closes the modal.
Thus, we do not need to explicitly accept the modal here.

[0] mozilla/geckodriver#1171

Replaced parameterized time.sleep()s with self.waitfor()s

Stability fixes layout tests, added new functests from develop, updated TBB

fixed flaky page layout tests that were broken by long fr_FR strings causing UI elements to wrap.

fixed flake8, added explicit scroll to elements before click, stability fixes

Dockerfile: get key from Mozilla keyserver

For whatever reason, this Firefox signing key was not available on
the keyserver in the prior diff, but was available on Mozilla's
keyserver.

deps: Update requests due to CVE-2018-18074

functional tests: Add wait_for prior to clicking submit

functional tests: Remove sleeps and reduce flakiness around modal

functional tests: Remove sleeps around js alerts

functional tests: use sleep_time as default timeout

functional tests: Remove remainder of time.sleeps in source steps

Don't clobber existing custom logo

Minimal changes to remove external server testing functionality
@lock
Copy link

lock bot commented Aug 16, 2019

This issue has been automatically locked since there has not been any recent activity after it was closed. If you have run into an issue you think is related, please open a new issue.

@lock lock bot locked and limited conversation to collaborators Aug 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants