Skip to content

Instantly share code, notes, and snippets.

@d4hines
Last active June 27, 2019 21:03
Show Gist options
  • Save d4hines/a94368d54b15ffa20f16251fadd44d67 to your computer and use it in GitHub Desktop.
Save d4hines/a94368d54b15ffa20f16251fadd44d67 to your computer and use it in GitHub Desktop.
Spira Test Workflow
Spira Test Workflow
# This is a custom component I'll make that will display Spira in an IFrame.
Open Spira Test Component
# Detecting this may be tricky. We need a way to start the "loop", but it's totally user driven.
navigate to test set -> Begin Next Test
Begin Next Test
# API calls. Much easier thanks to Glenn's prior art. Need to differentiate between workspaces and other attachments
# Glenn wants us to display previous results of the same test. The API calls aren't trivial (several joins involved)
# however, he's worked it all out in some Python code he linked me.
Check Spira for Workspace Attachment
no workspace found -> Create and Upload New Workspace as Attachment
workspace found -> Perform Test
check fails -> Error State
Create and Upload New Workspace as Attachment
Arrange Workspace per Test Instructions
user clicks ready or sends ready hotkey -> Upload the Workspace as Spira Attachment
# Another API call to figure out
Upload the Workspace as Spira Attachment
upload success -> Perform Test
upload failure -> Error State
Perform Test
user clicks done or sends ready hotkey -> Begin Next Test
# A catch-all that displays some diagnostic info
Error State
function render(model){
let current_state_name = model.active_states[0].name;
switch(current_state_name) {
case "Open Spira Test Component": {
return $("h1", "Please open the correct Test Run.");
};
case "Check Spira for Workspace Attachment": {
return $("h1", "Querying Spira for prior workspace attachments...");
};
case "Arrange Workspace per Test Instructions": {
return $("div", $("h1", "Arrange your workspace according to the preconditions of the test."),
$("button", {onClick: () => model.emit("user clicks ready or sends ready hotkey")}, "Done"));
};
case "Upload the Workspace as Spira Attachment": {
return $("h1", "Querying Spira for prior workspace attachments...");
};
case "Perform Test": {
const proceed = () => $("button", {onClick: () => model.emit("user clicks ready or sends ready hotkey")}, "Done");
return $("div", $("h1", "Perform the Test, then record the result"),
);
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment