Qualify direct document previews and tag edits in IntelliJ
This commit is contained in:
@@ -89,7 +89,7 @@ Add `--saved-document` to the Archiver launcher or host check to open the design
|
|||||||
|
|
||||||
Use `--import-form` with `scripts/check-ide-host.py --archiver ../Archiver` and the same JDK and IDEA options to verify seven generic binding targets. The check saves and reopens bindings on the folder grid and import selector, then exercises the free, conflicting and busy import examples in the registered editor.
|
Use `--import-form` with `scripts/check-ide-host.py --archiver ../Archiver` and the same JDK and IDEA options to verify seven generic binding targets. The check saves and reopens bindings on the folder grid and import selector, then exercises the free, conflicting and busy import examples in the registered editor.
|
||||||
|
|
||||||
Use `--document-tabs` with the Archiver host check to open the production archive window and select **Archiver · HTML-Dokumenttabs**. The check switches from the invoice to the delivery note and back, reads each WebView, and checks the actual suggestion popup for the same prefix in both tabs.
|
Use `--document-tabs` with the Archiver host check to open the production archive window and select **Archiver · HTML-Dokumenttabs**. The check also opens the production HTML and details FXML files directly, edits the assigned-tag Component and the input prompt through the visual inspector, and reopens the saved files. In the archive window it adds a second tag to the invoice, switches to the delivery note and back, removes the selected tag, and checks each WebView and suggestion popup. Direct examples cover read-only and busy states.
|
||||||
|
|
||||||
For an existing Archiver checkout, install the built plugin ZIP and create the ignored local JDK and worker mappings once with `python3 scripts/configure-library-example.py --project ../Archiver --target-java-home "$JAVA_HOME"`. Launch the IDE with access to the Maven repository containing the qualified snapshots.
|
For an existing Archiver checkout, install the built plugin ZIP and create the ignored local JDK and worker mappings once with `python3 scripts/configure-library-example.py --project ../Archiver --target-java-home "$JAVA_HOME"`. Launch the IDE with access to the Maven repository containing the qualified snapshots.
|
||||||
|
|
||||||
|
|||||||
@@ -62,48 +62,25 @@ public final class DocumentTabsTargetProbe {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
final Stage window = stage;
|
final Stage window = stage;
|
||||||
TabPane group =
|
String id = Files.readString(dir.resolve("document-attempt"));
|
||||||
fx(
|
var root = fx(() -> window.getScene().getRoot());
|
||||||
() ->
|
String result;
|
||||||
window.getScene().getRoot().lookupAll(".tab-pane").stream()
|
if (id.equals("archive-window-documents")) {
|
||||||
.map(TabPane.class::cast)
|
checkWindow(dir, root);
|
||||||
.filter(
|
result =
|
||||||
p ->
|
"Rechnung → Lieferschein → Rechnung: HTML, chips and popup matched each document."
|
||||||
p.getTabs().stream()
|
+ " Adding Beleg geprüft affected only Rechnung; removing it restored its"
|
||||||
.anyMatch(t -> "Rechnung.html".equals(t.getText())))
|
+ " suggestion.";
|
||||||
.findFirst()
|
} else if (id.startsWith("html-")) {
|
||||||
.orElseThrow());
|
boolean invoice = id.equals("html-invoice");
|
||||||
check(
|
String heading = invoice ? "Rechnung RE-042" : "Lieferschein LS-018";
|
||||||
dir,
|
checkHtml(
|
||||||
group,
|
root, heading, invoice ? "Büromaterial · 48,00 €" : "Wareneingang · 3 Archivkartons");
|
||||||
"Rechnung.html",
|
result = id + ": WebKit displayed " + heading;
|
||||||
"Rechnung RE-042",
|
} else {
|
||||||
"Büromaterial · 48,00 €",
|
result = checkDetails(dir, root, id);
|
||||||
"Beleg offen",
|
}
|
||||||
"Beleg geprüft",
|
Files.writeString(dir.resolve("result-" + id), result);
|
||||||
"rechnung-tab");
|
|
||||||
check(
|
|
||||||
dir,
|
|
||||||
group,
|
|
||||||
"Lieferschein.html",
|
|
||||||
"Lieferschein LS-018",
|
|
||||||
"Wareneingang · 3 Archivkartons",
|
|
||||||
"Beleg geprüft",
|
|
||||||
"Beleg offen",
|
|
||||||
"lieferschein-tab");
|
|
||||||
check(
|
|
||||||
dir,
|
|
||||||
group,
|
|
||||||
"Rechnung.html",
|
|
||||||
"Rechnung RE-042",
|
|
||||||
"Büromaterial · 48,00 €",
|
|
||||||
"Beleg offen",
|
|
||||||
"Beleg geprüft",
|
|
||||||
"rechnung-tab");
|
|
||||||
Files.writeString(
|
|
||||||
dir.resolve("document-tabs-result"),
|
|
||||||
"PASS Rechnung → Lieferschein → Rechnung: HTML content, assigned tag and filtered"
|
|
||||||
+ " suggestion in each production tab.\n");
|
|
||||||
} catch (Throwable error) {
|
} catch (Throwable error) {
|
||||||
var trace = new java.io.StringWriter();
|
var trace = new java.io.StringWriter();
|
||||||
error.printStackTrace(new java.io.PrintWriter(trace));
|
error.printStackTrace(new java.io.PrintWriter(trace));
|
||||||
@@ -115,16 +92,95 @@ public final class DocumentTabsTargetProbe {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void check(
|
private static String checkDetails(Path dir, Node root, String id) throws Exception {
|
||||||
Path dir,
|
String assigned = id.equals("details-delivery") ? "Beleg geprüft" : "Beleg offen";
|
||||||
TabPane group,
|
String suggestion = id.equals("details-delivery") ? "Beleg offen" : "Beleg geprüft";
|
||||||
String name,
|
boolean readonly = id.equals("details-readonly"), busy = id.equals("details-busy");
|
||||||
String heading,
|
var field = fx(() -> (TextField) root.lookup("#tag-input"));
|
||||||
String body,
|
fx(
|
||||||
String assigned,
|
() -> {
|
||||||
String suggestion,
|
if (!field.getPromptText().equals("Belegtag wählen")
|
||||||
String image)
|
|| field.isDisabled() != (readonly || busy))
|
||||||
throws Exception {
|
throw new AssertionError("Saved prompt or edit state: " + id);
|
||||||
|
var remove = removeButton(root, assigned);
|
||||||
|
if (remove.isVisible() == readonly || remove.isDisabled() != busy)
|
||||||
|
throw new AssertionError("Removal state: " + id);
|
||||||
|
if (readonly || busy) {
|
||||||
|
remove.fire();
|
||||||
|
requireChips(root, assigned);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
if (!readonly && !busy) popup(field, suggestion, dir.resolve(id + "-tags.png"));
|
||||||
|
return id
|
||||||
|
+ ": "
|
||||||
|
+ assigned
|
||||||
|
+ (readonly ? ", removal hidden" : busy ? ", removal disabled" : ", Be → " + suggestion);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void checkWindow(Path dir, Node root) throws Exception {
|
||||||
|
var group =
|
||||||
|
fx(
|
||||||
|
() ->
|
||||||
|
root.lookupAll(".tab-pane").stream()
|
||||||
|
.map(TabPane.class::cast)
|
||||||
|
.filter(
|
||||||
|
p ->
|
||||||
|
p.getTabs().stream()
|
||||||
|
.anyMatch(t -> "Rechnung.html".equals(t.getText())))
|
||||||
|
.findFirst()
|
||||||
|
.orElseThrow());
|
||||||
|
var invoice = select(group, "Rechnung.html");
|
||||||
|
checkHtml(invoice, "Rechnung RE-042", "Büromaterial · 48,00 €");
|
||||||
|
var input = fx(() -> (TextField) invoice.lookup("#tag-input"));
|
||||||
|
fx(
|
||||||
|
() -> {
|
||||||
|
requireChips(invoice, "Beleg offen");
|
||||||
|
save(invoice, dir.resolve("rechnung-tab.png"));
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
popup(input, "Beleg geprüft", dir.resolve("rechnung-tab-tags.png"));
|
||||||
|
fx(
|
||||||
|
() -> {
|
||||||
|
input.setText("Beleg geprüft");
|
||||||
|
((Button) invoice.lookup("#add")).fire();
|
||||||
|
requireChips(invoice, "Beleg offen", "Beleg geprüft");
|
||||||
|
if (suggestions(input).contains("Beleg geprüft"))
|
||||||
|
throw new AssertionError("Assigned tag still suggested");
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
fx(
|
||||||
|
() -> {
|
||||||
|
invoice.applyCss();
|
||||||
|
((javafx.scene.Parent) invoice).layout();
|
||||||
|
save(invoice, dir.resolve("rechnung-zwei-tags.png"));
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
var delivery = select(group, "Lieferschein.html");
|
||||||
|
checkHtml(delivery, "Lieferschein LS-018", "Wareneingang · 3 Archivkartons");
|
||||||
|
fx(
|
||||||
|
() -> {
|
||||||
|
requireChips(delivery, "Beleg geprüft");
|
||||||
|
save(delivery, dir.resolve("lieferschein-tab.png"));
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
popup(
|
||||||
|
fx(() -> (TextField) delivery.lookup("#tag-input")),
|
||||||
|
"Beleg offen",
|
||||||
|
dir.resolve("lieferschein-tab-tags.png"));
|
||||||
|
select(group, "Rechnung.html");
|
||||||
|
checkHtml(invoice, "Rechnung RE-042", "Büromaterial · 48,00 €");
|
||||||
|
fx(
|
||||||
|
() -> {
|
||||||
|
requireChips(invoice, "Beleg offen", "Beleg geprüft");
|
||||||
|
removeButton(invoice, "Beleg geprüft").fire();
|
||||||
|
requireChips(invoice, "Beleg offen");
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
popup(input, "Beleg geprüft", dir.resolve("rechnung-tab-tags.png"));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Node select(TabPane group, String name) throws Exception {
|
||||||
var tab =
|
var tab =
|
||||||
fx(
|
fx(
|
||||||
() -> {
|
() -> {
|
||||||
@@ -137,65 +193,132 @@ public final class DocumentTabsTargetProbe {
|
|||||||
return target;
|
return target;
|
||||||
});
|
});
|
||||||
await(
|
await(
|
||||||
"HTML in " + name,
|
"Selected " + name,
|
||||||
|
() -> group.getSelectionModel().getSelectedItem() == tab && tab.getContent().isVisible());
|
||||||
|
return fx(tab::getContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void checkHtml(Node root, String heading, String text) throws Exception {
|
||||||
|
await(
|
||||||
|
heading,
|
||||||
() -> {
|
() -> {
|
||||||
var content = tab.getContent();
|
var browser = root.lookup("WebView");
|
||||||
var viewer = content.lookup("#html-document");
|
if (browser == null) return false;
|
||||||
if (viewer == null
|
var engine = browser.getClass().getMethod("getEngine").invoke(browser);
|
||||||
|| group.getSelectionModel().getSelectedItem() != tab
|
|
||||||
|| !content.isVisible()) return false;
|
|
||||||
var browser = viewer.lookup("WebView");
|
|
||||||
Object engine = browser.getClass().getMethod("getEngine").invoke(browser);
|
|
||||||
var doc = (Document) engine.getClass().getMethod("getDocument").invoke(engine);
|
var doc = (Document) engine.getClass().getMethod("getDocument").invoke(engine);
|
||||||
return doc != null
|
return doc != null
|
||||||
&& doc.getElementsByTagName("h1").getLength() == 1
|
&& doc.getElementsByTagName("h1").getLength() == 1
|
||||||
&& heading.equals(doc.getElementsByTagName("h1").item(0).getTextContent())
|
&& doc.getElementsByTagName("h1").item(0).getTextContent().equals(heading)
|
||||||
&& doc.getDocumentElement().getTextContent().contains(body);
|
&& doc.getDocumentElement().getTextContent().contains(text);
|
||||||
});
|
});
|
||||||
var field = fx(() -> (TextField) tab.getContent().lookup("#tag-input"));
|
}
|
||||||
await(
|
|
||||||
"Focus in " + name,
|
private static List<?> suggestions(TextField field) throws Exception {
|
||||||
|
return (List<?>) field.getClass().getMethod("getSuggestionsSource").invoke(field);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Map<String, Node> chips(Node root) throws Exception {
|
||||||
|
var named = new TreeMap<String, Node>();
|
||||||
|
var pane = (javafx.scene.layout.FlowPane) root.lookup("#tags");
|
||||||
|
for (var row : pane.getChildren()) {
|
||||||
|
var chip = (javafx.scene.layout.Region) row.lookup(".tag-chip");
|
||||||
|
String text = (String) chip.getClass().getMethod("getText").invoke(chip);
|
||||||
|
chip.applyCss();
|
||||||
|
var fills = chip.getBackground().getFills();
|
||||||
|
if (fills.stream()
|
||||||
|
.noneMatch(f -> javafx.scene.paint.Color.web("#f2d58a").equals(f.getFill())))
|
||||||
|
throw new AssertionError(
|
||||||
|
"Chip "
|
||||||
|
+ text
|
||||||
|
+ " style="
|
||||||
|
+ chip.getStyle()
|
||||||
|
+ ", background="
|
||||||
|
+ fills.stream().map(f -> f.getFill()).toList()
|
||||||
|
+ ", component="
|
||||||
|
+ row.getClass().getResource("DocumentTag.fxml"));
|
||||||
|
if (named.put(text, chip) != null)
|
||||||
|
throw new AssertionError("Duplicate assigned chip: " + text);
|
||||||
|
}
|
||||||
|
return named;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void requireChips(Node root, String... expected) throws Exception {
|
||||||
|
var actual = chips(root).keySet();
|
||||||
|
if (!actual.equals(Set.of(expected)))
|
||||||
|
throw new AssertionError("Assigned tags " + actual + " vs " + Arrays.toString(expected));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Button removeButton(Node root, String text) throws Exception {
|
||||||
|
return (Button)
|
||||||
|
Objects.requireNonNull(chips(root).get(text), text).lookup(".tag-chip-remove");
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void popup(TextField field, String suggestion, Path file) throws Exception {
|
||||||
|
// Each interactive target is a separate macOS app. Keep focus acquisition and typing in
|
||||||
|
// one FX event so an IDE activation between them cannot suppress the real popup.
|
||||||
|
long deadline = System.nanoTime() + TimeUnit.SECONDS.toNanos(45);
|
||||||
|
long activateAfter = 0;
|
||||||
|
while (System.nanoTime() < deadline) {
|
||||||
|
if (System.nanoTime() >= activateAfter
|
||||||
|
&& !fx(field::isFocused)
|
||||||
|
&& System.getProperty("os.name").startsWith("Mac")) {
|
||||||
|
String activate =
|
||||||
|
"ObjC.import('AppKit');"
|
||||||
|
+ " $.NSRunningApplication.runningApplicationWithProcessIdentifier("
|
||||||
|
+ ProcessHandle.current().pid()
|
||||||
|
+ ").activateWithOptions(2)";
|
||||||
|
new ProcessBuilder("/usr/bin/osascript", "-l", "JavaScript", "-e", activate)
|
||||||
|
.redirectErrorStream(true)
|
||||||
|
.start()
|
||||||
|
.waitFor(5, TimeUnit.SECONDS);
|
||||||
|
activateAfter = System.nanoTime() + TimeUnit.SECONDS.toNanos(3);
|
||||||
|
}
|
||||||
|
boolean matched =
|
||||||
|
fx(
|
||||||
() -> {
|
() -> {
|
||||||
var stage = (Stage) group.getScene().getWindow();
|
var stage = (Stage) field.getScene().getWindow();
|
||||||
if (!field.isFocused()) {
|
if (!field.isFocused()) {
|
||||||
stage.toFront();
|
stage.toFront();
|
||||||
stage.requestFocus();
|
stage.requestFocus();
|
||||||
field.requestFocus();
|
field.requestFocus();
|
||||||
}
|
}
|
||||||
return field.isFocused();
|
if (!field.isFocused()) return false;
|
||||||
});
|
if (!suggestions(field).contains(suggestion))
|
||||||
fx(
|
throw new AssertionError(
|
||||||
() -> {
|
"Missing " + suggestion + " in catalogue " + suggestions(field));
|
||||||
var chips = tab.getContent().lookupAll(".tag-chip");
|
|
||||||
if (chips.size() != 1) throw new AssertionError("Expected one assigned tag in " + name);
|
|
||||||
var chip = chips.iterator().next();
|
|
||||||
if (!assigned.equals(chip.getClass().getMethod("getText").invoke(chip)))
|
|
||||||
throw new AssertionError("Wrong assigned tag in " + name);
|
|
||||||
field.setText("");
|
field.setText("");
|
||||||
field.setText("Be");
|
field.setText("Be");
|
||||||
return null;
|
|
||||||
});
|
|
||||||
await(
|
|
||||||
"Popup with " + suggestion,
|
|
||||||
() -> {
|
|
||||||
for (var window : Window.getWindows()) {
|
for (var window : Window.getWindows()) {
|
||||||
if (window instanceof Popup popup
|
if (window instanceof Popup popup
|
||||||
&& popup.isShowing()
|
&& popup.isShowing()
|
||||||
&& popup.getOwnerNode() == field
|
&& popup.getOwnerNode() == field
|
||||||
&& popup.getScene().lookup(".list-view") instanceof ListView<?> list
|
&& popup.getScene().lookup(".list-view") instanceof ListView<?> list) {
|
||||||
&& list.getItems().equals(List.of(suggestion))) {
|
if (!list.getItems().equals(List.of(suggestion)))
|
||||||
save(list, dir.resolve(image + "-tags.png"));
|
throw new AssertionError(
|
||||||
|
"Expected " + suggestion + " but saw " + list.getItems());
|
||||||
|
save(list, file);
|
||||||
|
field.setText("");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
if (matched) return;
|
||||||
|
Thread.sleep(150);
|
||||||
|
}
|
||||||
|
throw new AssertionError(
|
||||||
fx(
|
fx(
|
||||||
() -> {
|
() ->
|
||||||
save(tab.getContent(), dir.resolve(image + ".png"));
|
"No popup for "
|
||||||
field.setText("");
|
+ suggestion
|
||||||
return null;
|
+ ", field focused="
|
||||||
});
|
+ field.isFocused()
|
||||||
|
+ ", stage focused="
|
||||||
|
+ field.getScene().getWindow().isFocused()
|
||||||
|
+ ", catalogue="
|
||||||
|
+ suggestions(field)
|
||||||
|
+ ", windows="
|
||||||
|
+ Window.getWindows()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void save(Node node, Path file) throws Exception {
|
private static void save(Node node, Path file) throws Exception {
|
||||||
|
|||||||
@@ -2,59 +2,112 @@ package qualification;
|
|||||||
|
|
||||||
import static qualification.WorkflowProbe.*;
|
import static qualification.WorkflowProbe.*;
|
||||||
|
|
||||||
|
import com.intellij.openapi.fileEditor.FileEditorManager;
|
||||||
import com.intellij.openapi.project.Project;
|
import com.intellij.openapi.project.Project;
|
||||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||||
|
import de.neitzel.fxdesigner.workflow.DesignerWorkflow.Example;
|
||||||
import java.nio.file.*;
|
import java.nio.file.*;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
import javafx.embed.swing.SwingFXUtils;
|
import javafx.embed.swing.SwingFXUtils;
|
||||||
import javafx.scene.control.*;
|
import javafx.scene.control.*;
|
||||||
import javafx.scene.image.ImageView;
|
import javafx.scene.image.ImageView;
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
|
|
||||||
/**
|
/** Edits the real chip template and opens both child resources and the archive window. */
|
||||||
* Opens the production ArchiveWindow in the registered editor and selects its real document tabs.
|
|
||||||
*/
|
|
||||||
public final class DocumentTabsWorkflowProbe extends FormWorkflowProbe {
|
public final class DocumentTabsWorkflowProbe extends FormWorkflowProbe {
|
||||||
@Override
|
@Override
|
||||||
void verify(Project project) throws Exception {
|
void verify(Project project) throws Exception {
|
||||||
|
edit(project, "DocumentTag", "TagChip #chip", "style", "-fx-background-color: #f2d58a;");
|
||||||
|
edit(
|
||||||
|
project,
|
||||||
|
"DocumentDetails",
|
||||||
|
"AutoCompleteTextField #input",
|
||||||
|
"promptText",
|
||||||
|
"Belegtag wählen");
|
||||||
|
build(4);
|
||||||
|
for (String id :
|
||||||
|
new String[] {"details-invoice", "details-delivery", "details-readonly", "details-busy"})
|
||||||
|
preview(id);
|
||||||
|
open(project, "HtmlDocument");
|
||||||
|
build(2);
|
||||||
|
preview("html-invoice");
|
||||||
|
preview("html-delivery");
|
||||||
|
open(project, "ArchiveWindow");
|
||||||
|
build(2);
|
||||||
|
preview("archive-window-documents");
|
||||||
|
Files.writeString(output.resolve("SUCCESS.txt"), Files.readString(output.resolve("steps.txt")));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void open(Project project, String form) throws Exception {
|
||||||
var path =
|
var path =
|
||||||
Path.of(
|
Path.of(project.getBasePath(), "src/main/resources/de/neitzel/archiver/ui", form + ".fxml");
|
||||||
project.getBasePath(), "src/main/resources/de/neitzel/archiver/ui/ArchiveWindow.fxml");
|
|
||||||
file = edt(() -> LocalFileSystem.getInstance().refreshAndFindFileByNioFile(path));
|
file = edt(() -> LocalFileSystem.getInstance().refreshAndFindFileByNioFile(path));
|
||||||
pane = openDesigner(project, file);
|
pane = openDesigner(project, file);
|
||||||
|
fx(pane::flush).toCompletableFuture().get(10, TimeUnit.SECONDS);
|
||||||
|
step("Opened " + form + ".fxml in Neitzel Designer");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void edit(Project project, String form, String control, String property, String value)
|
||||||
|
throws Exception {
|
||||||
|
open(project, form);
|
||||||
|
controls(true);
|
||||||
|
choose("form-control", control);
|
||||||
|
set(property, value, value);
|
||||||
|
click(pane, "Save");
|
||||||
|
await(() -> Files.readString(Path.of(file.getPath())).contains(value));
|
||||||
|
edt(
|
||||||
|
() -> {
|
||||||
|
FileEditorManager.getInstance(project).closeFile(file);
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
open(project, form);
|
||||||
|
if (!source().contains(value)) throw new AssertionError(form + " lost " + property);
|
||||||
|
step("Saved and reopened " + control + "." + property + " = " + value);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void build(int examples) throws Exception {
|
||||||
click(pane, "Form preview");
|
click(pane, "Form preview");
|
||||||
click(pane, "Build and Refresh");
|
click(pane, "Build and Refresh");
|
||||||
await(
|
await(
|
||||||
() ->
|
() ->
|
||||||
fx(
|
fx(
|
||||||
() ->
|
() ->
|
||||||
((ComboBox<?>) pane.lookup("#preview-example"))
|
((ComboBox<?>) pane.lookup("#preview-example")).getItems().size() == examples));
|
||||||
.getItems().stream()
|
}
|
||||||
.anyMatch(
|
|
||||||
item -> item.toString().contains("archive-window-documents"))));
|
private void preview(String id) throws Exception {
|
||||||
choose("preview-example", "archive-window-documents");
|
choose("preview-example", id);
|
||||||
|
String label =
|
||||||
|
fx(() -> ((Example) ((ComboBox<?>) pane.lookup("#preview-example")).getValue()).label());
|
||||||
await(
|
await(
|
||||||
() ->
|
() ->
|
||||||
fx(
|
fx(
|
||||||
() -> {
|
() -> {
|
||||||
var status = ((Label) pane.lookup("#preview-state")).getText();
|
String state = ((Label) pane.lookup("#preview-state")).getText();
|
||||||
if (status.startsWith("Preview failed") || status.startsWith("Preview blocked"))
|
if (state.startsWith("Preview failed")
|
||||||
throw new AssertionError(status);
|
|| state.startsWith("Preview blocked")
|
||||||
|
|| state.startsWith("Preview unavailable"))
|
||||||
|
throw new AssertionError(id + ": " + state);
|
||||||
return ((ImageView) pane.lookup("#full-preview-image")).getImage() != null
|
return ((ImageView) pane.lookup("#full-preview-image")).getImage() != null
|
||||||
&& status.contains("HTML-Dokumenttabs");
|
&& state.contains(label);
|
||||||
}));
|
}));
|
||||||
step("Production ArchiveWindow rendered the document tabs");
|
|
||||||
fx(
|
fx(
|
||||||
() -> {
|
() -> {
|
||||||
|
var frame = ((ImageView) pane.lookup("#full-preview-image")).getImage();
|
||||||
|
ImageIO.write(
|
||||||
|
SwingFXUtils.fromFXImage(frame, null), "png", output.resolve(id + ".png").toFile());
|
||||||
|
if (id.equals("archive-window-documents"))
|
||||||
ImageIO.write(
|
ImageIO.write(
|
||||||
SwingFXUtils.fromFXImage(pane.snapshot(null, null), null),
|
SwingFXUtils.fromFXImage(pane.snapshot(null, null), null),
|
||||||
"png",
|
"png",
|
||||||
output.resolve("intellij.png").toFile());
|
output.resolve("intellij.png").toFile());
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
Files.writeString(output.resolve("document-attempt"), id);
|
||||||
click(pane, "Interactive preview");
|
click(pane, "Interactive preview");
|
||||||
awaitTarget("document-tabs-result");
|
var result = "result-" + id;
|
||||||
|
awaitTarget(result);
|
||||||
|
step(Files.readString(output.resolve(result)));
|
||||||
click(pane, "Stop preview");
|
click(pane, "Stop preview");
|
||||||
Files.writeString(
|
|
||||||
output.resolve("SUCCESS.txt"), Files.readString(output.resolve("document-tabs-result")));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ for run_number, mode in ((n, mode) for n in range(1, args.repeat + 1) for mode i
|
|||||||
shutil.copyfile(base / "intellij.png", output / (mode + ".png"))
|
shutil.copyfile(base / "intellij.png", output / (mode + ".png"))
|
||||||
(evidence / "proof.json").write_text(json.dumps(proof, indent=2) + "\n")
|
(evidence / "proof.json").write_text(json.dumps(proof, indent=2) + "\n")
|
||||||
finally:
|
finally:
|
||||||
for name in ("import-collision.png", "import-accepted.png", "result-import-free", "result-import-busy", "result-import-collision", "result-import-grid", "SUCCESS.txt", "FAILURE.txt", "ui-state.txt", "launcher.log", "steps.txt", "target-error.txt", "preview-restored.png", "imap.png", "jmap.png", "invoice.png", "delivery.png", "saved-document-result", "saved-bindings.fxml", "binding-article.png", "binding-dynamic.png", "tags-Pr.png", "tags-Re.png", "tags-Li.png", "document-tabs-result", "rechnung-tab.png", "lieferschein-tab.png", "rechnung-tab-tags.png", "lieferschein-tab-tags.png", "folder.png", "right.png", "bottom.png", "result-folder", "result-right", "result-bottom", "intellij.png"):
|
for name in ("details-invoice-tags.png", "details-delivery-tags.png", "details-invoice.png", "details-delivery.png", "details-readonly.png", "details-busy.png", "html-invoice.png", "html-delivery.png", "rechnung-zwei-tags.png", "import-collision.png", "import-accepted.png", "result-import-free", "result-import-busy", "result-import-collision", "result-import-grid", "SUCCESS.txt", "FAILURE.txt", "ui-state.txt", "launcher.log", "steps.txt", "target-error.txt", "preview-restored.png", "imap.png", "jmap.png", "invoice.png", "delivery.png", "saved-document-result", "saved-bindings.fxml", "binding-article.png", "binding-dynamic.png", "tags-Pr.png", "tags-Re.png", "tags-Li.png", "document-tabs-result", "rechnung-tab.png", "lieferschein-tab.png", "rechnung-tab-tags.png", "lieferschein-tab-tags.png", "folder.png", "right.png", "bottom.png", "result-folder", "result-right", "result-bottom", "intellij.png"):
|
||||||
if (base / name).exists():
|
if (base / name).exists():
|
||||||
shutil.copyfile(base / name, evidence / name)
|
shutil.copyfile(base / name, evidence / name)
|
||||||
workers = descendant_workers(pid)
|
workers = descendant_workers(pid)
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ if args.archiver:
|
|||||||
subprocess.run([sys.executable, ROOT / "scripts/configure-library-example.py", "--project", project,
|
subprocess.run([sys.executable, ROOT / "scripts/configure-library-example.py", "--project", project,
|
||||||
"--target-java-home", args.target_java_home], check=True)
|
"--target-java-home", args.target_java_home], check=True)
|
||||||
view = "ConnectionForm" if args.connection_form else "ArchiveWindow"
|
view = "ConnectionForm" if args.connection_form else "ArchiveWindow"
|
||||||
|
if args.document_tabs and args.check:
|
||||||
|
view = "DocumentTag"
|
||||||
if args.grid_docking:
|
if args.grid_docking:
|
||||||
view = "FolderTab"
|
view = "FolderTab"
|
||||||
shutil.copyfile(args.grid_docking, project / "src/main/resources/ReferenceWorkspace.fxml")
|
shutil.copyfile(args.grid_docking, project / "src/main/resources/ReferenceWorkspace.fxml")
|
||||||
|
|||||||
Reference in New Issue
Block a user