forked from github/wulkanowy-mirror
Fix parsing grade description with symbol containing special chars (#104)
This commit is contained in:
parent
3105e9e53b
commit
be8ee4c835
@ -227,5 +227,7 @@ workflows:
|
||||
requires:
|
||||
- instrumented
|
||||
filters:
|
||||
branches:
|
||||
only: master
|
||||
tags:
|
||||
only: /.*/
|
||||
|
@ -56,7 +56,7 @@ public class GradesList {
|
||||
String descriptions = row.select("td:nth-child(3)").text();
|
||||
|
||||
String symbol = descriptions.split(", ")[0];
|
||||
String description = descriptions.replaceFirst(symbol, "").replaceFirst(", ", "");
|
||||
String description = descriptions.replaceFirst(Pattern.quote(symbol), "").replaceFirst(", ", "");
|
||||
String color = getColor(row.select("td:nth-child(2) span.ocenaCzastkowa").attr("style"));
|
||||
String date = formatDate(row.select("td:nth-child(5)").text());
|
||||
|
||||
|
@ -19,7 +19,7 @@ public class GradesListTest extends StudentAndParentTestCase {
|
||||
|
||||
@Test
|
||||
public void getAllTest() throws Exception {
|
||||
Assert.assertEquals(6, filled.getAll().size()); // 2 items are skipped
|
||||
Assert.assertEquals(7, filled.getAll().size()); // 2 items are skipped
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -60,6 +60,7 @@ public class GradesListTest extends StudentAndParentTestCase {
|
||||
Assert.assertEquals("BW3", list.get(3).getSymbol());
|
||||
Assert.assertEquals("STR", list.get(4).getSymbol());
|
||||
Assert.assertEquals("K", list.get(5).getSymbol());
|
||||
Assert.assertEquals("+Odp", list.get(6).getSymbol());
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -70,6 +71,7 @@ public class GradesListTest extends StudentAndParentTestCase {
|
||||
Assert.assertEquals("Writing", list.get(3).getDescription());
|
||||
Assert.assertEquals("", list.get(4).getDescription());
|
||||
Assert.assertEquals("Kordian", list.get(5).getDescription());
|
||||
Assert.assertEquals("Kordian", list.get(6).getDescription());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -100,6 +100,14 @@
|
||||
<td>06.02.2017</td>
|
||||
<td>Amelia Stępień</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Język polski</td>
|
||||
<td class="break-word"><span class="ocenaCzastkowa" style="color:#6ECD07;">5</span></td>
|
||||
<td class="break-word">+Odp, Kordian</td>
|
||||
<td>5,00</td>
|
||||
<td>11.05.2017</td>
|
||||
<td>Amelia Stępień</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</main>
|
||||
|
Loading…
Reference in New Issue
Block a user