Skip to content

Commit

Permalink
ajout test edit token with filter
Browse files Browse the repository at this point in the history
  • Loading branch information
Juliettejns committed Jul 2, 2024
1 parent 2b11ebc commit ee34646
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
5 changes: 0 additions & 5 deletions tests/test_selenium/test_corpus_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,18 +731,13 @@ def test_registration_filters(self):
self.writeMultiline(self.driver_find_element_by_id("tokens"), PLAINTEXT_CORPORA["Wauchier"]["data"])
self.driver_find_element_by_id("label_checkbox_create").click()
self.driver_find_element_by_id("punct").click()
self.driver.save_screenshot("./test_registration_filter0.png")
self.driver_find_element_by_id("submit").click()
self.driver.save_screenshot("./test_registration_filter.png")
self.driver.implicitly_wait(15)

self.driver_find_element_by_link_text("Dashboard").click()
controllists_dashboard = self.driver_find_element_by_id("control_lists-dashboard")
self.driver.save_screenshot("./test_registration_filter2.png")
self.element_find_element_by_partial_link_text(controllists_dashboard, "Wauchier").click()
self.driver.save_screenshot("./test_registration_filter3.png")
self.driver_find_element_by_link_text("Ignore values").click()
self.driver.save_screenshot("./test_registration_filter4.png")
punct = self.driver_find_element_by_id("punct")
numeral = self.driver_find_element_by_id('numeral')
self.assertTrue(punct.get_property("checked"))
Expand Down
24 changes: 24 additions & 0 deletions tests/test_selenium/test_token_correct.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,28 @@ def test_edit_morph_with_allowed(self):
self.assert_saved(row)
self.assert_token_has_values(token, lemma="mout", POS="ADVgen", morph="NOMB.=s|GENRE=m|CAS=n")

def test_edit_token_with_filter(self):
self.addCorpus(with_token=True)
self.driver.save_screenshot("./test_edit_token_filter1.png")
self.driver.refresh()
# modifier les filtres
self.driver_find_element_by_link_text("Dashboard").click()
controllists_dashboard = self.driver_find_element_by_id("control_lists-dashboard")
self.driver.save_screenshot("./test_edit_token_filter2.png")
self.element_find_element_by_partial_link_text(controllists_dashboard, "Wauchier").click()
self.driver.save_screenshot("./test_edit_token_filter4.png")
self.driver_find_element_by_link_text("Ignore values").click()
self.driver.save_screenshot("./test_edit_token_filter5.png")
self.driver_find_element_by_id("punct").click()
self.driver_find_element_by_id("submit").click()
self.driver.save_screenshot("./test_edit_token_filter6.png")
self.driver.implicitly_wait(15)

# ajouter corpus
token, status_text, row = self.edith_nth_row_value(",", id_row="1")
self.assert_token_has_values(token, lemma=",")
self.assert_saved(row)


class TestTokensCorrectFloovant(TokenCorrectBase):
CORPUS = "floovant"
Expand Down Expand Up @@ -164,6 +186,8 @@ def test_edit_token_with_same_value(self):
self.assertNotIn("table-changed", row.get_attribute("class"))




class TestTokensEditTwoCorpora(TokenCorrect2CorporaBase):
CORPUS = "wauchier"
CORPUS_ID = "1"
Expand Down
1 change: 1 addition & 0 deletions tests/test_selenium/test_tokens_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,4 @@ def test_edit_delete(self):
[("Addition", "oulala", ""), ("Deletion", "", "oulala")],
"History should be saved"
)

0 comments on commit ee34646

Please sign in to comment.