Skip to content

Commit

Permalink
Moving place revamp test to Base DC only. (#4797)
Browse files Browse the repository at this point in the history
The revampled place page experiment should not be tested against CDC
autopush. Extracting that test back out to the Based DC tests only.
Once the revampled place page is fully enabled, we should update all the
place page tests to be for the new page.
  • Loading branch information
gmechali authored Dec 13, 2024
1 parent 97873c0 commit e074aba
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 27 deletions.
28 changes: 1 addition & 27 deletions server/webdriver/shared_tests/place_explorer_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,30 +288,4 @@ def test_ranking_chart_redirect_link(self):

# Check the title text
page_title = self.driver.find_element(By.ID, 'place-name').text
self.assertEqual(page_title, place_name_text)

def test_dev_place_overview_california(self):
"""Ensure experimental dev place page content loads"""
self.driver.get(self.url_ + '/place/geoId/06?force_dev_places=true')

# For the dev place page, the related places callout is under the
# .related-places-callout div.
related_places_callout_el_present = EC.presence_of_element_located(
(By.CLASS_NAME, 'related-places-callout'))
related_places_callout_el = WebDriverWait(
self.driver, self.TIMEOUT_SEC).until(related_places_callout_el_present)
self.assertEqual(related_places_callout_el.text, 'Places in California')

# Assert the "Download" link is present in charts
download_link_present = EC.presence_of_element_located(
(By.CLASS_NAME, 'download-outlink'))
download_link_el = WebDriverWait(
self.driver, self.TIMEOUT_SEC).until(download_link_present)
self.assertTrue('Download' in download_link_el.text)

# Assert the "Explore in ... Tool" link is present in charts
explore_in_link_present = EC.presence_of_element_located(
(By.CLASS_NAME, 'explore-in-outlink'))
explore_in_link_el = WebDriverWait(
self.driver, self.TIMEOUT_SEC).until(explore_in_link_present)
self.assertTrue('Explore in' in explore_in_link_el.text)
self.assertEqual(page_title, place_name_text)
30 changes: 30 additions & 0 deletions server/webdriver/tests/place_explorer_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,40 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait

from server.webdriver.base_dc_webdriver import BaseDcWebdriverTest
from server.webdriver.shared_tests.place_explorer_test import \
PlaceExplorerTestMixin


class TestPlaceExplorer(PlaceExplorerTestMixin, BaseDcWebdriverTest):
"""Class to test place explorer page. Tests come from PlaceExplorerTestMixin."""

def test_dev_place_overview_california(self):
"""Ensure experimental dev place page content loads"""
self.driver.get(self.url_ + '/place/geoId/06?force_dev_places=true')

# For the dev place page, the related places callout is under the
# .related-places-callout div.
related_places_callout_el_present = EC.presence_of_element_located(
(By.CLASS_NAME, 'related-places-callout'))
related_places_callout_el = WebDriverWait(
self.driver, self.TIMEOUT_SEC).until(related_places_callout_el_present)
self.assertEqual(related_places_callout_el.text, 'Places in California')

# Assert the "Download" link is present in charts
download_link_present = EC.presence_of_element_located(
(By.CLASS_NAME, 'download-outlink'))
download_link_el = WebDriverWait(
self.driver, self.TIMEOUT_SEC).until(download_link_present)
self.assertTrue('Download' in download_link_el.text)

# Assert the "Explore in ... Tool" link is present in charts
explore_in_link_present = EC.presence_of_element_located(
(By.CLASS_NAME, 'explore-in-outlink'))
explore_in_link_el = WebDriverWait(
self.driver, self.TIMEOUT_SEC).until(explore_in_link_present)
self.assertTrue('Explore in' in explore_in_link_el.text)

0 comments on commit e074aba

Please sign in to comment.