mirror of
https://github.com/ansible/awx.git
synced 2026-03-17 00:47:29 -02:30
Adds network UI test framework
This adds a test framework to drive UI tests from the client instead of injecting events from the websocket. Tests consist of a pair of snapshots (before and after the test) and a list of UI events to process. Tests are run using a FSM in the client that controls the resetting of state to the snapshot, injecting the events into the UI, recording test coverage, and reporting tests to the server. * Adds design for event trace table * Adds design for a coverage tracking table * Adds models for EventTrace and Coverage * Adds trace_id to recording messages * Adds design for TopologySnapshot table * Adds order to TopologySnapshot table * Adds TopologySnapshot table * Adds Snapshot message when recordings are started and stoppped * Adds models for tracking test cases and test results * Adds designs for a test runner FSM * Updates test management commands with new schema * Adds download recording button * Adds models to track tests * Adds ui test runner * Adds id and client to TestResult design * Adds id and client to TestResult * Update message types * Stores test results and code coverage from the test runner * Adds tool to generate a test coverage report * Adds APIs for tests and code coverage * Adds per-test-case coverage reports * Breaks out coverage for loading the modules from the tests * Re-raises server-side errors * Captures errors during tests * Adds defaults for host name and host type * Disables test FSM trace storage * Adds support for sending server error message to the client * Resets the UI flags, history, and toolbox contents between tests * Adds istanbul instrumentation to network-ui
This commit is contained in:
@@ -36,8 +36,12 @@ Device.prototype.toJSON = function () {
|
||||
x: this.x,
|
||||
y: this.y,
|
||||
type: this.type,
|
||||
interfaces: this.interfaces,
|
||||
processes: this.processes};
|
||||
interfaces: this.interfaces.map(function (x) {
|
||||
return x.toJSON();
|
||||
}),
|
||||
processes: this.processes.map(function (x) {
|
||||
return x.toJSON();
|
||||
})};
|
||||
};
|
||||
|
||||
Device.prototype.is_selected = function (x, y) {
|
||||
@@ -726,6 +730,11 @@ function Process(id, name, type, x, y) {
|
||||
}
|
||||
exports.Process = Process;
|
||||
|
||||
Process.prototype.toJSON = function () {
|
||||
return {id: this.id,
|
||||
name: this.name};
|
||||
};
|
||||
|
||||
function Stream(id, from_device, to_device, label) {
|
||||
this.id = id;
|
||||
this.from_device = from_device;
|
||||
@@ -919,3 +928,21 @@ Stream.prototype.start_arc_angle_rad = function () {
|
||||
Stream.prototype.start_arc_angle = function () {
|
||||
return this.start_arc_angle_rad() * 180 / Math.PI;
|
||||
};
|
||||
|
||||
function Test(name, event_trace, fsm_trace, pre_test_snapshot, post_test_snapshot) {
|
||||
this.name = name;
|
||||
this.event_trace = event_trace;
|
||||
this.fsm_trace = fsm_trace;
|
||||
this.pre_test_snapshot = pre_test_snapshot;
|
||||
this.post_test_snapshot = post_test_snapshot;
|
||||
}
|
||||
exports.Test = Test;
|
||||
|
||||
function TestResult(id, name, result, date, code_under_test) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.result = result;
|
||||
this.date = date;
|
||||
this.code_under_test = code_under_test;
|
||||
}
|
||||
exports.TestResult = TestResult;
|
||||
|
||||
Reference in New Issue
Block a user