Skip to content

Commit

Permalink
beginnings of Pythium selenium test for webapollo
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuels committed Nov 16, 2012
1 parent e1ff062 commit d88482a
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
35 changes: 35 additions & 0 deletions plugins/WebApollo/tests/selenium_tests/lib/WebApolloTest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import os
import sys
import time
sys.path.append( 'tests/selenium_tests' ) # relative to JBrowse root

from jbrowse_selenium import JBrowseTest

class WebApolloTest (JBrowseTest):

wa_url = None

def setUp( self ):
super( WebApolloTest, self ).setUp()
self.login( os.environ['WA_USER'], os.environ['WA_PASS'] )
self.browser.get( self.baseURL() )

def baseURL( self ):
return self.waURL()+'/jbrowse/index.html'

def waURL( self ):
if not self.wa_url:
self.wa_url = os.environ['WA_URL']
return self.wa_url

def login( self, username, password ):
self.browser.get( self.waURL() + '/Login' );
username_input = self.assert_element('//input[@id="username"]')
password_input = self.assert_element('//input[@id="password"]')
username_input.send_keys(username)
password_input.send_keys(password)
login_button = self.assert_element('//button[@id="login_button"]')
login_button.click()
time.sleep( 0.4 )
pass

2 changes: 2 additions & 0 deletions plugins/WebApollo/tests/selenium_tests/lib/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from WebApolloTest import WebApolloTest

29 changes: 29 additions & 0 deletions plugins/WebApollo/tests/selenium_tests/pythium_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import unittest
from lib import WebApolloTest;

class PythiumTest(WebApolloTest, unittest.TestCase):

data_dir = 'sample_data/json/volvox'

def setUp( self ):
# call( "rm -rf sample_data/json/volvox/", shell=True )
# call( "bin/prepare-refseqs.pl --fasta docs/tutorial/data_files/volvox.fa --out sample_data/json/volvox/", shell=True )
# call( "bin/biodb-to-json.pl --conf docs/tutorial/conf_files/volvox.json --out sample_data/json/volvox/", shell=True )
# call( "bin/wig-to-json.pl --out sample_data/json/volvox/ --wig docs/tutorial/data_files/volvox_microarray.wig", shell=True )
# call( "bin/add-track-json.pl sample_data/raw/volvox/volvox_microarray.bw.conf sample_data/json/volvox/trackList.json", shell=True )
# call( "bin/add-track-json.pl sample_data/raw/volvox/volvox-sorted.bam.conf sample_data/json/volvox/trackList.json", shell=True )
# call( "bin/add-track-json.pl sample_data/raw/volvox/volvox-sorted.bam.coverage.conf sample_data/json/volvox/trackList.json", shell=True )
# call( "bin/generate-names.pl --dir sample_data/json/volvox/", shell=True )
super( PythiumTest, self ).setUp()


def test_pythium( self ):
test_ref = 'scf1117875582023';
# select "ctgA from the dropdown
self.select_refseq( test_ref )

# check a good browser title
assert test_ref in self.browser.title, "browser title is actually %s" % self.browser.title

self.browser.close()

0 comments on commit d88482a

Please sign in to comment.