From b33c04114b7bfdd1d8910e0389dfca54b756481e Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Tue, 31 Jan 2017 04:57:48 +0000 Subject: [PATCH] tests folder started --- .gitignore | 1 + tests/README.txt | 13 ++++++++++ tests/geckodriver.log | 57 +++++++++++++++++++++++++++++++++++++++++++ tests/main.py | 22 +++++++++++++++++ 4 files changed, 93 insertions(+) create mode 100644 tests/README.txt create mode 100644 tests/geckodriver.log create mode 100644 tests/main.py diff --git a/.gitignore b/.gitignore index 40f074e..0e2b78f 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ *.*~ *.user .idea/ +*.log cmake-build-debug/ diff --git a/tests/README.txt b/tests/README.txt new file mode 100644 index 0000000..51df7bb --- /dev/null +++ b/tests/README.txt @@ -0,0 +1,13 @@ +## Python selenium testing of the explorer + +As the explorer grows, monero keep changing, it is increasingly time consuming +to keep testing the explorer manually. Thus, with the help of selenium, python and nose +it is hope that at least part of this process can be automated. + +```bash +sudo pacman -S python-selenium python-nose +``` + +``` +nosetests main.py +``` \ No newline at end of file diff --git a/tests/geckodriver.log b/tests/geckodriver.log new file mode 100644 index 0000000..1b4d2bd --- /dev/null +++ b/tests/geckodriver.log @@ -0,0 +1,57 @@ +1485837988236 geckodriver INFO Listening on 127.0.0.1:32788 +1485837988239 mozprofile::profile INFO Using profile path /tmp/rust_mozprofile.LB9ObSCrWqpM +1485837988239 geckodriver::marionette INFO Starting browser /usr/bin/firefox +1485837988241 geckodriver::marionette INFO Connecting to Marionette on localhost:42317 +1485837989050 Marionette INFO Listening on port 42317 + +(firefox:9369): GLib-GObject-CRITICAL **: g_type_add_interface_static: assertion 'g_type_parent (interface_type) == G_TYPE_INTERFACE' failed + +(firefox:9369): GLib-GObject-CRITICAL **: g_type_add_interface_static: assertion 'g_type_parent (interface_type) == G_TYPE_INTERFACE' failed + +(firefox:9369): GLib-GObject-CRITICAL **: g_type_add_interface_static: assertion 'g_type_parent (interface_type) == G_TYPE_INTERFACE' failed + +(firefox:9369): GLib-GObject-CRITICAL **: g_type_add_interface_static: assertion 'g_type_parent (interface_type) == G_TYPE_INTERFACE' failed + +(firefox:9369): GLib-GObject-CRITICAL **: g_type_add_interface_static: assertion 'g_type_parent (interface_type) == G_TYPE_INTERFACE' failed +1485838037044 geckodriver INFO Listening on 127.0.0.1:51418 +1485838038043 mozprofile::profile INFO Using profile path /tmp/rust_mozprofile.wXu10YBwmn9y +1485838038044 geckodriver::marionette INFO Starting browser /usr/bin/firefox +1485838038045 geckodriver::marionette INFO Connecting to Marionette on localhost:38052 +1485838038848 Marionette INFO Listening on port 38052 +1485838458035 geckodriver INFO Listening on 127.0.0.1:39443 +1485838458040 mozprofile::profile INFO Using profile path /tmp/rust_mozprofile.z7FYbMyZiRYA +1485838458041 geckodriver::marionette INFO Starting browser /usr/bin/firefox +1485838458043 geckodriver::marionette INFO Connecting to Marionette on localhost:39703 +1485838458843 Marionette INFO Listening on port 39703 + +###!!! [Child][MessageChannel] Error: (msgtype=0x1060003,name=PTexture::Msg_Destroy) Channel error: cannot send/recv + + +###!!! [Child][MessageChannel] Error: (msgtype=0x1060003,name=PTexture::Msg_Destroy) Channel error: cannot send/recv + + +###!!! [Child][MessageChannel] Error: (msgtype=0x420003,name=PCompositable::Msg_Destroy) Channel error: cannot send/recv + + +###!!! [Child][MessageChannel] Error: (msgtype=0x420003,name=PCompositable::Msg_Destroy) Channel error: cannot send/recv + + +###!!! [Child][MessageChannel] Error: (msgtype=0x1060003,name=PTexture::Msg_Destroy) Channel error: cannot send/recv + + +###!!! [Child][MessageChannel] Error: (msgtype=0x1060003,name=PTexture::Msg_Destroy) Channel error: cannot send/recv + + +###!!! [Child][MessageChannel] Error: (msgtype=0x420003,name=PCompositable::Msg_Destroy) Channel error: cannot send/recv + + +###!!! [Child][MessageChannel] Error: (msgtype=0x1060003,name=PTexture::Msg_Destroy) Channel error: cannot send/recv + + +###!!! [Child][MessageChannel] Error: (msgtype=0x1060003,name=PTexture::Msg_Destroy) Channel error: cannot send/recv + + +###!!! [Child][MessageChannel] Error: (msgtype=0x420003,name=PCompositable::Msg_Destroy) Channel error: cannot send/recv + +[Child 10198] ###!!! ABORT: Aborting on channel error.: file /build/firefox/src/firefox-50.1.0/ipc/glue/MessageChannel.cpp, line 2056 +[Child 10198] ###!!! ABORT: Aborting on channel error.: file /build/firefox/src/firefox-50.1.0/ipc/glue/MessageChannel.cpp, line 2056 diff --git a/tests/main.py b/tests/main.py new file mode 100644 index 0000000..ced69d3 --- /dev/null +++ b/tests/main.py @@ -0,0 +1,22 @@ +import unittest +from selenium import webdriver + + +class OnionExplorerTest(unittest.TestCase): + ''' + based on https://engineering.aweber.com/getting-started-with-ui-automated-tests-using-selenium-python/ + ''' + + @classmethod + def setUpClass(cls): + cls.driver = webdriver.Firefox() + + def test_title(self): + self.driver.get('http://127.0.0.1:8081/') + self.assertEqual( + self.driver.title, + 'Onion Monero Blockchain Explorer') + + @classmethod + def tearDownClass(cls): + cls.driver.quit() \ No newline at end of file