public void close() { LOGGER.info("Closing tab"); final JButtonFixture button = parent.button("Tab.close"); LOGGER.info("Tab name to close is " + parent.label("Tab.name")); button.click(); } }
public void clickButton(JButtonFixture button) { await().until(button::isEnabled); button.click(); }
public StartSocketListenerDialog clickStartSocketListener() { me().button("Start socket listener").click(); return new StartSocketListenerDialog(robot); }
public OpenPanel addFile(File file) throws InterruptedException { me().button("OpenPanel.add more files").click(); final DialogFixture vfsBrowserDialog = WindowFinder.findDialog("VfsBrowserDialog").using(robot); openFile(file, vfsBrowserDialog); LOGGER.info("File " + file.getAbsolutePath() + " added to open list"); return this; }
public ParseClipboardDialog clickParseClipboard(){ me().button("Parse clipboard").click(); return new ParseClipboardDialog(robot); }
public LogViewPanel importFiles() { LOGGER.info("Clicking import logs"); await().ignoreExceptions().until(() -> frame.button("OpenPanel.import").click()); return new LogViewPanel(frame, robot); }
public OpenPanel clickMergeLogs(){ final JButtonFixture mergeLogs = me().button("Merge log files"); mergeLogs.click(); return new OpenPanel(frame,robot).waitFor(); }
public static void close(Robot robot) { LOGGER.info("Closing confirmation dialog"); final DialogFixture confirmDialog = WindowFinder.findDialog(new GenericTypeMatcher<Dialog>(Dialog.class) { @Override protected boolean isMatching(@Nonnull Dialog component) { return component.getTitle().equals("Are you sure?"); } }).using(robot); final JButtonFixture ok = confirmDialog.button(new GenericTypeMatcher<JButton>(JButton.class) { @Override protected boolean isMatching(@Nonnull JButton component) { return component.getText().equals("OK"); } }); ok.click(); await() .atMost(30, TimeUnit.SECONDS) .ignoreExceptions() .until(confirmDialog::requireNotVisible); LOGGER.info("Confirmation dialog is closed"); } }
LOGGER.info(" opening file " + name); vfsBrowserDialog.textBox("VfsBrowser.filter").setText(name); vfsBrowserDialog.button("VfsBrowser.refresh").click(); await().ignoreExceptions().until(() -> table.cell(TableCell.row(1).column(0)).click()); vfsBrowserDialog.button("VfsBrowser.open").click(); LOGGER.info(" file " + file.getAbsolutePath() + " opened");
public LogViewPanel importLogs() { me().button(matcherForButtonWithText("Import")).click(); return new LogViewPanel(new MainFrame(robot).me(),robot); }
public LogViewPanel startListening() { me().button(matcherForButtonWithText("OK")).click(); return new LogViewPanel(new MainFrame(robot).me(),robot); }
@Test(retryAnalyzer = RetryAnalyzer.class) public void importLogsFromClipboard() throws Exception { final File tempFile = File.createTempFile("olv", "logs"); logEvents(tempFile, 10, integer -> Level.INFO); final String logsInClipboard = Files.contentOf(tempFile, "UTF-8").trim(); final MainFrame mainFrame = new MainFrame(robot()); final ParseClipboardDialog dialog = mainFrame.welcomeScreen().clickParseClipboard(); setClipboard(logsInClipboard); dialog.refresh().click(); dialog.waitForProcessedContent(logsInClipboard); assertThat(dialog.processedContent().text()).isEqualTo(logsInClipboard); dialog.processingPattern().setText("sed s/Message/XXX/g"); dialog.waitForProcessedContent(logsInClipboard.replaceAll("Message", "XXX")); final LogViewPanel logViewPanel = dialog.importLogs(); await("waiting for 10 events in log table") .atMost(Duration.ONE_MINUTE) .until(() -> logViewPanel.logsTable().visibleLogsCount() == 10); IntStream.range(0, 9) .forEach(i -> logViewPanel.logsTable().hasValueInRow(i, "XXX " + i)); }