From 5aba2f0e6cb3ca50cc08211cb4b50d0d1d1d855c Mon Sep 17 00:00:00 2001 From: Jonathan Piacenti Date: Thu, 5 Mar 2015 22:53:28 +0000 Subject: [PATCH] Exfoliate flaky studio home test. --- common/test/acceptance/pages/studio/index.py | 7 ++++++- common/test/acceptance/tests/studio/test_studio_home.py | 1 - 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/common/test/acceptance/pages/studio/index.py b/common/test/acceptance/pages/studio/index.py index d6d6a25603..c23f0ab233 100644 --- a/common/test/acceptance/pages/studio/index.py +++ b/common/test/acceptance/pages/studio/index.py @@ -86,16 +86,21 @@ class DashboardPage(PageObject): def list_libraries(self): """ - List all the libraries found on the page's list of libraries. + Click the tab to display the available libraries, and return detail of them. """ # Workaround Selenium/Firefox bug: `.text` property is broken on invisible elements self.q(css='#course-index-tabs .libraries-tab a').click() + if self.q(css='.list-notices.libraries-tab').present: + # No libraries are available. + self.wait_for_element_visibility('.libraries-tab .new-library-button', "Switch to library tab") + return [] div2info = lambda element: { 'name': element.find_element_by_css_selector('.course-title').text, 'org': element.find_element_by_css_selector('.course-org .value').text, 'number': element.find_element_by_css_selector('.course-num .value').text, 'url': element.find_element_by_css_selector('a.library-link').get_attribute('href'), } + self.wait_for_element_visibility('.libraries li.course-item', "Switch to library tab") return self.q(css='.libraries li.course-item').map(div2info).results def has_library(self, **kwargs): diff --git a/common/test/acceptance/tests/studio/test_studio_home.py b/common/test/acceptance/tests/studio/test_studio_home.py index e1e68524b2..a0cfd6b627 100644 --- a/common/test/acceptance/tests/studio/test_studio_home.py +++ b/common/test/acceptance/tests/studio/test_studio_home.py @@ -24,7 +24,6 @@ class CreateLibraryTest(WebAppTest): self.auth_page = AutoAuthPage(self.browser, staff=True) self.dashboard_page = DashboardPage(self.browser) - @skip("Flaky test. See SOL-430") def test_create_library(self): """ From the home page: