comparison tests/e2e/libervia-web/test_libervia-web.py @ 4227:dfccc90cacc6

tests: fix and update tests: - update code to newer version of `sh` - update code to newer version of `selenium` - update names of OMEMO algorithms - fix paths and names used to mount source to the test container - skip modules using `Gst` and `PyQt` when they are not available.
author Goffi <goffi@goffi.org>
date Tue, 05 Mar 2024 17:31:56 +0100
parents de133b180941
children
comparison
equal deleted inserted replaced
4226:3f7ca590a5da 4227:dfccc90cacc6
16 # You should have received a copy of the GNU Affero General Public License 16 # You should have received a copy of the GNU Affero General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. 17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 18
19 import os 19 import os
20 import re 20 import re
21
21 import pytest 22 import pytest
23
22 from helium import ( 24 from helium import (
23 go_to, write, press, click, drag_file, find_all, wait_until, S, Text, Link, Button, 25 Button,
24 select, scroll_down, get_driver, ENTER 26 ENTER,
27 Link,
28 S,
29 Text,
30 click,
31 drag_file,
32 find_all,
33 get_driver,
34 go_to,
35 press,
36 scroll_down,
37 select,
38 wait_until,
39 write,
25 ) 40 )
41 from selenium.webdriver.common.by import By
26 42
27 43
28 if os.getenv("LIBERVIA_TEST_ENV_E2E_WEB") is None: 44 if os.getenv("LIBERVIA_TEST_ENV_E2E_WEB") is None:
29 pytest.skip( 45 pytest.skip(
30 "skipping end-to-end tests, we are not in a test environment for Libervia", 46 "skipping end-to-end tests, we are not in a test environment for Libervia",
212 wait_until(Text("Success").exists) 228 wait_until(Text("Success").exists)
213 assert Link("create").exists() 229 assert Link("create").exists()
214 assert Link("manage invitations").exists() 230 assert Link("manage invitations").exists()
215 item = Link("test item") 231 item = Link("test item")
216 assert item.exists() 232 assert item.exists()
217 labels_elt = item.web_element.find_element_by_class_name("xmlui_field__labels") 233 labels_elt = item.web_element.find_element(By.CLASS_NAME, "xmlui_field__labels")
218 labels = [t.text for t in labels_elt.find_elements_by_tag_name("span")] 234 labels = [t.text for t in labels_elt.find_elements(By.TAG_NAME, "span")]
219 assert labels == ["label 1", "label 2"] 235 assert labels == ["label 1", "label 2"]
220 236
221 @pytest.mark.dependency(depends=["create_generic_list_item"]) 237 @pytest.mark.dependency(depends=["create_generic_list_item"])
222 def test_list_item_can_be_displayed(self): 238 def test_list_item_can_be_displayed(self):
223 go_to(self.TEST_GENERIC_LIST_URL) 239 go_to(self.TEST_GENERIC_LIST_URL)