Commit 4a2cbd40 authored by JC Brand's avatar JC Brand

Initial work on running selenium tests.

parent 61b32fd7
*~
.sw?
*.mo
*.kpf
.*.sw?
*.mo
*.pyc
*~
.*.cfg
.hg/
.*.sw?
.bzr/
.svn/
.hg/
.idea
.project
.pydevproject
.idea
.su?
.su?
.svn/
.sw?
builds/*
analytics.js
inverse-analytics.js
# python/buildout
eggs
*.egg-info
*.pyc
.Python
build
converse.js.egg-info/
eggs
parts
parts
*.pyc
*.egg-info
dev-jc.html
inverse-dev.html
inverse-dev-jc.html
converse-logs/*.html
# Ruby/Sass/Bundler
......
[buildout]
parts =
sphinx
test
eggs =
selenium
develop = .
versions = versions
[sphinx]
......@@ -10,13 +14,26 @@ eggs =
Sphinx
sphinx-bootstrap-theme
[test]
recipe = zc.recipe.testrunner
eggs =
ipdb
selenium
converse.js
defaults = [
'-v',
'--auto-color',
'--auto-progress',
'--shuffle']
[versions]
selenium = 3.4.3
docutils = 0.13.1
Jinja2 = 2.9.5
MarkupSafe = 0.23
Pygments = 2.2.0
six = 1.10.0
setuptools = 28.6.1
setuptools = 36.0.1
Sphinx = 1.5.2
z3c.recipe.egg = 2.0.3
zc.buildout = 2.5.3
zc.recipe.egg = 2.0.3
zc.buildout = 2.9.3
from setuptools import setup
setup(
name="converse.js",
version="3.0.2",
description="XMPP chat client that runs in a web-browser",
author="JC Brand",
author_email="jc@opkode.com",
url="https://conversejs.org",
packages=[]
)
import os
import unittest
import threading
import SimpleHTTPServer
import SocketServer
from selenium import webdriver
DOMAIN = '127.0.0.1'
PORT = 8088
class TestServer(SocketServer.TCPServer):
allow_reuse_address = True
class SeleniumTests(unittest.TestCase):
def setUp(self):
os.chdir('../../')
Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
httpd = TestServer(("", PORT), Handler)
httpd_thread = threading.Thread(target=httpd.serve_forever)
httpd_thread.setDaemon(True)
httpd_thread.start()
print "serving at port", PORT
self.driver = webdriver.Chrome()
def test_load_inverse(self):
self.driver.get("http://{}:{}/inverse-dev.html".format(DOMAIN, PORT))
assert("inVerse" in self.driver.title)
def tearDown(self):
self.driver.quit()
if __name__ == "__main__":
unittest.main()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment