Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

[1LP][RFR] Test for Embedded Ansible repository refresh #9868

Merged
merged 3 commits into from
Feb 7, 2020
Merged
Show file tree
Hide file tree
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
21 changes: 21 additions & 0 deletions cfme/ansible/repositories.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Page model for Automation/Ansible/Repositories"""
import attr
from dateutil.parser import parse
from navmazing import NavigateToAttribute
from navmazing import NavigateToSibling
from widgetastic.exceptions import NoSuchElementException
Expand Down Expand Up @@ -157,6 +158,26 @@ def status(self):
view = navigate_to(self, "Details")
return view.entities.summary("Properties").get_text_of("Status")

@property
def created_date(self):
"""Repository Creation date/time

Returns:
:py:class:`date` object return for repository create date/time.
"""
view = navigate_to(self, 'Details')
return parse(view.entities.summary("Properties").get_text_of("Created On"))

@property
def updated_date(self):
"""Repository Update date/time

Returns:
:py:class:`date` object return for repository udpate date/time.
"""
view = navigate_to(self, 'Details')
return parse(view.entities.summary("Properties").get_text_of("Updated On"))

def update(self, updates):
"""Update the repository in the UI.

Expand Down
27 changes: 27 additions & 0 deletions cfme/tests/ansible/test_embedded_ansible_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,3 +511,30 @@ def test_embed_tower_repo_add_new_zone(appliance, ansible_repository, new_zone,
)
request.addfinalizer(repository.delete_if_exists)
assert repository.exists


@pytest.mark.tier(3)
@pytest.mark.rhel_testing
def test_embedded_ansible_repository_refresh(ansible_repository):
"""
Test if ansible playbooks list is updated in the UI when "Refresh this
Repository"

Polarion:
assignee: sbulage
casecomponent: Ansible
caseimportance: critical
initialEstimate: 1/6h
tags: ansible_embed
"""
view = navigate_to(ansible_repository, "Details")
view.toolbar.configuration.item_select("Refresh this Repository", handle_alert=True)

# Initially values for both created and updated repository are same,
# hence comparing updated value with created after refreshing repository.
wait_for(
lambda: ansible_repository.created_date < ansible_repository.updated_date,
fail_func=view.toolbar.refresh.click,
delay=2,
timeout="5m",
)
71 changes: 0 additions & 71 deletions cfme/tests/ansible/test_embedded_ansible_manual.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,77 +97,6 @@ def test_embed_tower_exec_play_with_creds(appliance, provider):
pass


@pytest.mark.tier(3)
def test_embed_tower_refresh_provider_repo_list():
"""
Test if ansible playbooks list is updated in the UI when "Refresh
Selected Ansible Repositories" clicked in the repository list.

Polarion:
assignee: sbulage
casecomponent: Ansible
caseimportance: critical
initialEstimate: 1/6h
tags: ansible_embed
"""
pass


@pytest.mark.tier(3)
def test_embed_tower_refresh_provider_repo_details():
"""
Test if ansible playbooks list is updated in the UI when "Refresh this
Repository" clicked in the repository details view.

Polarion:
assignee: sbulage
casecomponent: Ansible
caseimportance: critical
initialEstimate: 1/6h
tags: ansible_embed
"""
pass


@pytest.mark.tier(1)
def test_embed_tower_ui_requests_notifications_negative():
"""
After all processes are running make sure websockets are enabled then
add a repo with the same name as a current repo and check the
notifications display correctly. With a Red banner to show it was
unsuccessful.

Bugzilla:
1471868

Polarion:
assignee: sbulage
casecomponent: Ansible
initialEstimate: 1/6h
tags: ansible_embed
"""
pass


@pytest.mark.tier(1)
def test_embed_tower_ui_requests_notifications():
"""
After all processes are running and websockets role is enabled, add a
new repo to embedded tower and check the notifications display
correctly. With a Green banner to show it was successful.

Bugzilla:
1471868

Polarion:
assignee: sbulage
casecomponent: Ansible
initialEstimate: 1/6h
tags: ansible_embed
"""
pass


@pytest.mark.tier(1)
def test_embed_ansible_catalog_items():
"""
Expand Down