diff --git a/.github/workflows/productionintegration.yml b/.github/workflows/productionintegration.yml index 4de3f61..6d7acea 100644 --- a/.github/workflows/productionintegration.yml +++ b/.github/workflows/productionintegration.yml @@ -16,6 +16,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip + pip install requests nose2 - name: Test with Selenium run: | @@ -56,4 +57,3 @@ jobs: # - name: Test with Selenium # run: | # cd test-production-integration && export SERVER_URL="http://dorresteintesthub.ucsd.edu:5005" && nose2 -v test_selenium && cd .. - diff --git a/README.md b/README.md index b533b43..2d3c98a 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,7 @@ To simulate selenium and production integration tests: 1. Check that graphs in Chemical Explorer are functional, available after clicking an example chemical's 'view assocations' button. (e.g. ```/compoundenrichmentdashboard?compound=Spectral%20Match%20to%20Sulfachloropyridazine%20from%20NIST14```) 1. Test all buttons to ensure links are correct. + ## Updating ReDU Data Procedure One of the key steps in ReDU is the updating of the database to include the latest identifications for files within ReDU. These are the following steps: diff --git a/test-production-integration/test_selenium.py b/test-production-integration/test_selenium.py index 3740f8d..1362096 100644 --- a/test-production-integration/test_selenium.py +++ b/test-production-integration/test_selenium.py @@ -4,7 +4,10 @@ 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.ui import WebDriverWait + + from selenium.webdriver.common.keys import Keys import unittest, time, re import os @@ -14,6 +17,7 @@ SERVER_URL = os.environ.get("SERVER_URL", "https://redu.ucsd.edu") class TestInterfaceready(unittest.TestCase): + def setUp(self): chrome_options = webdriver.ChromeOptions() chrome_options.add_argument('--no-sandbox') @@ -21,6 +25,7 @@ def setUp(self): chrome_options.add_argument('--headless') self.driver = webdriver.Chrome(options=chrome_options) self.driver.implicitly_wait(30) + def tearDown(self): self.driver.quit() @@ -28,6 +33,7 @@ def tearDown(self): def test_compound_enrichment(self): #going to the page url = "{}/compoundenrichmentdashboard?compound=ESCITALOPRAM%20OXALATE".format(SERVER_URL) + self.driver.get(url) time.sleep(1) @@ -37,6 +43,7 @@ def test_compound_enrichment(self): wait.until(EC.visibility_of_element_located((By.ID,'querycompound'))) #clicking the button python_button = self.driver.find_element_by_id('querycompound') + python_button.click() try: