quilla.reports package¶
All report generation and summary classes
Submodules¶
quilla.reports.base_report module¶
- class quilla.reports.base_report.BaseReport(report_type, browser, action, msg='')¶
Bases:
quilla.common.utils.EnumResolver
Data class for producing reports on various steps performed
- Parameters
report_type (
ReportType
) – An enum specifying the kind of reportbrowser (
str
) – The name of the browseraction (
UITestActions
) – An enum specifying the kind of action that was takenmsg (
str
) – A string giving further context to the report
- abstract classmethod from_dict(report)¶
Converts a dictionary report into a valid Report object
- Parameters
report (
Dict
[str
,Dict
[str
,str
]]) – a dictionary that describes a report- Return type
- classmethod from_file(fp)¶
Converts a fp (a file-like .read() supporting object) containing a json document into a Report object
- Return type
- Returns
a report of the appropriate type
- classmethod from_json(report_json)¶
Loads a valid json string and attempts to convert it into a Report object
- Return type
- Returns
a report of the appropriate type
- abstract to_dict()¶
Converts the Report object into a dictionary representation
- to_json()¶
- Return type
str
- Returns
a json representation of the object. Good for passing reports to different applications
quilla.reports.report_summary module¶
- class quilla.reports.report_summary.ReportSummary(run_id, outputs, reports=[])¶
Bases:
object
A class to describe a series of report objects, as well as manipulating them for test purposes.
- Parameters
run_id (
str
) – A string that uniquely identifies the runoutputs (
dict
) – The outputs generated by various stepsreports (
List
[BaseReport
]) – A list of reports to produce a summary of
- run_id¶
A string that uniquely identifies the run
- outputs¶
The outputs generated by various steps
- reports¶
A list of reports used to produce a summary
- successes¶
The number of reports that are described as successful
- fails¶
The numer of reports that are not described as successful
- critical_failures¶
The number of reports representing critical (i.e. unrecoverable) failures. This will be produced at any step if it causes an exception.
- filter_by¶
A declarative way to filter through the various reports
- class FilterTypes(summary)¶
Bases:
object
Inner class used to provide declarative filtering syntax for ReportSummary objects. For example, to filter by only successful reports you would call reports.filter_by.success()
- browser(browser)¶
- Return type
- Returns
a new summary with only reports that have a browser matching the one given by the browser parameter
- critical_failure()¶
- Return type
- Returns
a new summary with only reports that constitute a critical failure
- failure()¶
- Return type
- Returns
a new summary with only the reports that produced a failure
- state(state)¶
- Return type
- Returns
a new summary with only reports that have a state matching the one given by the state parameter
- successful()¶
- Return type
- Returns
a new summary with only the reports that produced a success
- target(target)¶
- Return type
- Returns
a new summary with only reports that have a target matching the one given by the target parameter
- type(validation_type)¶
- Return type
- Returns
a new summary with only reports that have a type matching the one given by the type parameter
- classmethod from_dict(summary_dict)¶
Loads a ReportSummary object that is represented as a dictionary. It does not trust the metadata that is in the report, and will regenerate the metadata itself.
- classmethod from_json(summary_json)¶
Loads a ReportSummary object that is represented as a valid json string. Calls from_dict with the default json loader
- selector: Dict[str, Type[quilla.reports.base_report.BaseReport]] = {'stepFailureReport': <class 'quilla.reports.step_failure_report.StepFailureReport'>, 'validationReport': <class 'quilla.reports.validation_report.ValidationReport'>, 'visualParityReport': <class 'quilla.reports.visual_parity_report.VisualParityReport'>}¶
- to_dict()¶
- Returns
a dictionary representation of the summary report
- to_json()¶
- Return type
str
- Returns
a json string representation of the summary report
quilla.reports.step_failure_report module¶
- class quilla.reports.step_failure_report.StepFailureReport(exception, browser, action, step_index)¶
Bases:
quilla.reports.base_report.BaseReport
Data class for specifying the cause of a step failing in a critical, usually unexpected way.
- Parameters
exception (
Union
[Exception
,str
]) – Either an actual exception class, or a string that describes the failurebrowser (
str
) – The name of the browser this action failed onaction (
UITestActions
) – An enum describing the action that was takenstep_index (
int
) – The index of the step that failed, for debugging purposes
- index¶
The index of the step that failed, for debugging purposes
- classmethod from_dict(report_dict)¶
Converts a dictionary representing this object into a proper StepFailureReport object
- Returns
the appropriate StepFailureReport object
- to_dict()¶
Converts this report into a dictionary object
- Returns
a dictionary containing the representation of this object
quilla.reports.validation_report module¶
- class quilla.reports.validation_report.ValidationReport(validation_type, target, state, browser_name, success, msg='')¶
Bases:
quilla.reports.base_report.BaseReport
Data class for producing reports on the results of the validations
- Parameters
validation_type (
str
) – The string representation of the type of validation performedtarget (
str
) – The validation targetstate (
str
) – The desired state used for validationbrowser_name (
str
) – The name of the browser that the validation was performed onsuccess (
bool
) – Whether the validation passed or notmsg (
str
) – An optional string adding further context to the report
- validation_type¶
The string representation of the type of validation performed
- target¶
The validation target
- state¶
The desired state used for validation
- success¶
Whether the validation passed or not
- msg¶
An optional string adding further context to the report
- classmethod from_dict(report)¶
Converts a dictionary into a ValidationReport object
- Parameters
report – the dictionary representation of a validation report
- Return type
- to_dict()¶
Returns a dictionary representation of the object
quilla.reports.visual_parity_report module¶
- class quilla.reports.visual_parity_report.VisualParityReport(target, browser_name, success, baseline_id, msg='', baseline_image_uri='', treatment_image_uri='', delta_image_uri='')¶
Bases:
quilla.reports.validation_report.ValidationReport
Report type for VisualParity validation state
- Parameters
target (
str
) – The validation targetbrowser_name (
str
) – The name of the browser that the validation was performed onsuccess (
bool
) – Whether the validation passed or notmsg (
str
) – An optional string adding further context to the reportbaseline_id (
str
) – The ID for the image baselinebaseline_image_uri (
str
) – A URI that allows locating the baseline image (i.e. path, link, etc)treatment_image_uri (
str
) – A URI that allows locating the treatment image (i.e. path, link, etc)delta_image_uri (
str
) – A URI that allows locating the delta image (i.e. path, link, etc)
- validation_type¶
The string representation of the type of validation performed
- target¶
The validation target
- state¶
The desired state used for validation
- success¶
Whether the validation passed or not
- msg¶
An optional string adding further context to the report
- baseline_id¶
The ID for the image baseline
- baseline_image_uri¶
A URI that allows locating the baseline image (i.e. path, link, etc)
- treatment_image_uri¶
A URI that allows locating the treatment image (i.e. path, link, etc)
- delta_image_uri¶
A URI that allows locating the delta image (i.e. path, link, etc)
- classmethod from_dict(report)¶
Converts a dictionary into a ValidationReport object
- Parameters
report – the dictionary representation of a validation report
- Return type
- to_dict()¶
Returns a dictionary representation of the object