From 080678a6e88ce8dd74ff52c7d7ab44dcea8d3192 Mon Sep 17 00:00:00 2001 From: Stefano Borini Date: Thu, 25 Aug 2016 11:17:59 +0100 Subject: [PATCH 01/17] Shortening roundtrip --- .travis.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index f1133637d..f421702d0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,8 +17,8 @@ install: - make install script: - - make test - - make docs +# - make test +# - make docs - make testimages - make testdb - make certs @@ -33,7 +33,7 @@ script: - DISPLAY=:99 python -m unittest discover -s selenium_tests -t . -v after_success: - - coverage run -m tornado.testing discover - - pip install codecov - - codecov - - bash <(curl -s https://codecov.io/bash) +# - coverage run -m tornado.testing discover +# - pip install codecov +# - codecov +# - bash <(curl -s https://codecov.io/bash) From e05f0ccfcf4d22dcfe9929b389b6e78b3f83a14a Mon Sep 17 00:00:00 2001 From: Stefano Borini Date: Thu, 25 Aug 2016 12:49:18 +0100 Subject: [PATCH 02/17] Fixed firefox version to 41 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f421702d0..aea06f709 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ python: sudo: required dist: trusty addons: - firefox: "latest" + firefox: "41.0" before_install: - firefox --version From 032a481df4d220f7ff874335b5b2b9c6949993d5 Mon Sep 17 00:00:00 2001 From: Stefano Borini Date: Thu, 25 Aug 2016 14:32:28 +0100 Subject: [PATCH 03/17] Fixed version of selenium to prevent 3.0 to sneak in when released --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index be20f8a90..c16dcc02a 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,3 +1,3 @@ flake8 coverage -selenium +selenium==2.53.6 From 4c5bbf0415cfd791ef633d7f0431ac982d09c9d9 Mon Sep 17 00:00:00 2001 From: Stefano Borini Date: Thu, 25 Aug 2016 14:48:02 +0100 Subject: [PATCH 04/17] Decommented python tests --- .travis.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index aea06f709..06b6dc1cc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,8 +17,8 @@ install: - make install script: -# - make test -# - make docs + - make test + - make docs - make testimages - make testdb - make certs @@ -33,7 +33,7 @@ script: - DISPLAY=:99 python -m unittest discover -s selenium_tests -t . -v after_success: -# - coverage run -m tornado.testing discover -# - pip install codecov -# - codecov -# - bash <(curl -s https://codecov.io/bash) + - coverage run -m tornado.testing discover + - pip install codecov + - codecov + - bash <(curl -s https://codecov.io/bash) From 498f8b0107debb56e48bb79350bdc4d78cd5461d Mon Sep 17 00:00:00 2001 From: Stefano Borini Date: Thu, 25 Aug 2016 15:15:14 +0100 Subject: [PATCH 05/17] Trying to see what's going on by saving screenshots --- .travis.yml | 2 ++ selenium_tests/test_start_stop_container.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index 06b6dc1cc..fd05c21dc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,6 +31,8 @@ script: - popd - sleep 3 - DISPLAY=:99 python -m unittest discover -s selenium_tests -t . -v + - curl --upload-file screenshot1.png https://transfer.sh/screenshot1.png + - curl --upload-file screenshot2.png https://transfer.sh/screenshot2.png after_success: - coverage run -m tornado.testing discover diff --git a/selenium_tests/test_start_stop_container.py b/selenium_tests/test_start_stop_container.py index a4f4a7c30..e43cd99ba 100644 --- a/selenium_tests/test_start_stop_container.py +++ b/selenium_tests/test_start_stop_container.py @@ -24,7 +24,10 @@ def test_start_stop_container(self): time.sleep(1) else: self.fail("time out") + driver.save_screenshot('screenshot1.png') driver.find_element_by_link_text("Close").click() + time.sleep(1) + driver.save_screenshot('screenshot2.png') driver.find_element_by_name("action").click() self.wait_for(lambda: "noVNC" == driver.title) driver.find_element_by_xpath("//i").click() From 40b82549146c2b5172af799ba5e1eae958a83f8b Mon Sep 17 00:00:00 2001 From: Stefano Borini Date: Thu, 25 Aug 2016 15:26:29 +0100 Subject: [PATCH 06/17] Printing screen title --- selenium_tests/test_start_stop_container.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/selenium_tests/test_start_stop_container.py b/selenium_tests/test_start_stop_container.py index e43cd99ba..c8dc201be 100644 --- a/selenium_tests/test_start_stop_container.py +++ b/selenium_tests/test_start_stop_container.py @@ -24,10 +24,10 @@ def test_start_stop_container(self): time.sleep(1) else: self.fail("time out") - driver.save_screenshot('screenshot1.png') driver.find_element_by_link_text("Close").click() - time.sleep(1) - driver.save_screenshot('screenshot2.png') + for i in range(60): + print(driver.title) + time.sleep(1) driver.find_element_by_name("action").click() self.wait_for(lambda: "noVNC" == driver.title) driver.find_element_by_xpath("//i").click() From 0a23d24ca8a3384e127c21b7c8ab50e85a9352ee Mon Sep 17 00:00:00 2001 From: Stefano Borini Date: Thu, 25 Aug 2016 15:54:59 +0100 Subject: [PATCH 07/17] Trying again with firefox 43 --- .travis.yml | 2 +- selenium_tests/test_start_stop_container.py | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index fd05c21dc..70046b165 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ python: sudo: required dist: trusty addons: - firefox: "41.0" + firefox: "43.0" before_install: - firefox --version diff --git a/selenium_tests/test_start_stop_container.py b/selenium_tests/test_start_stop_container.py index c8dc201be..a4f4a7c30 100644 --- a/selenium_tests/test_start_stop_container.py +++ b/selenium_tests/test_start_stop_container.py @@ -25,9 +25,6 @@ def test_start_stop_container(self): else: self.fail("time out") driver.find_element_by_link_text("Close").click() - for i in range(60): - print(driver.title) - time.sleep(1) driver.find_element_by_name("action").click() self.wait_for(lambda: "noVNC" == driver.title) driver.find_element_by_xpath("//i").click() From 3a5e0352cead62fdd1be22ea3668f018e2e2ffdc Mon Sep 17 00:00:00 2001 From: Stefano Borini Date: Thu, 25 Aug 2016 15:58:12 +0100 Subject: [PATCH 08/17] submitting again with 45.0 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 70046b165..4ba1edfbb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ python: sudo: required dist: trusty addons: - firefox: "43.0" + firefox: "45.0" before_install: - firefox --version From 15b735d4d00095a5dde4c957e0a39a356ce8efeb Mon Sep 17 00:00:00 2001 From: Stefano Borini Date: Thu, 25 Aug 2016 16:19:40 +0100 Subject: [PATCH 09/17] Changing test to see if we can get the button through another selector --- .travis.yml | 2 -- selenium_tests/test_start_stop_container.py | 14 +++----------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4ba1edfbb..062ac4269 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,8 +31,6 @@ script: - popd - sleep 3 - DISPLAY=:99 python -m unittest discover -s selenium_tests -t . -v - - curl --upload-file screenshot1.png https://transfer.sh/screenshot1.png - - curl --upload-file screenshot2.png https://transfer.sh/screenshot2.png after_success: - coverage run -m tornado.testing discover diff --git a/selenium_tests/test_start_stop_container.py b/selenium_tests/test_start_stop_container.py index a4f4a7c30..f0c1d4868 100644 --- a/selenium_tests/test_start_stop_container.py +++ b/selenium_tests/test_start_stop_container.py @@ -15,19 +15,11 @@ def test_start_stop_container(self): driver.find_element_by_id("password_input").send_keys("test") driver.find_element_by_id("login_submit").click() driver.find_element_by_name("action").click() - for i in range(60): - try: - if "noVNC" == driver.title: - break - except: - pass - time.sleep(1) - else: - self.fail("time out") - driver.find_element_by_link_text("Close").click() - driver.find_element_by_name("action").click() self.wait_for(lambda: "noVNC" == driver.title) driver.find_element_by_xpath("//i").click() + self.wait_for(lambda: "noVNC" != driver.title) + driver.find_element_by_name("action").click() + driver.find_element_by_xpath("//i").click() driver.find_element_by_xpath("(//button[@name='action'])[2]").click() self.wait_for( lambda: "Start" == driver.find_element_by_name("action").text) From 57e64c9202593d42dafb67cad6939ae3d413c955 Mon Sep 17 00:00:00 2001 From: Stefano Borini Date: Thu, 25 Aug 2016 18:01:04 +0100 Subject: [PATCH 10/17] Recording --- .travis.yml | 3 +++ Makefile | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 062ac4269..2d395aac1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,8 +29,11 @@ script: - chmod 755 `pwd`/start.sh - "`pwd`/start.sh &" - popd + - "ffmpeg -f x11grab -video_size 1280x1024 -i :99 -codec:v libx264 -r 12 -t 60 video.mp4 &" - sleep 3 - DISPLAY=:99 python -m unittest discover -s selenium_tests -t . -v + - sleep 60 + - curl --upload-file video.mp4 https://transfer.sh/video.mp4 after_success: - coverage run -m tornado.testing discover diff --git a/Makefile b/Makefile index a82686f79..8b7f7c70a 100644 --- a/Makefile +++ b/Makefile @@ -21,8 +21,9 @@ venv: aptdeps: @echo "Installing apt dependencies" @echo "---------------------------" - apt-get update - apt-get install -o Dpkg::Options::="--force-confold" --force-yes -y docker-engine npm nodejs-legacy python3-pip python3.4-venv + sudo add-apt-repository ppa:mc3man/trusty-media + -apt-get update + apt-get install -o Dpkg::Options::="--force-confold" --force-yes -y docker-engine npm nodejs-legacy python3-pip python3.4-venv ffmpeg pip install --upgrade pip npm install -g configurable-http-proxy From 88c314d76254f2732c45f05a7ffcb5414d4e7e88 Mon Sep 17 00:00:00 2001 From: Stefano Borini Date: Thu, 25 Aug 2016 18:06:18 +0100 Subject: [PATCH 11/17] Added yes flag to add repository --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8b7f7c70a..e7c7f2204 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ venv: aptdeps: @echo "Installing apt dependencies" @echo "---------------------------" - sudo add-apt-repository ppa:mc3man/trusty-media + sudo add-apt-repository -y ppa:mc3man/trusty-media -apt-get update apt-get install -o Dpkg::Options::="--force-confold" --force-yes -y docker-engine npm nodejs-legacy python3-pip python3.4-venv ffmpeg pip install --upgrade pip From ac9af6462dfbfb4d810ab5822d29e4dd03d61956 Mon Sep 17 00:00:00 2001 From: Stefano Borini Date: Thu, 25 Aug 2016 19:15:43 +0100 Subject: [PATCH 12/17] force clicking again and again --- .travis.yml | 6 +++--- selenium_tests/test_start_stop_container.py | 11 +++++++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2d395aac1..fc44cdad5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,11 +29,11 @@ script: - chmod 755 `pwd`/start.sh - "`pwd`/start.sh &" - popd - - "ffmpeg -f x11grab -video_size 1280x1024 -i :99 -codec:v libx264 -r 12 -t 60 video.mp4 &" +# - "ffmpeg -f x11grab -video_size 1280x1024 -i :99 -codec:v libx264 -r 12 -t 60 video.mp4 &" - sleep 3 - DISPLAY=:99 python -m unittest discover -s selenium_tests -t . -v - - sleep 60 - - curl --upload-file video.mp4 https://transfer.sh/video.mp4 +# - sleep 60 +# - curl --upload-file video.mp4 https://transfer.sh/video.mp4 after_success: - coverage run -m tornado.testing discover diff --git a/selenium_tests/test_start_stop_container.py b/selenium_tests/test_start_stop_container.py index f0c1d4868..19ca4777c 100644 --- a/selenium_tests/test_start_stop_container.py +++ b/selenium_tests/test_start_stop_container.py @@ -16,8 +16,15 @@ def test_start_stop_container(self): driver.find_element_by_id("login_submit").click() driver.find_element_by_name("action").click() self.wait_for(lambda: "noVNC" == driver.title) - driver.find_element_by_xpath("//i").click() - self.wait_for(lambda: "noVNC" != driver.title) + for i in range(timeout): + try: + if "noVNC" != driver.title: + break + driver.find_element_by_xpath("//i").click() + except: + pass + time.sleep(1) + driver.find_element_by_name("action").click() driver.find_element_by_xpath("//i").click() driver.find_element_by_xpath("(//button[@name='action'])[2]").click() From cb50ee697914bb93851724b87a219f8800eb1df0 Mon Sep 17 00:00:00 2001 From: Stefano Borini Date: Thu, 25 Aug 2016 19:24:26 +0100 Subject: [PATCH 13/17] Added print and fixed typo --- selenium_tests/test_start_stop_container.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/selenium_tests/test_start_stop_container.py b/selenium_tests/test_start_stop_container.py index 19ca4777c..18a9dff1a 100644 --- a/selenium_tests/test_start_stop_container.py +++ b/selenium_tests/test_start_stop_container.py @@ -16,10 +16,12 @@ def test_start_stop_container(self): driver.find_element_by_id("login_submit").click() driver.find_element_by_name("action").click() self.wait_for(lambda: "noVNC" == driver.title) - for i in range(timeout): + for i in range(60): try: + print(driver.title) if "noVNC" != driver.title: break + print("clicking") driver.find_element_by_xpath("//i").click() except: pass From d904f1bdb0c2c9b00b3723ce3028a819b5fff82e Mon Sep 17 00:00:00 2001 From: Stefano Borini Date: Thu, 25 Aug 2016 19:41:34 +0100 Subject: [PATCH 14/17] traversing the hierarchy --- selenium_tests/test_start_stop_container.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/selenium_tests/test_start_stop_container.py b/selenium_tests/test_start_stop_container.py index 18a9dff1a..89e99bf32 100644 --- a/selenium_tests/test_start_stop_container.py +++ b/selenium_tests/test_start_stop_container.py @@ -16,16 +16,17 @@ def test_start_stop_container(self): driver.find_element_by_id("login_submit").click() driver.find_element_by_name("action").click() self.wait_for(lambda: "noVNC" == driver.title) - for i in range(60): - try: - print(driver.title) - if "noVNC" != driver.title: - break - print("clicking") - driver.find_element_by_xpath("//i").click() - except: - pass - time.sleep(1) + print("clicking") + element = driver.find_element_by_xpath("//i") + print(element.text) + print(element.tag_name) + print(element.parent.text) + print(element.parent.tag_name) + print(element.parent.parent.text) + print(element.parent.parent.tag_name) + element.click() + element.parent.click() + element.parent.parent.click() driver.find_element_by_name("action").click() driver.find_element_by_xpath("//i").click() From 4e233b1c04de1d9dc7f5fca9e50ef4237f55453a Mon Sep 17 00:00:00 2001 From: Stefano Borini Date: Thu, 25 Aug 2016 20:43:02 +0100 Subject: [PATCH 15/17] Trying with partial link --- selenium_tests/test_start_stop_container.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/selenium_tests/test_start_stop_container.py b/selenium_tests/test_start_stop_container.py index 89e99bf32..83addfa2b 100644 --- a/selenium_tests/test_start_stop_container.py +++ b/selenium_tests/test_start_stop_container.py @@ -16,18 +16,8 @@ def test_start_stop_container(self): driver.find_element_by_id("login_submit").click() driver.find_element_by_name("action").click() self.wait_for(lambda: "noVNC" == driver.title) - print("clicking") - element = driver.find_element_by_xpath("//i") - print(element.text) - print(element.tag_name) - print(element.parent.text) - print(element.parent.tag_name) - print(element.parent.parent.text) - print(element.parent.parent.tag_name) - element.click() - element.parent.click() - element.parent.parent.click() - + driver.find_element_by_partial_link_text("Close").click() + self.wait_for(lambda: "noVNC" != driver.title) driver.find_element_by_name("action").click() driver.find_element_by_xpath("//i").click() driver.find_element_by_xpath("(//button[@name='action'])[2]").click() From 3962fba353ef5f494433a70c37183049e91251c9 Mon Sep 17 00:00:00 2001 From: Stefano Borini Date: Thu, 25 Aug 2016 21:04:35 +0100 Subject: [PATCH 16/17] Trying another option --- selenium_tests/test_start_stop_container.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/selenium_tests/test_start_stop_container.py b/selenium_tests/test_start_stop_container.py index 83addfa2b..cf5894f42 100644 --- a/selenium_tests/test_start_stop_container.py +++ b/selenium_tests/test_start_stop_container.py @@ -16,7 +16,10 @@ def test_start_stop_container(self): driver.find_element_by_id("login_submit").click() driver.find_element_by_name("action").click() self.wait_for(lambda: "noVNC" == driver.title) - driver.find_element_by_partial_link_text("Close").click() + driver.execute_script( + "arguments[0].click()", + driver.find_element_by_link_text("Close") + ) self.wait_for(lambda: "noVNC" != driver.title) driver.find_element_by_name("action").click() driver.find_element_by_xpath("//i").click() From 4ad00c717d2c0ebf2e523e3e187c39315305a4e9 Mon Sep 17 00:00:00 2001 From: Stefano Borini Date: Fri, 26 Aug 2016 09:49:37 +0100 Subject: [PATCH 17/17] Reverted changes for ffmpeg. --- .travis.yml | 3 --- Makefile | 3 +-- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index fc44cdad5..062ac4269 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,11 +29,8 @@ script: - chmod 755 `pwd`/start.sh - "`pwd`/start.sh &" - popd -# - "ffmpeg -f x11grab -video_size 1280x1024 -i :99 -codec:v libx264 -r 12 -t 60 video.mp4 &" - sleep 3 - DISPLAY=:99 python -m unittest discover -s selenium_tests -t . -v -# - sleep 60 -# - curl --upload-file video.mp4 https://transfer.sh/video.mp4 after_success: - coverage run -m tornado.testing discover diff --git a/Makefile b/Makefile index e7c7f2204..5279ae588 100644 --- a/Makefile +++ b/Makefile @@ -21,9 +21,8 @@ venv: aptdeps: @echo "Installing apt dependencies" @echo "---------------------------" - sudo add-apt-repository -y ppa:mc3man/trusty-media -apt-get update - apt-get install -o Dpkg::Options::="--force-confold" --force-yes -y docker-engine npm nodejs-legacy python3-pip python3.4-venv ffmpeg + apt-get install -o Dpkg::Options::="--force-confold" --force-yes -y docker-engine npm nodejs-legacy python3-pip python3.4-venv pip install --upgrade pip npm install -g configurable-http-proxy