Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CC Automation] Add test covering interaction between File screen and published Content Views #15414

Merged
merged 5 commits into from
Jun 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 40 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,42 @@ 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 upload content into it
2. Add file repo to a CV, and publish it
3. Create another CV, and publish it
4. Navigate to the Content -> File section of the UI

:expectedresults: Only the Content View with the file repo is displayed.

:BZ: 2026701

:customerscenario: true
sambible marked this conversation as resolved.
Show resolved Hide resolved

:Verifies: SAT-17081
"""
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
Loading