tests (e2e/web): add basic tests for generic lists
This commit is contained in:
parent
b7c1579919
commit
b374f17eb6
1 changed files with 52 additions and 1 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in a new issue