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

[1LP][RFR] Automate test: Create schedule for base report #7904

Merged
merged 4 commits into from Oct 24, 2018

Conversation

valaparthvi
Copy link
Contributor

@valaparthvi valaparthvi commented Oct 1, 2018

This PR adds a test case, which creates a schedule for a base report and asserts the schedule was created without any error.

{{pytest: cfme/tests/intelligence/reports/test_crud.py::test_reports_crud_schedule_for_base_report_once --use-template-cache -sqvvv}}

@valaparthvi valaparthvi force-pushed the base_report_schedule branch 2 times, most recently from 216c34a to 88a3d05 Compare October 1, 2018 08:52
@valaparthvi valaparthvi changed the title [WIPTEST] Automate test: Create schedule for base report [RFR] Automate test: Create schedule for base report Oct 1, 2018
@dajoRH dajoRH removed the WIP-testing label Oct 1, 2018
Copy link
Contributor

@digitronik digitronik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Already we have Create method for Schedule
  2. The test should name like test_base_report_crud in which you perform create and delete operation.

cfme/tests/intelligence/reports/test_crud.py Outdated Show resolved Hide resolved
@digitronik digitronik changed the title [RFR] Automate test: Create schedule for base report [WIPTEST] Automate test: Create schedule for base report Oct 1, 2018
@valaparthvi
Copy link
Contributor Author

valaparthvi commented Oct 3, 2018

@digitronik
I have made the changes you requested.

  1. Add a ReportSchedule view, which can be used to add a schedule from report's Details page.
  2. Add a create_schedule method, which creates a schedule for the base report.
  3. Modify test in accordance with the new changes.

About the name change, I chose this test name, because a polarion test case with the same name already exists. If you think it's necessary, I'll change the name.

@valaparthvi valaparthvi changed the title [WIPTEST] Automate test: Create schedule for base report [RFR] Automate test: Create schedule for base report Oct 3, 2018
@dajoRH dajoRH removed the WIP-testing label Oct 3, 2018
Copy link
Contributor

@digitronik digitronik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some questions and suggestions.

cfme/intelligence/reports/reports.py Show resolved Hide resolved
cfme/intelligence/reports/reports.py Show resolved Hide resolved
@@ -264,3 +263,26 @@ def test_reports_delete_saved_report(appliance, request):
view.configuration.item_select(
item='Delete selected Saved Reports', handle_alert=True)
assert not report.exists


def test_reports_create_schedule_for_base_report_once(appliance, request):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Required:
This should be a crud operation.
Please create and delete this scheduled report properly and assert for both
remove finalizer

def step(self):
self.prerequisite_view.reports.tree.click_path(
"All Reports",
self.obj.type or self.obj.company_name,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am suspect about these or. are those required?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is required to navigate to the details page of the report and then select Add a new Schedule from the configuration menu.

@digitronik digitronik changed the title [RFR] Automate test: Create schedule for base report [WIP] Automate test: Create schedule for base report Oct 5, 2018
@dajoRH dajoRH added the WIP label Oct 5, 2018
@valaparthvi valaparthvi changed the title [WIP] Automate test: Create schedule for base report [WIPTEST] Automate test: Create schedule for base report Oct 5, 2018
@dajoRH dajoRH added WIP-testing and removed WIP labels Oct 5, 2018
@valaparthvi valaparthvi changed the title [WIPTEST] Automate test: Create schedule for base report [RFR] Automate test: Create schedule for base report Oct 17, 2018
@valaparthvi
Copy link
Contributor Author

@digitronik I have added a new ReportScheduleView, to fix the failing is_displayed method. I had done a few things incorrectly, but have now fixed it.

@digitronik digitronik changed the title [RFR] Automate test: Create schedule for base report [1LP][RFR] Automate test: Create schedule for base report Oct 18, 2018
Copy link
Member

@mshriver mshriver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hate to say it but I think these views and objects already exist? maybe I missed some nuance between the two?

https://github.com/ManageIQ/integration_tests/blob/master/cfme/intelligence/reports/schedules.py

@mshriver mshriver changed the title [1LP][RFR] Automate test: Create schedule for base report [1LP][WIP] Automate test: Create schedule for base report Oct 23, 2018
@valaparthvi
Copy link
Contributor Author

Hey @mshriver, we have views and objects to create a completely new schedule, but as far as I know, there is no way to create a schedule for an existing report. Take this for example:

  1. Navigate to a report's Details page.
  2. Click on Configuration and select Add a new schedule.
  3. You'll see a form with some pre-filled data such as Filters, Name and Description.

Take a look at this.
I don't think we have any view or object that can directly create a schedule for a report like this.

And the test case is similar to test_schedule_queue, but test_reports_crud_schedule_for_base_report_once uses the new view and method.

But, there is one drawback I hadn't noticed before. The method create_schedule will fail if no data is passed since the Add button on New Schedule page does not activate until and unless some change is made in the form.

Let me know what you think.

@valaparthvi valaparthvi changed the title [1LP][WIP] Automate test: Create schedule for base report [1LP][RFR] Automate test: Create schedule for base report Oct 23, 2018
@mshriver mshriver merged commit 353f947 into ManageIQ:master Oct 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants