|
15 | 15 | */ |
16 | 16 | package org.labkey.test.tests.external.labModules; |
17 | 17 |
|
| 18 | +import au.com.bytecode.opencsv.CSVReader; |
18 | 19 | import org.apache.commons.lang3.StringUtils; |
19 | 20 | import org.apache.commons.lang3.tuple.Pair; |
20 | 21 | import org.json.JSONArray; |
|
50 | 51 | import org.openqa.selenium.support.Color; |
51 | 52 |
|
52 | 53 | import java.io.File; |
| 54 | +import java.io.FileReader; |
53 | 55 | import java.io.IOException; |
54 | 56 | import java.util.List; |
55 | 57 | import java.util.Map; |
@@ -1896,6 +1898,40 @@ private void testLuceneSearchUI(String sessionId) |
1896 | 1898 | waitAndClick(Locator.tagWithClass("button", "filter-form-select-button")); |
1897 | 1899 | waitForElement(Locator.tagWithText("span", "0.029")); |
1898 | 1900 |
|
| 1901 | + // Test the CSV export on this discrete case prior to clearing -- there should be 2 rows |
| 1902 | + File downloadCSV = doAndWaitForDownload(() -> clickButton("Export CSV", 0)); |
| 1903 | + try (FileReader fileReader = new FileReader(downloadCSV)) |
| 1904 | + { |
| 1905 | + CSVReader csvReader = new CSVReader(fileReader); |
| 1906 | + String[] line = csvReader.readNext(); |
| 1907 | + Assert.assertArrayEquals(new String[] { |
| 1908 | + "contig", "start", "end", "ref", "alt", "genomicPosition", |
| 1909 | + "nCalled", "fractionHet", "variableSamples", "homozygousVarSamples", |
| 1910 | + "nHomVar", "nHet", "AF", "AC", "CADD_PH", "CLN_ALLELE", "OMIMD", "IMPACT" |
| 1911 | + }, line); |
| 1912 | + line = csvReader.readNext(); |
| 1913 | + Assert.assertArrayEquals(new String[] { |
| 1914 | + "1", "2", "2", "A", "T", "2", "1523", "0.9268293", |
| 1915 | + "m00004,m00013,m00029,m00101,m00391,m00435,m00458,m00598,m00610,m00789,m00801,m00816,m00969,m02168," + |
| 1916 | + "m02169,m02179,m02225,m02230,m02280,m02324,m02344,m02369,m02391,m03592,m03655,m03667,m03669," + |
| 1917 | + "m03684,m03694,m05192,m05264,m05270,m05273,m05550,m05551,m05557,m05622,m05640,m05658,m05659," + |
| 1918 | + "m05660,m05662,m05666,m05668,m05669,m05671,m05672,m05673,m05675,m05795,m05812,m05834,m05855," + |
| 1919 | + "m05861,m05895,m06088,m06969,m06970,m06985,m06986,m06988,m06993,m07003,m07006,m07007,m07025," + |
| 1920 | + "m07034,m07037,m07045,m07409,m07418,m07426,m07438,m07446,m07458,m07489,m07495,m07513,m07863," + |
| 1921 | + "m07929,m07951,m07952", |
| 1922 | + "m03694,m05671,m05672,m06970,m06993,m07951", |
| 1923 | + "6", "76", "0.029", "88", "7.292", "", "", "HIGH" |
| 1924 | + }, line); |
| 1925 | + line = csvReader.readNext(); |
| 1926 | + Assert.assertArrayEquals(new String[] { |
| 1927 | + "1","5336","5336","A","G","5336","1524","1.0","m05373","","0","1","3.281E-4","1","2.868","","","MODERATE" |
| 1928 | + }, line); |
| 1929 | + } |
| 1930 | + catch (Exception e) |
| 1931 | + { |
| 1932 | + Assert.fail(); |
| 1933 | + } |
| 1934 | + |
1899 | 1935 | clearFilterDialog("IMPACT equals HIGH,MODERATE"); |
1900 | 1936 |
|
1901 | 1937 | testLuceneColumnSerialization(sessionId); |
|
0 commit comments