From 717ad223647e39a215177981910389ade1e83c59 Mon Sep 17 00:00:00 2001 From: Juliettejns Date: Fri, 15 Mar 2024 10:00:44 +0100 Subject: [PATCH] ajout test corpus name unique user --- tests/test_selenium/test_corpus_init.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/test_selenium/test_corpus_init.py b/tests/test_selenium/test_corpus_init.py index 07091ab4..3fc4a8fd 100644 --- a/tests/test_selenium/test_corpus_init.py +++ b/tests/test_selenium/test_corpus_init.py @@ -602,3 +602,24 @@ def test_registration_without_field_length_violation(self): self.driver_find_element_by_id("submit").click() self.driver.implicitly_wait(15) self.assertFalse(self.driver_find_elements_by_css_selector(".alert.alert-danger")) + + def test_corpus_name_unique_user(self): + self.add_control_lists() + self.add_user("foo", "foo") + self.login("%s.%s@ppa.fr" % ("foo", "foo"), self.app.config['ADMIN_PASSWORD']) + self.addCorpus("wauchier", cl=False) + self.add_user("bar", "bar") + self.login("%s.%s@ppa.fr" % ("bar", "bar"), self.app.config['ADMIN_PASSWORD']) + self.driver_find_element_by_id("new_corpus_link").click() + self.driver_find_element_by_id("corpusName").send_keys("Wauchier") + self.driver_find_element_by_id("label_checkbox_reuse").click() + self.driver_find_element_by_id("control_list_select").click() + + self.writeMultiline( + self.driver_find_element_by_id("tokens"), + f"form\tlemma\tPOS\tmorph\nSOIGNORS\tseignor\tNOMcom\tNOMB.=p|GENRE=m|CAS=n" + ) + self.driver_find_element_by_id("submit").click() + self.driver.get_screenshot_as_file('/home/jjanes/Documents/pyrrha/img.png') + self.driver.implicitly_wait(5) + self.assertFalse(self.driver_find_elements_by_css_selector(".alert.alert-danger"))