Don't merge -- minimal test to verify selenium!

Change-Id: I3f4b6f962d5ace3717f2ec213e39fcd9ca29eaf6
This commit is contained in:
Pete Vander Giessen 2019-09-13 20:48:58 +00:00
parent df629589c3
commit 292318c445
3 changed files with 8 additions and 20 deletions

View File

@ -33,15 +33,8 @@ class TestHorizonlogin(unittest.TestCase):
self.display.stop()
def test_horizonlogin(self):
self.driver.get("http://10.20.20.1/")
# Login to horizon!
self.driver.find_element(By.ID, "id_username").click()
self.driver.find_element(By.ID, "id_username").send_keys("admin")
self.driver.find_element(By.ID, "id_password").send_keys("keystone")
self.driver.find_element(By.CSS_SELECTOR, "#loginBtn > span").click()
# Verify that we can click something on the dashboard -- e.g.,
# we're still not sitting at the login screen.
self.driver.find_element(By.LINK_TEXT, "Images").click()
self.driver.get("http://petevg.com/")
self.driver.find_element(By.ID, "post-17").click()
if __name__ == '__main__':
# Run our tests, ignorning deprecation warnings and warnings about

View File

@ -5,13 +5,7 @@ set -ex
export PATH=/snap/bin:$PATH
sudo apt update
sudo apt install -y snapd
# Also install the X virtual framebuffer, which is required for
# selenium tests of the horizon dashboard.
sudo apt install -y xvfb
sudo snap install --classic snapcraft
sudo snap install --classic lxd
sudo lxd init --auto
sudo snapcraft --use-lxd

11
tox.ini
View File

@ -7,19 +7,20 @@ basepython=python3
install_command = pip install {opts} {packages}
setenv =
PATH = /snap/bin:{env:PATH}
passenv = HOME TERM DISPLAY
passenv = HOME TERM
whitelist_externals =
sudo
/snap/bin/snapcraft
[testenv:snap]
# Testing environment for the gerrit gate. Named 'snap' to conform to
# the requirements of the snap friendly job that we inherit from in
# .zuul.yaml.
# Run browser tests. Assumes that you have the snap installed and
# initialized locally, and a valid DISPLAY (install xvfb for a virtual
# one).
# TODO: figure out how to integrate this w/ multipass. (e.g. setup
# port forwarding and call into the mulitpass machine.)
deps = -r{toxinidir}/test-requirements.txt
commands =
{toxinidir}/tools/lxd_build.sh
{toxinidir}/tests/basic-test.sh
{toxinidir}/tests/test_horizonlogin.py
[testenv:multipass]