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

Initial work on running selenium tests.

parent 61b32fd7
*~
.sw?
*.mo
*.kpf *.kpf
.*.sw? *.mo
*.pyc
*~
.*.cfg .*.cfg
.hg/ .*.sw?
.bzr/ .bzr/
.svn/ .hg/
.idea
.project .project
.pydevproject .pydevproject
.idea
.su? .su?
.su?
.svn/
.sw?
builds/* builds/*
analytics.js analytics.js
inverse-analytics.js inverse-analytics.js
# python/buildout # python/buildout
eggs *.egg-info
*.pyc
.Python .Python
build build
converse.js.egg-info/
eggs
parts
parts parts
*.pyc
*.egg-info
dev-jc.html dev-jc.html
inverse-dev.html inverse-dev.html
inverse-dev-jc.html inverse-dev-jc.html
converse-logs/*.html converse-logs/*.html
# Ruby/Sass/Bundler # Ruby/Sass/Bundler
......
[buildout] [buildout]
parts = parts =
sphinx sphinx
test
eggs =
selenium
develop = .
versions = versions versions = versions
[sphinx] [sphinx]
...@@ -10,13 +14,26 @@ eggs = ...@@ -10,13 +14,26 @@ eggs =
Sphinx Sphinx
sphinx-bootstrap-theme sphinx-bootstrap-theme
[test]
recipe = zc.recipe.testrunner
eggs =
ipdb
selenium
converse.js
defaults = [
'-v',
'--auto-color',
'--auto-progress',
'--shuffle']
[versions] [versions]
selenium = 3.4.3
docutils = 0.13.1 docutils = 0.13.1
Jinja2 = 2.9.5 Jinja2 = 2.9.5
MarkupSafe = 0.23 MarkupSafe = 0.23
Pygments = 2.2.0 Pygments = 2.2.0
six = 1.10.0 six = 1.10.0
setuptools = 28.6.1 setuptools = 36.0.1
Sphinx = 1.5.2 Sphinx = 1.5.2
z3c.recipe.egg = 2.0.3 zc.recipe.egg = 2.0.3
zc.buildout = 2.5.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