def test_multi_select_widget(self): """ tests the usage of the FilteredSelectMultiple widget for multi select fields """ driver = self.driver driver.get(self.base_url) ss_path = setup_screenshots_folder( "PNG-metashare.repository.seltests.test_editor.EditorTest", "multi_select_widget") driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) # login user login_user(driver, "editoruser", "secret") # make sure login was successful self.assertEqual("Logout", driver.find_element_by_xpath("//div[@id='inner']/div[2]/a[3]/div").text) driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) # Editor driver.find_element_by_css_selector("div.button.middle_button").click() driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) # Share/Create Resource mouse_over(driver, driver.find_element_by_link_text("Share/Create")) driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) #driver.find_element_by_link_text("Resource").click() click_menu_item(driver, driver.find_element_by_link_text("Resource")) # create text corpus driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) Select(driver.find_element_by_id("id_resourceType")).select_by_visible_text("Corpus") driver.find_element_by_id("id_corpusTextInfo").click() driver.find_element_by_id("id_submit").click() driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) self.assertEqual("Add Resource", driver.find_element_by_css_selector("#content > h1").text) # distribution popup driver.find_element_by_css_selector("img[alt=\"Add information\"]").click() driver.switch_to_window("id_distributionInfo") # show licenses driver.find_element_by_id("fieldsetcollapser0").click() # check that the left window contains all entries self.assertEqual("underNegotiation", driver.find_element_by_xpath( "//select[@id='id_licenceinfotype_model_set-0-licence_from']/option[41]").text) # add an entry driver.find_element_by_xpath( "//select[@id='id_licenceinfotype_model_set-0-licence_from']/option[1]").click() driver.find_element_by_link_text("Add").click() # check that entry has moved to right site self.assertEqual("AGPL", driver.find_element_by_xpath( "//select[@id='id_licenceinfotype_model_set-0-licence_to']/option[1]").text) self.assertEqual("ApacheLicence_V2.0", driver.find_element_by_xpath( "//select[@id='id_licenceinfotype_model_set-0-licence_from']/option[1]").text) # remove entry driver.find_element_by_xpath( "//select[@id='id_licenceinfotype_model_set-0-licence_to']/option[1]").click() driver.find_element_by_link_text("Remove").click() # entry is now at last position on left site self.assertEqual("AGPL", driver.find_element_by_xpath( "//select[@id='id_licenceinfotype_model_set-0-licence_from']/option[41]").text)
def test_status_after_saving(self): # load test fixture and set its status to 'published' test_utils.setup_test_storage() _result = test_utils.import_xml(TESTFIXTURE_XML) resource = resourceInfoType_model.objects.get(pk=_result[0].id) resource.editor_groups.add(self.test_editor_group) resource.storage_object.published = True # this also saves the storage object: resource.save() driver = self.driver driver.get(self.base_url) # login user login_user(driver, "manageruser", "secret") # make sure login was successful self.assertEqual("Logout", driver.find_element_by_xpath("//div[@id='inner']/div[2]/a[3]/div").text) # go to Editor driver.find_element_by_css_selector("div.button.middle_button").click() # go to Update->Resource mouse_over(driver, driver.find_element_by_link_text("Update")) #driver.find_element_by_link_text("Resource").click() click_menu_item(driver, driver.find_element_by_link_text("Resource")) # make sure we are on the right site self.assertEqual("Select Resource to change | META-SHARE backend", driver.title) # check if LR entry is available and that its status is published try: self.assertEqual("REVEAL-THIS Corpus", driver.find_element_by_link_text("REVEAL-THIS Corpus").text) except AssertionError as e: self.verification_errors.append(str(e)) try: self.assertEqual( "published", driver.find_element_by_xpath("//table[@id='result_list']/tbody/tr/td[3]").text) except AssertionError as e: self.verification_errors.append(str(e)) # click LR to edit it driver.find_element_by_link_text("REVEAL-THIS Corpus").click() # change the short name and save the LR driver.find_element_by_name("key_form-0-resourceShortName_0").clear() driver.find_element_by_name("key_form-0-resourceShortName_0").send_keys("en") driver.find_element_by_name("val_form-0-resourceShortName_0").clear() driver.find_element_by_name("val_form-0-resourceShortName_0").send_keys("a random short name") driver.find_element_by_name("_save").click() # make sure that the LR status is still published after saving try: self.assertEqual( "published", driver.find_element_by_xpath("//table[@id='result_list']/tbody/tr/td[3]").text) except AssertionError as e: self.verification_errors.append(str(e))
def test_sorting(self): """ tests the sorting of controlled vocabulary in some examplary CharFields used in the Editor """ driver = self.driver driver.get(self.base_url) ss_path = setup_screenshots_folder( "PNG-metashare.repository.seltests.test_editor.EditorTest", "sorting") driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) # login user login_user(driver, "editoruser", "secret") # make sure login was successful self.assertEqual("Logout", driver.find_element_by_xpath("//div[@id='inner']/div[2]/a/div").text) driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) # Manage Resources -> Manage all resources mouse_over(driver, driver.find_element_by_link_text("Manage Resources")) driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) click_menu_item(driver, driver.find_element_by_link_text("Manage all resources")) driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) # Add resource driver.find_element_by_link_text("Add Resource").click() # create text corpus driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) Select(driver.find_element_by_id("id_resourceType")).select_by_visible_text("Corpus") driver.find_element_by_id("id_corpusTextInfo").click() driver.find_element_by_id("id_submit").click() driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) self.assertEqual("Add Resource", driver.find_element_by_css_selector("#content > h1").text) # remember root window id root_id = driver.current_window_handle # distribution popup driver.find_element_by_css_selector("img[alt=\"Add information\"]").click() driver.switch_to_window("id_distributionInfo") # check sorting of Availability self.assertEqual("Available - Restricted Use", driver.find_element_by_xpath( "//select[@id='id_availability']/option[2]").text) self.assertEqual("Available - Unrestricted Use", driver.find_element_by_xpath( "//select[@id='id_availability']/option[3]").text) self.assertEqual("Not Available Through Meta Share", driver.find_element_by_xpath( "//select[@id='id_availability']/option[4]").text) self.assertEqual("Under Negotiation", driver.find_element_by_xpath( "//select[@id='id_availability']/option[5]").text) save_and_close(driver, root_id) # corpus info text popup driver.find_element_by_id("add_id_corpusTextInfo-0").click() driver.switch_to_window("id_corpusTextInfo__dash__0") # check sorting of Linguality self.assertEqual("Bilingual", driver.find_element_by_xpath( "//select[@id='id_form-0-lingualityType']/option[2]").text) self.assertEqual("Monolingual", driver.find_element_by_xpath( "//select[@id='id_form-0-lingualityType']/option[3]").text) self.assertEqual("Multilingual", driver.find_element_by_xpath( "//select[@id='id_form-0-lingualityType']/option[4]").text) # check sorting of Size unit self.assertEqual("4 - Grams", driver.find_element_by_xpath( "//select[@id='id_sizeinfotype_model_set-0-sizeUnit']/option[2]").text) self.assertEqual("5 - Grams", driver.find_element_by_xpath( "//select[@id='id_sizeinfotype_model_set-0-sizeUnit']/option[3]").text) self.assertEqual("Articles", driver.find_element_by_xpath( "//select[@id='id_sizeinfotype_model_set-0-sizeUnit']/option[4]").text) self.assertEqual("Bigrams", driver.find_element_by_xpath( "//select[@id='id_sizeinfotype_model_set-0-sizeUnit']/option[5]").text) self.assertEqual("Bytes", driver.find_element_by_xpath( "//select[@id='id_sizeinfotype_model_set-0-sizeUnit']/option[6]").text) self.assertEqual("Classes", driver.find_element_by_xpath( "//select[@id='id_sizeinfotype_model_set-0-sizeUnit']/option[7]").text) self.assertEqual("Concepts", driver.find_element_by_xpath( "//select[@id='id_sizeinfotype_model_set-0-sizeUnit']/option[8]").text) self.assertEqual("Diphones", driver.find_element_by_xpath( "//select[@id='id_sizeinfotype_model_set-0-sizeUnit']/option[9]").text) self.assertEqual("Elements", driver.find_element_by_xpath( "//select[@id='id_sizeinfotype_model_set-0-sizeUnit']/option[10]").text) # skip to end of list self.assertEqual("Words", driver.find_element_by_xpath( "//select[@id='id_sizeinfotype_model_set-0-sizeUnit']/option[50]").text)
def test_LR_creation_tool(self): # set up the current manager user profile so that it doesn't have any # default editor groups self.manager_user.get_profile().default_editor_groups.clear() driver = self.driver driver.get(self.base_url) ss_path = setup_screenshots_folder( "PNG-metashare.repository.seltests.test_editor.EditorTest", "LR_creation_tool") driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) # login user login_user(driver, "manageruser", "secret") # make sure login was successful self.assertEqual("Logout", driver.find_element_by_xpath("//div[@id='inner']/div[2]/a/div").text) driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) # Manage Resources -> Manage all resources mouse_over(driver, driver.find_element_by_link_text("Manage Resources")) driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) click_menu_item(driver, driver.find_element_by_link_text("Manage all resources")) driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) # Add resource driver.find_element_by_link_text("Add Resource").click() # create tool driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) Select(driver.find_element_by_id("id_resourceType")).select_by_visible_text( "Tool / Service") driver.find_element_by_id("id_submit").click() driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) self.assertEqual("Add Resource", driver.find_element_by_css_selector("#content > h1").text) # remember root window id root_id = driver.current_window_handle # add required fields # (add an invalid character in the resource name to verify that invalid # characters are found in DictField values) driver.find_element_by_name("key_form-0-resourceName_0").clear() driver.find_element_by_name("key_form-0-resourceName_0").send_keys("en") driver.find_element_by_name("val_form-0-resourceName_0").clear() driver.find_element_by_name("val_form-0-resourceName_0").send_keys(u"Test\u000b Tool") driver.find_element_by_name("key_form-0-description_0").clear() driver.find_element_by_name("key_form-0-description_0").send_keys("en") driver.find_element_by_name("val_form-0-description_0").clear() driver.find_element_by_name("val_form-0-description_0").send_keys("Test Description") driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) # distribution popup driver.find_element_by_css_selector("img[alt=\"Add information\"]").click() self.fill_distribution(driver, ss_path, root_id) # contact person popup driver.find_element_by_css_selector("img[alt=\"Add Another\"]").click() self.fill_contact_person(driver, ss_path, root_id) # tool info popup driver.find_element_by_id("edit_id_toolServiceInfo").click() driver.switch_to_window("edit_id_toolServiceInfo") Select(driver.find_element_by_id("id_toolServiceType")).select_by_visible_text("Tool") Select(driver.find_element_by_id("id_languageDependent")).select_by_visible_text("Yes") # save and close tool info popup driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) save_and_close(driver, root_id) # add both optional "Identifier" and "Original metadata schema" fields # (add an invalid character here to verify that invalid characters are # found in both MultiTextField values and in XmlCharField values) _identifier_elem = \ driver.find_element_by_xpath("//ul[@id='widget_1']/li[1]/input") _identifier_elem.clear() _identifier_elem.send_keys(u"test \u0007identifier") driver.find_element_by_id("id_form-2-0-originalMetadataSchema").clear() driver.find_element_by_id("id_form-2-0-originalMetadataSchema") \ .send_keys(u"test metadata schema \u0016A") # save tool - we expect three error messages due to the invalid # characters in some fields: driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) driver.find_element_by_name("_save").click() # TODO remove this workaround when Selenium starts working again as intended time.sleep(1) driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) self.assertTrue(driver.find_element_by_xpath( "//div[@id='form-0']/fieldset/div/ul/li").text.startswith( "The character at position 5 () must not be used.")) self.assertTrue(driver.find_element_by_xpath( "//ul[@id='widget_1']/li[1]/small").text.startswith( "The character at position 6 () must not be used.")) self.assertTrue(driver.find_element_by_xpath( "//div[@id='form-2-0']/fieldset/div[3]/ul/li").text.startswith( "The character at position 22 () must not be used.")) # correct the resource name now driver.find_element_by_name("val_form-0-resourceName_0").clear() driver.find_element_by_name("val_form-0-resourceName_0").send_keys("Test Tool") # correct the optional "Identifier" field now _identifier_elem = \ driver.find_element_by_xpath("//ul[@id='widget_1']/li[1]/input") _identifier_elem.clear() _identifier_elem.send_keys(u"test identifier") # correct the optional "Original metadata schema" field now driver.find_element_by_id("id_form-2-0-originalMetadataSchema").clear() driver.find_element_by_id("id_form-2-0-originalMetadataSchema") \ .send_keys(u"test metadata schema") # save tool driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) driver.find_element_by_name("_save").click() # TODO remove this workaround when Selenium starts working again as intended time.sleep(1) driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) self.assertEqual("The Resource \"Test Tool\" was added successfully.", driver.find_element_by_css_selector("li.info").text) # make sure that the editor groups list of the created resource is empty # (which resembles the default editor groups list of the creating user) _created_res = resourceInfoType_model.objects.get(pk=1) self.assertEqual(0, _created_res.editor_groups.count(), 'the created resource must not have any editor groups (just like ' \ 'the default groups set of the creating user)') # for the following tests to not fail, we have to add the resource to an # editor group again which is managed by the current user _created_res.editor_groups.add(self.test_editor_group) # make sure an internal resource cannot be published self.publish(driver) self.assertEqual("internal", driver.find_element_by_xpath("//table[@id='result_list']/tbody/tr[1]/td[3]").text) self.assertEqual("Only ingested resources can be published.", driver.find_element_by_css_selector("ul.messagelist>li.error").text) # ingest resource self.ingest(driver) self.assertEqual("ingested", driver.find_element_by_xpath("//table[@id='result_list']/tbody/tr[1]/td[3]").text) self.assertEqual("Successfully ingested 1 internal resource.", driver.find_element_by_css_selector("ul.messagelist>li").text) # publish resource self.publish(driver) self.assertEqual("published", driver.find_element_by_xpath("//table[@id='result_list']/tbody/tr[1]/td[3]").text) self.assertEqual("Successfully published 1 ingested resource.", driver.find_element_by_css_selector("ul.messagelist>li").text) # delete resource self.delete(driver) self.assertEqual("Successfully deleted 1 resource.", driver.find_element_by_css_selector("ul.messagelist>li").text)
def test_LR_creation_lex_resource_text(self): driver = self.driver driver.get(self.base_url) ss_path = setup_screenshots_folder( "PNG-metashare.repository.seltests.test_editor.EditorTest", "LR_creation_lex_resource_text") driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) # login user login_user(driver, "manageruser", "secret") # make sure login was successful self.assertEqual("Logout", driver.find_element_by_xpath("//div[@id='inner']/div[2]/a/div").text) driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) # Manage Resources -> Manage all resources mouse_over(driver, driver.find_element_by_link_text("Manage Resources")) driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) click_menu_item(driver, driver.find_element_by_link_text("Manage all resources")) driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) # Add resource driver.find_element_by_link_text("Add Resource").click() # create lexical resource driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) Select(driver.find_element_by_id("id_resourceType")).select_by_visible_text( "Lexical conceptual resource") driver.find_element_by_id("id_submit").click() driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) self.assertEqual("Add Resource", driver.find_element_by_css_selector("#content > h1").text) # remember root window id root_id = driver.current_window_handle # add required fields driver.find_element_by_name("key_form-0-resourceName_0").clear() driver.find_element_by_name("key_form-0-resourceName_0").send_keys("en") driver.find_element_by_name("val_form-0-resourceName_0").clear() driver.find_element_by_name("val_form-0-resourceName_0").send_keys("Test Lexical Resource Text") driver.find_element_by_name("key_form-0-description_0").clear() driver.find_element_by_name("key_form-0-description_0").send_keys("en") driver.find_element_by_name("val_form-0-description_0").clear() driver.find_element_by_name("val_form-0-description_0").send_keys("Test Description") driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) # distribution popup driver.find_element_by_css_selector("img[alt=\"Add information\"]").click() self.fill_distribution(driver, ss_path, root_id) # contact person popup driver.find_element_by_css_selector("img[alt=\"Add Another\"]").click() self.fill_contact_person(driver, ss_path, root_id) # lexical resource general info popup driver.find_element_by_id("edit_id_lexiconInfo").click() driver.switch_to_window("edit_id_lexiconInfo") Select(driver.find_element_by_id("id_lexicalConceptualResourceType")).select_by_visible_text( "Word List") driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) save_and_close(driver, root_id) # lexical resource text info popup driver.find_element_by_id("add_id_lexicalConceptualResourceTextInfo").click() driver.switch_to_window("id_lexicalConceptualResourceTextInfo") Select(driver.find_element_by_id("id_form-0-lingualityType")).select_by_visible_text( "Monolingual") # lexical resource text info / language self.fill_language(driver, ss_path, "languageinfotype_model_set-0-") # lexical resource text info / size self.fill_text_size(driver, ss_path, "sizeinfotype_model_set-0-") # save and close lexical resource text info popup driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) save_and_close(driver, root_id) # save lexical resource text driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) driver.find_element_by_name("_save").click() # TODO remove this workaround when Selenium starts working again as intended time.sleep(1) driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) self.assertEqual("The Resource \"Test Lexical Resource Text\" was added successfully.", driver.find_element_by_css_selector("li.info").text) # check the editor group of the resource is the default editor group of the user self.assertEqual(self.test_editor_group.name, driver.find_element_by_xpath("//table[@id='result_list']/tbody/tr[1]/td[5]").text) # make sure an internal resource cannot be published self.publish(driver) self.assertEqual("internal", driver.find_element_by_xpath("//table[@id='result_list']/tbody/tr[1]/td[3]").text) self.assertEqual("Only ingested resources can be published.", driver.find_element_by_css_selector("ul.messagelist>li.error").text) # ingest resource self.ingest(driver) self.assertEqual("ingested", driver.find_element_by_xpath("//table[@id='result_list']/tbody/tr[1]/td[3]").text) self.assertEqual("Successfully ingested 1 internal resource.", driver.find_element_by_css_selector("ul.messagelist>li").text) # publish resource self.publish(driver) self.assertEqual("published", driver.find_element_by_xpath("//table[@id='result_list']/tbody/tr[1]/td[3]").text) self.assertEqual("Successfully published 1 ingested resource.", driver.find_element_by_css_selector("ul.messagelist>li").text) # delete resource self.delete(driver) self.assertEqual("Successfully deleted 1 resource.", driver.find_element_by_css_selector("ul.messagelist>li").text)
def test_LR_creation_tool(self): driver = self.driver driver.get(self.base_url) ss_path = setup_screenshots_folder( "PNG-metashare.repository.seltests.test_editor.EditorTest", "LR_creation_tool") driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) # login user login_user(driver, "manageruser", "secret") # make sure login was successful self.assertEqual("Logout", driver.find_element_by_xpath("//div[@id='inner']/div[2]/a[3]/div").text) driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) # Editor driver.find_element_by_css_selector("div.button.middle_button").click() driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) # Share/Create Resource mouse_over(driver, driver.find_element_by_link_text("Share/Create")) driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) #driver.find_element_by_link_text("Resource").click() click_menu_item(driver, driver.find_element_by_link_text("Resource")) # create tool driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) Select(driver.find_element_by_id("id_resourceType")).select_by_visible_text( "Tool / Service") driver.find_element_by_id("id_submit").click() driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) self.assertEqual("Add Resource", driver.find_element_by_css_selector("#content > h1").text) # remember root window id root_id = driver.current_window_handle # add required fields driver.find_element_by_name("key_form-0-resourceName_0").clear() driver.find_element_by_name("key_form-0-resourceName_0").send_keys("en") driver.find_element_by_name("val_form-0-resourceName_0").clear() driver.find_element_by_name("val_form-0-resourceName_0").send_keys("Test Tool") driver.find_element_by_name("key_form-0-description_0").clear() driver.find_element_by_name("key_form-0-description_0").send_keys("en") driver.find_element_by_name("val_form-0-description_0").clear() driver.find_element_by_name("val_form-0-description_0").send_keys("Test Description") driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) # distribution popup driver.find_element_by_css_selector("img[alt=\"Add information\"]").click() self.fill_distribution(driver, ss_path, root_id) # contact person popup driver.find_element_by_css_selector("img[alt=\"Add Another\"]").click() self.fill_contact_person(driver, ss_path, root_id) # tool info popup driver.find_element_by_id("edit_id_toolServiceInfo").click() driver.switch_to_window("edit_id_toolServiceInfo") Select(driver.find_element_by_id("id_toolServiceType")).select_by_visible_text("tool") Select(driver.find_element_by_id("id_languageDependent")).select_by_visible_text("Yes") # save and close tool info popup driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) save_and_close(driver, root_id) # save tool driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) driver.find_element_by_name("_save").click() driver.get_screenshot_as_file('{0}/{1}.png'.format(ss_path, time.time())) self.assertEqual("The Resource \"Test Tool\" was added successfully.", driver.find_element_by_css_selector("li.info").text) # ingest resource self.ingest(driver) self.assertEqual("ingested", driver.find_element_by_xpath("//table[@id='result_list']/tbody/tr[1]/td[3]").text) # publish resource self.publish(driver) self.assertEqual("published", driver.find_element_by_xpath("//table[@id='result_list']/tbody/tr[1]/td[3]").text) # delete resource self.delete(driver) self.assertEqual("Successfully deleted 1 Resource.", driver.find_element_by_css_selector("li.info").text)