'Scenario: Ensure that the navigation buttons work.
Given that I have a library in Studio with 40 XBlocks
The previous button should be disabled.
The first XBlock should be the 1st XBlock
Then if I hit the next button
The first XBlock should be the 11th XBlock
Then if I hit the next button
The first XBlock should be the 21st XBlock
Then if I hit the next button
The first XBlock should be the 31st XBlock
And the next button should be disabled
Then if I hit the previous button
The first XBlock should be the 21st XBlock
Then if I hit the previous button
The first XBlock should be the 11th XBlock
Then if I hit the previous button
The first XBlock should be the 1st XBlock
And the previous button should be disabled'

@data('top', 'bottom')
def test_nav_buttons(self, position):

    self.assertTrue(self.lib_page.nav_disabled(position, ['previous']))
    self.assertEqual(self.lib_page.xblocks[0].name, '1')
    self.lib_page.move_forward(position)
    self.assertEqual(self.lib_page.xblocks[0].name, '11')
    self.lib_page.move_forward(position)
    self.assertEqual(self.lib_page.xblocks[0].name, '21')
    self.lib_page.move_forward(position)
    self.assertEqual(self.lib_page.xblocks[0].name, '31')
    self.lib_page.nav_disabled(position, ['next'])
    self.lib_page.move_back(position)
    self.assertEqual(self.lib_page.xblocks[0].name, '21')
    self.lib_page.move_back(position)
    self.assertEqual(self.lib_page.xblocks[0].name, '11')
    self.lib_page.move_back(position)
    self.assertEqual(self.lib_page.xblocks[0].name, '1')
    self.assertTrue(self.lib_page.nav_disabled(position, ['previous']))
