ui.test_acct_summary

Tests for account summary list.

caseautomation:automated
casecomponent:ui
caseimportance:high
caselevel:integration
requirement:Cloud Meter
testtype:functional
upstream:yes
integrade.tests.ui.test_acct_summary.sum_usage(usage)

Sum up the total number of seconds from an usage list.

Parameters:usage – A list with an even number of items where each pair indicates instances’ turn on and turn off events.
Returns:the total number of seconds that an instance was running.
integrade.tests.ui.test_acct_summary.test_account_date_filter(cloud_account_data, browser_session, ui_user, ui_acct_list)

The date dropdown should select and filter by previous months.

Id:

4eacca3e-c1a1-4de1-a874-bf730cd5596b

Description:

The default date filter of “Last 30 Days” is a dropdown that lists the 12 previous months, each of which can be selected to filter the account summary list to results from that month.

Steps:
  1. Create a cloud account with images and instances that ran for 1 day in a previous month on a day that is not within the last 30 days.
  2. Confirm these do not show up in the default 30 days filter.
  3. Click the dropdown and select the month in which the events were created.
  4. Confirm the account list now reflects the appropriate counts.
Expectedresults:
 

The counts shown in the account summary should reflect images and instances as they were counted within the time frame of the selected date filter.

integrade.tests.ui.test_acct_summary.test_account_name_filter(drop_account_data, cloud_account_data, browser_session, ui_user, ui_acct_list)

Account summary list can be filtered by name.

Id:

e8c290d0-481d-46c8-9da6-540ec4f8dc24

Description:

The filter should show matching accounts in the summary list.

Steps:
  1. Add two cloud account with a known and different names
  2. Enter a word in one account name, but not both, and apply the filter
  3. Click the link to clear the filters
Expectedresults:
 

The matching account should still be listed, the other account should not. When clearing the filter, both accounts should appear again.

integrade.tests.ui.test_acct_summary.test_empty(cloud_account_data, browser_session, ui_acct_list)

Account summaries should shown 0 images and instances without data.

Id:

d23e7196-3139-4017-8d46-6d430c5c4f84

Description:

Looking at account summaries for a date range after creation but without any observed instances should show 0 counts.

Steps:
  1. Add a cloud account
Expectedresults:
 

Both images and instance should show 0 counts

integrade.tests.ui.test_acct_summary.test_graph_modes(drop_account_data, cloud_account_data, browser_session, ui_acct_list)

Test the three “dimensions” of both RHEL and RHOCP usage.

Id:

753b6e47-501a-4cae-af20-a8eece9ef50d

Description:

Usage of images is measured in instance hours, GB of memory per hour, and vCPU core per hour. RHEL graphs default to Instance Hours while RHOCP default to GB Memory Hours, both can be viewed for either.

Steps:
  1. Look at an account with both RHEL and RHOCP usage with instances of different types
  2. Check the default type of each graph and that the value displayed matches
  3. Change each of the graphs to their two non-default types, confirming each
Expectedresults:
 
  • RHEL and RHOCP graphs should display Instance Hours and GB Memory Hours, respectively
  • Each graph can be changed to one of the other dimensions without affecting the other
  • Navigation returns to the default for each graph
  • GB Memory Hours displayed reflect the runtime of instances multiplied by the number of GB of the instance type
  • Core Hours displayed reflect the runtime of instances multiplied by the number of cores of the instance type
integrade.tests.ui.test_acct_summary.test_last_event_time(drop_account_data, cloud_account_data, browser_session, ui_acct_list)

Account summaries show the date and time of the last observed event.

Id:

c6d5c52c-0640-4409-8b43-7beb600217d7

Description:

Each account should display including the time when the last instance was observed being powered on or off.

Steps:
  1. Add a cloud account
  2. Inject instance and image data with a known event time powering on
  3. View the dashboard to observe the date shown
Expectedresults:
 
  • The date should be the same date as the known power on event
integrade.tests.ui.test_acct_summary.test_last_thirty_days(drop_account_data, cloud_account_data, browser_session, ui_acct_list)

Test the treatment of runs that start and stop across the boundary.

Id:

db535c33-09f7-471d-afc3-5ca6dc16b33b

Description:

Test the treatment of runs that start and stop across the boundary.

Steps:
  1. run an instance from 45 days ago to 15 days ago, which means it was running when the 30 day window began and ended within it.
  2. Check the runtime on the graphs and the summary rows
Expectedresults:
 
  • All the times should be the same
integrade.tests.ui.test_acct_summary.test_reused_image(cloud_account_data, browser_session, ui_acct_list)

An image used in multiple instance should only count once in summary.

Id:

87a32f9c-da2c-4834-81d5-696b50433bf8

Description:

Multiple instances using the same image should not cause those images to be counted multiple times.

Steps:
  1. Add a cloud account
  2. Create data for three instances with the same AMI ID
Expectedresults:
 

There should be 3 instances and only 1 instance

integrade.tests.ui.test_acct_summary.test_running_start_times(start, cloud_account_data, browser_session, ui_acct_list)

Instances left running from various days ago should count today.

Id:

e3f8972d-d1dc-4a59-950f-d7a5ad1491a5

Description:

An instance and its image should be counted if it was started in the past and has not yet been stopped. This should be counted if it started prior to the 30 day window, at cusps of the month filter, and within the 30 day range.

Steps:
  1. Add a cloud account
  2. Create instance data as begun at a certain day in the past
Expectedresults:
 
  • Confirm the instance and its image is counted once within the default date filter
integrade.tests.ui.test_acct_summary.test_running_tags(tag, cloud_account_data, browser_session, ui_acct_list)

Tags on images should not affect image or instance counts in summaries.

Id:e9ea3960-051d-47cd-a23b-013ad8deb243
Description:The presence of tags should not affect image or instance

counts, but should be reflected in the summaries themselves. :steps:

  1. Add a cloud account
  2. Create images and instances with no tag, each tag, and both tags
Expectedresults:
 
  • The image and instance counts should always be 1
  • The RHEL label should be 1 when the image has the rhel tag
  • The RHOCP label should be 1 when the image has the openshift tag
  • Both labels should be 1 when an image has both tags
integrade.tests.ui.test_acct_summary.test_summary_cards(drop_account_data, cloud_account_data, browser_session, ui_acct_list)

Ensure the summary cards provide the summary usage information.

Id:

53aeef62-79a8-4576-8cc5-b9dcc66d61b8

Description:

Test that the summary cards on the top of the accounts page show the summary usage information. The usage information must be the usage on the selected month and should only include RHEL and/or OpenShift usage.

Steps:
  1. Create a cloud account with images and instances that ran across 3 different months: 2 months ago, 1 month ago and the current month. Make sure to include usage from non RHEL and OpenShift, that should not be shown on the report.
  2. Select the past month as the usage period. Confirm the usage is reported as expected.
  3. Do the same for 2 months ago as the usage period. Confirm the usage is reported as expected.
  4. Click on summary row. Confirm that RHEL and RHOCP hours are as expected.
Expectedresults:
 

The usage report should count only RHEL and OpenShift hours. Any usage from a non RHEL or OpenShift image should not be considered.

integrade.tests.ui.test_acct_summary.test_summary_list_layout(cloud_account_data, browser_session, ui_acct_list, drop_account_data)

Confirm aspects of the layout of elements on the summary list.

Id:

873fb451-6ed7-4be4-9dfa-a8f0c22a4dfb

Description:

This test was created to check the behavior of long account names.

Steps:
  1. Add a cloud account with a short name and another with a long name
  2. Check the lengths of both summary rows
Expectedresults:
 
  • Confirm both lengths are equal