-
Notifications
You must be signed in to change notification settings - Fork 115
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
[CV Eval] add test for customer case bz #15268
base: master
Are you sure you want to change the base?
Changes from 3 commits
7548d59
0f20700
9945faa
fe86899
3c51654
1512587
b58f008
8ab6a45
b7eb6a2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -14,6 +14,10 @@ | |||||||||||||
|
||||||||||||||
from fauxfactory import gen_string | ||||||||||||||
import pytest | ||||||||||||||
from widgetastic_patternfly4.dropdown import DropdownItemDisabled | ||||||||||||||
|
||||||||||||||
from robottelo.constants import REPOS | ||||||||||||||
from robottelo.exceptions import CLIReturnCodeError | ||||||||||||||
|
||||||||||||||
from robottelo.constants import REPOS | ||||||||||||||
|
||||||||||||||
|
@@ -108,3 +112,51 @@ 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() | ||||||||||||||
|
||||||||||||||
|
||||||||||||||
def test_republish_metadata(session, function_sca_manifest_org, target_sat): | ||||||||||||||
"""Verify that you can't republish metadata from the UI, and you can from the CLI | ||||||||||||||
:id: 96ef4fe5-dec4-4919-aa4d-b8806d90b654 | ||||||||||||||
:steps: | ||||||||||||||
1. Enable and Sync RH Repo | ||||||||||||||
2. Add repo to a CV | ||||||||||||||
3. Publish the CV | ||||||||||||||
4. Navigate to the published Version's page | ||||||||||||||
5. Verify that you can't click the "republish metadata" option from the UI | ||||||||||||||
6. Verify that you can't republish metadata from the cli without the force option | ||||||||||||||
7. Verify that you can republish metadata from the CLI using the --force option | ||||||||||||||
Comment on lines
+126
to
+128
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
:expectedresults: You can't republish RH Repo metadata from the UI, and can from the CLI with --force | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
:CaseImportance: Critical | ||||||||||||||
:BZ: 2227271 | ||||||||||||||
:customerscenario: true | ||||||||||||||
""" | ||||||||||||||
rh_repo_id = target_sat.api_factory.enable_sync_redhat_repo( | ||||||||||||||
REPOS['rhae2.9_el8'], function_sca_manifest_org.id | ||||||||||||||
) | ||||||||||||||
rh_repo = target_sat.api.Repository(id=rh_repo_id).read() | ||||||||||||||
cv = target_sat.api.ContentView(organization=function_sca_manifest_org).create() | ||||||||||||||
cv = target_sat.api.ContentView(id=cv.id, repository=[rh_repo]).update(["repository"]) | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
cv.publish() | ||||||||||||||
version = cv.read().version[0].read() | ||||||||||||||
with target_sat.ui_session() as session: | ||||||||||||||
session.organization.select(org_name=function_sca_manifest_org.name) | ||||||||||||||
with pytest.raises(DropdownItemDisabled) as error: | ||||||||||||||
session.contentview_new.click_version_dropdown( | ||||||||||||||
sambible marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||
cv.name, 'Version 1.0', "Republish repository metadata" | ||||||||||||||
sambible marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||
) | ||||||||||||||
assert ( | ||||||||||||||
'Item "Republish repository metadata" of dropdown ".//div[@data-ouia-component-id="cv-version-header-actions-dropdown"]" is disabled' | ||||||||||||||
sambible marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||
in error.value.args[0] | ||||||||||||||
) | ||||||||||||||
with pytest.raises(CLIReturnCodeError) as error: | ||||||||||||||
target_sat.cli.ContentView.version_republish_repositories( | ||||||||||||||
{'id': version.id, 'force': 'false'} | ||||||||||||||
) | ||||||||||||||
Comment on lines
+150
to
+152
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Passing |
||||||||||||||
assert ( | ||||||||||||||
'Could not republish the Content View:\n Metadata republishing is dangerous on content view versions with repositories with the \'Complete Mirroring\' mirroring policy.' | ||||||||||||||
in error.value.stderr | ||||||||||||||
) | ||||||||||||||
# This returns '' when successful, so this is just run to test that it doesn't throw any errors. | ||||||||||||||
target_sat.cli.ContentView.version_republish_repositories( | ||||||||||||||
{'id': version.id, 'force': 'true'} | ||||||||||||||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.