'Scenario: Ensure that we can add an XBlock, edit it, then see the resulting changes.
Given I have a library in Studio with no XBlocks
And I navigate to Library Page in Studio
Then there are no XBlocks displayed
When I add Multiple Choice XBlock
Then one XBlock is displayed
When I edit first XBlock
And I go to basic tab
And set it\'s text to a fairly trivial question about Battlestar Galactica
And save XBlock
Then one XBlock is displayed
And first XBlock student content contains at least part of text I set'

def test_add_edit_xblock(self):

    self.assertEqual(len(self.lib_page.xblocks), 0)
    add_component(self.lib_page, 'problem', 'Multiple    Choice')
    self.assertEqual(len(self.lib_page.xblocks), 1)
    problem_block = self.lib_page.xblocks[0]
    problem_block.edit()
    problem_block.open_basic_tab()
    problem_block.set_codemirror_text('\n                                                >>Who    is    "Starbuck"?<<\n                                                    (x)    Kara    Thrace\n                                                    (    )    William    Adama\n                                                    (    )    Laura    Roslin\n                                                    (    )    Lee    Adama\n                                                    (    )    Gaius    Baltar\n                                                ')
    problem_block.save_settings()
    self.assertEqual(len(self.lib_page.xblocks), 1)
    problem_block = self.lib_page.xblocks[0]
    self.assertIn('Laura    Roslin', problem_block.author_content)
