|
22 | 22 | import org.labkey.test.components.ChartLayoutDialog; |
23 | 23 | import org.labkey.test.pages.TimeChartWizard; |
24 | 24 | import org.labkey.test.tests.ReportTest; |
| 25 | +import org.labkey.test.util.CodeMirrorHelper; |
25 | 26 | import org.labkey.test.util.Ext4Helper; |
26 | 27 | import org.labkey.test.util.LogMethod; |
27 | 28 | import org.openqa.selenium.WebElement; |
28 | 29 | import org.openqa.selenium.support.ui.ExpectedConditions; |
29 | 30 |
|
| 31 | +import javax.imageio.ImageIO; |
| 32 | +import java.awt.image.BufferedImage; |
30 | 33 | import java.io.File; |
| 34 | +import java.io.IOException; |
31 | 35 | import java.util.ArrayList; |
32 | 36 | import java.util.HashMap; |
33 | 37 | import java.util.List; |
34 | 38 | import java.util.Map; |
35 | 39 |
|
| 40 | +import static org.hamcrest.number.OrderingComparison.greaterThanOrEqualTo; |
36 | 41 | import static org.junit.Assert.assertFalse; |
37 | 42 | import static org.junit.Assert.assertTrue; |
38 | 43 |
|
@@ -158,11 +163,21 @@ protected Map<String, File> export(String type, String xAxis, String yAxis) |
158 | 163 | log("Export as PNG"); |
159 | 164 | File png = clickExportPNGIcon("chart-render-div", 0); |
160 | 165 | exported.put("png", png); |
| 166 | + try |
| 167 | + { |
| 168 | + BufferedImage image = ImageIO.read(png); |
| 169 | + // Issue 53390: Improve resolution of PNG exports |
| 170 | + checker().verifyThat("Exported PNG height", image.getHeight(), greaterThanOrEqualTo(2000)); |
| 171 | + } |
| 172 | + catch (IOException e) |
| 173 | + { |
| 174 | + checker().recordError(new RuntimeException("Failed to read exported PNG: " + png, e)); |
| 175 | + } |
161 | 176 |
|
162 | 177 | log("Export to script."); |
163 | 178 | Assert.assertEquals("Unexpected number of export script icons", 1, getExportScriptIconCount("chart-render-div")); |
164 | 179 | clickExportScriptIcon("chart-render-div", 0); |
165 | | - String exportScript = _extHelper.getCodeMirrorValue("export-script-textarea"); |
| 180 | + String exportScript = new CodeMirrorHelper(this, "export-script-textarea").getCodeMirrorValue(); |
166 | 181 |
|
167 | 182 | log("Validate that the script is as expected."); |
168 | 183 | assertTrue("Script did not contain expected text: '" + type + "' ", exportScript.toLowerCase().contains(type.toLowerCase())); |
|
0 commit comments