merge bookmark @

This commit is contained in:
Goffi 2021-11-12 17:21:24 +01:00
commit 14d00a9dda
2 changed files with 327 additions and 201 deletions

View file

@ -21,7 +21,7 @@ import re
import pytest
from helium import (
go_to, write, press, click, drag_file, find_all, wait_until, S, Text, Link, Button,
get_driver, ENTER
select, scroll_down, get_driver, ENTER
)
@ -178,3 +178,54 @@ class TestPhotos:
click("test album")
wait_until(lambda: not S("#loading_screen").exists())
assert len(find_all(S("img.is-photo-thumbnail"))) == 2
class TestLists:
TEST_GENERIC_LIST_URL = (
"https://libervia-web.test:8443/lists/view/account1@server1.test/"
"fdp%2Fsubmitted%2Forg.salut-a-toi.tickets%3A0_test-generic-list"
)
@pytest.mark.dependency(name="create_generic_list")
def test_user_can_create_generic(self, log_in_account1):
go_to("https://libervia-web.test:8443/lists/view")
click("create a list")
tickets_btn = S("//span[text()='Tickets']")
click(tickets_btn)
write("test-generic-list", "name of the list")
click("create list")
wait_until(Text("Success").exists)
@pytest.mark.dependency(
name="create_generic_list_item", depends=["create_generic_list"]
)
def test_user_can_create_generic_list_item(self):
go_to(self.TEST_GENERIC_LIST_URL)
click("create")
write("test item", "title")
write("label 1, label 2", "labels")
select("type", "feature request")
write("this is a test body", "body")
scroll_down(600)
click("create list item")
wait_until(Text("Success").exists)
assert Link("create").exists()
assert Link("manage invitations").exists()
item = Link("test item")
assert item.exists()
labels_elt = item.web_element.find_element_by_class_name("xmlui_field__labels")
labels = [t.text for t in labels_elt.find_elements_by_tag_name("span")]
assert labels == ["label 1", "label 2"]
@pytest.mark.dependency(depends=["create_generic_list_item"])
def test_list_item_can_be_displayed(self):
go_to(self.TEST_GENERIC_LIST_URL)
item = Link("test item")
# FIXME: we can't click on the item created above with Selenium, looks like a
# Selenium bug, to be checked
go_to(item.href)
item_title = Text("test item")
assert item_title.exists()
item_body = Text("this is a test body")
assert item_body.exists()

View file

@ -226,7 +226,7 @@ def use_e2e_env():
docker_compose.up("-d")
p = docker_compose.exec(
"-T", "--workdir", "/src/libervia-backend/tests", "backend",
"--workdir", "/src/libervia-backend/tests", "backend",
"pytest", "-o", "cache_dir=/tmp", *sys.argv[1:], color="yes",
_in=sys.stdin, _out=live_out, _out_bufsize=0, _err=live_err, _err_bufsize=0,
_bg=True