Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use url from env for running cdc tests. #4554

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions server/webdriver/cdc_tests/autopush_test.py
hqpho marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import os
import unittest

from selenium.webdriver.common.by import By
Expand All @@ -23,7 +24,12 @@
from server.webdriver.base_utils import wait_elem

# From project datcom-website-dev > Cloud Run: dc-autopush > Revisions
CDC_AUTOPUSH_URL = 'https://dc-autopush-kqb7thiuka-uc.a.run.app'
DEFAULT_CDC_TEST_BASE_URL = 'https://dc-autopush-kqb7thiuka-uc.a.run.app'

# Get base test url from the CDC_TEST_BASE_URL env variable, defaulting to DEFAULT_CDC_TEST_BASE_URL
CDC_TEST_BASE_URL = os.environ.get('CDC_TEST_BASE_URL',
DEFAULT_CDC_TEST_BASE_URL)
print(f'Running CDC tests against base URL: {CDC_TEST_BASE_URL}')


class CdcAutopushWebdriverTest(unittest.TestCase):
Expand All @@ -33,7 +39,7 @@ def setUp(self, preferences=None):
# Maximum time, in seconds, before throwing a TimeoutException.
self.TIMEOUT_SEC = shared.TIMEOUT
self.driver = create_driver(preferences)
self._base_url = CDC_AUTOPUSH_URL
self._base_url = CDC_TEST_BASE_URL

def tearDown(self):
"""Runs at the end of every individual test."""
Expand Down Expand Up @@ -70,7 +76,7 @@ def test_statvar_explorer(self):
class CdcAutopushNLTest(ExploreTest):

def get_server_url(self):
return CDC_AUTOPUSH_URL
return CDC_TEST_BASE_URL

def test_cdc_nl(self):
self.run_detect_and_fulfill('cdc_nl', ['gender wage gap in europe'])
Loading