-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from mwang87/selenium_tests2
selenium test update
- Loading branch information
Showing
9 changed files
with
88 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
test-push: | ||
act -P ubuntu-latest=nektos/act-environments-ubuntu:18.04 | ||
test-schedule: | ||
act schedule -P ubuntu-latest=nektos/act-environments-ubuntu:18.04 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...les/ExtendedDataFigure2/Emperor_Human_ProjectRABloodPlasma_2D_PC1v3_emperor-settings.json
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import time | ||
import json | ||
from selenium import webdriver | ||
from selenium.webdriver.common.by import By | ||
from selenium.webdriver.common.action_chains import ActionChains | ||
from selenium.webdriver.support import expected_conditions as EC | ||
from selenium.webdriver.support.wait import WebDriverWait | ||
from selenium.webdriver.common.keys import Keys | ||
import unittest, time, re | ||
import os | ||
|
||
SERVER_URL = os.environ.get("SERVER_URL", "https://redu.ucsd.edu") | ||
|
||
class TestInterfaceready(unittest.TestCase): | ||
def setUp(self): | ||
options = webdriver.ChromeOptions() | ||
options.add_argument('headless') | ||
#self.driver = webdriver.Chrome(options=options) | ||
self.driver = webdriver.PhantomJS() | ||
self.driver.implicitly_wait(30) | ||
self.vars = {} | ||
|
||
def tearDown(self): | ||
self.driver.quit() | ||
|
||
def test_compound_enrichment(self): | ||
#going to the page | ||
url = "{}/compoundenrichmentdashboard?compound=ESCITALOPRAM%20OXALATE".format(SERVER_URL) | ||
print(url) | ||
self.driver.get(url) | ||
time.sleep(1) | ||
|
||
wait = WebDriverWait(self.driver, 180) | ||
|
||
#waiting for the modal to go aay | ||
wait.until(EC.invisibility_of_element_located((By.ID, 'loadMe'))) | ||
|
||
#waiting for the button to be clickable | ||
wait.until(EC.element_to_be_clickable((By.ID,'querycompound'))) | ||
|
||
#clicking the button | ||
python_button = self.driver.find_element(By.ID, 'querycompound') | ||
|
||
python_button.click() | ||
#time.sleep(60) | ||
|
||
try: | ||
alert = self.driver.switch_to.alert | ||
alert.accept() | ||
print("alert present, error") | ||
return 1 | ||
except Exception: | ||
print("no alert, passing") | ||
|
||
if __name__ == "__main__": | ||
unittest.main() |