From 59ca811755f56df329b5dbb73fc5c452fb94821c Mon Sep 17 00:00:00 2001 From: Damien Lespiau Date: Tue, 8 Sep 2015 19:00:11 +0100 Subject: tests: Add a couple of Selenium tests While developing the new series UI, several bug crept in but weren't discovered until later. All because we don't have in-browser tests to go along the lower level tests we already have. In particular, behaviours that need javascript to run cannot be tested outside of a full environment with the pages being served to an actual browser. This commit introduces selenium to the test suite and starts with 2 simple tests to give a taste of what it looks like. test_default_focus: make sure we do focus the username field on the login page test_login: shows how to chain actions to test the full login phase. This is quite similar the lower level test, except it also checks we display the username once logged in. v2: Use LiveServerTestCase for django pre-1.7 v3: Propagate the DISPLAY environment variable to have an X display specified for the browser v4: Log execution of the chrome driver, useful for debugging v5: Rebase on top of upstream v6: Pass environmental variables to tox and ensure PEP8 compliance Signed-off-by: Damien Lespiau Signed-off-by: Stephen Finucane --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) (limited to '.gitignore') diff --git a/.gitignore b/.gitignore index b718f0a..94481ad 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,7 @@ cscope.* *.orig *.rej + +# test artifacts +/selenium.log +/selenium_screenshots -- cgit v1.2.3