'Scenario: Ensure that we can add an HTML block, duplicate it, then delete the original.
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 Text XBlock
Then one XBlock is displayed
When I duplicate first XBlock
Then two XBlocks are displayed
And those XBlocks locators\' are different
When I delete first XBlock
Then one XBlock is displayed
And displayed XBlock are second one'

def test_add_duplicate_delete_actions(self):

    self.assertEqual(len(self.lib_page.xblocks), 0)
    add_component(self.lib_page, 'html', 'Text')
    self.assertEqual(len(self.lib_page.xblocks), 1)
    first_block_id = self.lib_page.xblocks[0].locator
    self.lib_page.click_duplicate_button(first_block_id)
    self.assertEqual(len(self.lib_page.xblocks), 2)
    second_block_id = self.lib_page.xblocks[1].locator
    self.assertNotEqual(first_block_id, second_block_id)
    self.lib_page.click_delete_button(first_block_id, confirm=True)
    self.assertEqual(len(self.lib_page.xblocks), 1)
    self.assertEqual(self.lib_page.xblocks[0].locator, second_block_id)
