'Scenario: Ensure preview settings persist across navigation.
Given that I have a library in Studio with 40 XBlocks
Then previews are visible
And when I click the toggle previews button
And click the next page button
Then the previews will not be visible
And the first XBlock will be the 11th one
And the last XBlock will be the 20th one
And when I click the toggle previews button
And I click the previous page button
Then the previews will be visible
And the first XBlock will be the first one
And the last XBlock will be the 11th one'

def test_previews_navigation(self):

    self.assertTrue(self.lib_page.are_previews_showing())
    self.lib_page.toggle_previews()
    self.lib_page.move_forward('top')
    self.assertFalse(self.lib_page.are_previews_showing())
    self.assertEqual(self.lib_page.xblocks[0].name, '11')
    self.assertEqual(self.lib_page.xblocks[(-1)].name, '20')
    self.lib_page.toggle_previews()
    self.lib_page.move_back('top')
    self.assertTrue(self.lib_page.are_previews_showing())
    self.assertEqual(self.lib_page.xblocks[0].name, '1')
    self.assertEqual(self.lib_page.xblocks[(-1)].name, '10')
