Skip to content

Commit

Permalink
Add test for customer case BZ
Browse files Browse the repository at this point in the history
  • Loading branch information
sambible committed Jun 14, 2024
1 parent 423864f commit 5d68ec6
Showing 1 changed file with 38 additions and 1 deletion.
39 changes: 38 additions & 1 deletion tests/foreman/ui/test_contentview.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from fauxfactory import gen_string
import pytest

from robottelo.constants import REPOS
from robottelo.constants import FAKE_FILE_NEW_NAME, REPOS, DataFile


@pytest.mark.tier2
Expand Down Expand Up @@ -108,3 +108,40 @@ def test_no_blank_page_on_language_switch(session, target_sat, module_org):
with target_sat.ui_session(user=user.login, password=user_password) as session:
session.user.update(user.login, {'user.language': 'Français'})
assert session.contentview_new.read_french_lang_cv()


@pytest.mark.tier2
def test_file_cv_display(session, target_sat, module_org, module_product):
"""Content-> Files displays only the Content Views associated with that file
:id: 41719f2f-2170-4b26-b65f-2063a1eac7fb
:steps:
1. Create a File Repo, and publish content to it
2. Add it to a CV, and publish that CV
3. Create a seperate CV, and publish it as well.
4. Navigate to the Content -> File section of the UI
:expectedresults: The CV containing the file repo is displayed, and no other CVs.
:BZ: 2026701
:customerscenario: true
"""
repo_name = gen_string('alpha')
file_repo = target_sat.api.Repository(
product=module_product, name=f'{repo_name}_file_repo', content_type='file'
).create()
with open(DataFile.FAKE_FILE_NEW_NAME, 'rb') as handle:
file_repo.upload_content(files={'content': handle})
assert file_repo.read().content_counts['file'] == 1
cv = target_sat.api.ContentView(organization=module_org).create()
cv = target_sat.api.ContentView(id=cv.id, repository=[file_repo]).update(["repository"])
cv.publish()
cv2 = target_sat.api.ContentView(organization=module_org).create()
cv2.publish()
with target_sat.ui_session() as session:
session.organization.select(org_name=module_org.name)
file_values = session.file.read_cv_table(FAKE_FILE_NEW_NAME)
assert len(file_values) == 1
assert file_values[0]['Name'] == cv.name

0 comments on commit 5d68ec6

Please sign in to comment.