From e074aba55486b715032380ec7a8778f79ba7b4d7 Mon Sep 17 00:00:00 2001 From: Gabriel Mechali Date: Fri, 13 Dec 2024 16:07:47 -0500 Subject: [PATCH] Moving place revamp test to Base DC only. (#4797) 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. --- .../shared_tests/place_explorer_test.py | 28 +---------------- server/webdriver/tests/place_explorer_test.py | 30 +++++++++++++++++++ 2 files changed, 31 insertions(+), 27 deletions(-) diff --git a/server/webdriver/shared_tests/place_explorer_test.py b/server/webdriver/shared_tests/place_explorer_test.py index 988474e86b..c32c276624 100644 --- a/server/webdriver/shared_tests/place_explorer_test.py +++ b/server/webdriver/shared_tests/place_explorer_test.py @@ -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) \ No newline at end of file diff --git a/server/webdriver/tests/place_explorer_test.py b/server/webdriver/tests/place_explorer_test.py index bbc04abede..f6f4a90518 100644 --- a/server/webdriver/tests/place_explorer_test.py +++ b/server/webdriver/tests/place_explorer_test.py @@ -12,6 +12,10 @@ # 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 @@ -19,3 +23,29 @@ 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)