
import zeit.content.article.testing


class Preview(zeit.content.article.testing.SeleniumTestCase):

    def test_selected_tab_is_stored_across_reload(self):
        self.open('/repository/online/2007/01/Somalia')
        s = self.selenium
        selected_tab = 'css=#preview-tabs .ui-tabs-selected'
        s.waitForElementPresent(selected_tab)
        s.assertText(selected_tab, 'iPad')
        s.click('css=#preview-tabs a:contains("Desktop")')
        s.waitForText(selected_tab, 'Desktop')

        s.refresh()
        s.waitForElementPresent(selected_tab)
        s.assertText(selected_tab, 'Desktop')


import zeit.content.article.testing


class Preview(zeit.content.article.testing.SeleniumTestCase):

    def test_selected_tab_is_stored_across_reload(self):
        self.open('/repository/online/2007/01/Somalia')
        s = self.selenium
        selected_tab = 'css=#preview-tabs .ui-tabs-active'
        s.waitForElementPresent(selected_tab)
        s.waitForText(selected_tab, 'iPad')
        s.click('css=#preview-tabs a:contains("Desktop")')
        s.waitForText(selected_tab, 'Desktop')

        s.refresh()
        s.waitForElementPresent(selected_tab)
        s.waitForText(selected_tab, 'Desktop')

Update test to work with current jquery-ui
Update test to work with current jquery-ui

  
  import zeit.content.article.testing
  
  
  class Preview(zeit.content.article.testing.SeleniumTestCase):
  
      def test_selected_tab_is_stored_across_reload(self):
          self.open('/repository/online/2007/01/Somalia')
          s = self.selenium
-         selected_tab = 'css=#preview-tabs .ui-tabs-selected'
+         selected_tab = 'css=#preview-tabs .ui-tabs-active'
          s.waitForElementPresent(selected_tab)
-         s.assertText(selected_tab, 'iPad')
+         s.waitForText(selected_tab, 'iPad')
          s.click('css=#preview-tabs a:contains("Desktop")')
          s.waitForText(selected_tab, 'Desktop')
  
          s.refresh()
          s.waitForElementPresent(selected_tab)
-         s.assertText(selected_tab, 'Desktop')
+         s.waitForText(selected_tab, 'Desktop')
  
Update test to work with current jquery-ui
## Code Before:

import zeit.content.article.testing


class Preview(zeit.content.article.testing.SeleniumTestCase):

    def test_selected_tab_is_stored_across_reload(self):
        self.open('/repository/online/2007/01/Somalia')
        s = self.selenium
        selected_tab = 'css=#preview-tabs .ui-tabs-selected'
        s.waitForElementPresent(selected_tab)
        s.assertText(selected_tab, 'iPad')
        s.click('css=#preview-tabs a:contains("Desktop")')
        s.waitForText(selected_tab, 'Desktop')

        s.refresh()
        s.waitForElementPresent(selected_tab)
        s.assertText(selected_tab, 'Desktop')

## Instruction:
Update test to work with current jquery-ui
## Code After:

import zeit.content.article.testing


class Preview(zeit.content.article.testing.SeleniumTestCase):

    def test_selected_tab_is_stored_across_reload(self):
        self.open('/repository/online/2007/01/Somalia')
        s = self.selenium
        selected_tab = 'css=#preview-tabs .ui-tabs-active'
        s.waitForElementPresent(selected_tab)
        s.waitForText(selected_tab, 'iPad')
        s.click('css=#preview-tabs a:contains("Desktop")')
        s.waitForText(selected_tab, 'Desktop')

        s.refresh()
        s.waitForElementPresent(selected_tab)
        s.waitForText(selected_tab, 'Desktop')
