Skip to content

Commit

Permalink
[CC Automation] Add test covering interaction between File screen and…
Browse files Browse the repository at this point in the history
… published Content Views (#15414)

* Add test for customer case BZ

* Update docstring

Co-authored-by: vijay sawant <[email protected]>

* Fix whitespace issue

---------

Co-authored-by: vijay sawant <[email protected]>
  • Loading branch information
sambible and vijaysawant authored Jun 21, 2024
1 parent fba99dc commit 921df06
Showing 1 changed file with 40 additions and 1 deletion.
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
: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

0 comments on commit 921df06

Please sign in to comment.