From 1a70b9c24203dbc113b5050c9a4d8f4cf042a0dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Pich?= Date: Sat, 29 Sep 2018 20:01:59 +0200 Subject: [PATCH] Fix tests damn refactorization --- .../wulkanowy/api/grades/GradeSummary.kt | 4 +-- .../wulkanowy/api/grades/GradesResponse.kt | 2 +- .../wulkanowy/api/notes/NotesResponse.kt | 4 +-- .../github/wulkanowy/api/student/Student.kt | 34 +++++++++---------- .../wulkanowy/api/student/StudentInfo.kt | 2 +- .../api/timetable/TimetableResponse.kt | 4 +-- 6 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/main/kotlin/io/github/wulkanowy/api/grades/GradeSummary.kt b/src/main/kotlin/io/github/wulkanowy/api/grades/GradeSummary.kt index 783a57c0..215e982d 100644 --- a/src/main/kotlin/io/github/wulkanowy/api/grades/GradeSummary.kt +++ b/src/main/kotlin/io/github/wulkanowy/api/grades/GradeSummary.kt @@ -7,9 +7,9 @@ class GradeSummary { @Selector("td", index = 0) lateinit var name: String - @Selector("td:nth-last-of-name(2):not(:contains(-))") + @Selector("td:nth-last-of-type(2):not(:contains(-))") var predicted: String = "" - @Selector("td:nth-last-of-name(1):not(:contains(-))") + @Selector("td:nth-last-of-type(1):not(:contains(-))") var final: String = "" } diff --git a/src/main/kotlin/io/github/wulkanowy/api/grades/GradesResponse.kt b/src/main/kotlin/io/github/wulkanowy/api/grades/GradesResponse.kt index 59303841..3de4dd29 100644 --- a/src/main/kotlin/io/github/wulkanowy/api/grades/GradesResponse.kt +++ b/src/main/kotlin/io/github/wulkanowy/api/grades/GradesResponse.kt @@ -10,6 +10,6 @@ class GradesResponse { @Selector("#okresyKlasyfikacyjneDropDownList option[selected]") var semesterNumber: Int = 0 - @Selector(".ocenySzczegoly-table tbody tr:has(td:nth-of-name(2):not(:contains(Brak ocen)))") + @Selector(".ocenySzczegoly-table tbody tr:has(td:nth-of-type(2):not(:contains(Brak ocen)))") var grades: List = emptyList() } diff --git a/src/main/kotlin/io/github/wulkanowy/api/notes/NotesResponse.kt b/src/main/kotlin/io/github/wulkanowy/api/notes/NotesResponse.kt index 9baaf297..cc81636e 100644 --- a/src/main/kotlin/io/github/wulkanowy/api/notes/NotesResponse.kt +++ b/src/main/kotlin/io/github/wulkanowy/api/notes/NotesResponse.kt @@ -6,10 +6,10 @@ import java.util.* class NotesResponse { - @Selector(".mainContainer div:first-of-name article") + @Selector(".mainContainer div:first-of-type article") var notes: List = listOf() @Format("dd.MM.yyyy") - @Selector(".mainContainer div:first-of-name h2:not(:contains(Brak))") + @Selector(".mainContainer div:first-of-type h2:not(:contains(Brak))") var dates: List = listOf() } diff --git a/src/main/kotlin/io/github/wulkanowy/api/student/Student.kt b/src/main/kotlin/io/github/wulkanowy/api/student/Student.kt index e95108e0..db292864 100644 --- a/src/main/kotlin/io/github/wulkanowy/api/student/Student.kt +++ b/src/main/kotlin/io/github/wulkanowy/api/student/Student.kt @@ -6,55 +6,55 @@ import java.util.* class Student { - @Selector("article:nth-of-name(1) .wartosc", index = 0) + @Selector("article:nth-of-type(1) .wartosc", index = 0) lateinit var fullName: String - @Selector("article:nth-of-name(1) .wartosc", index = 0, regex = "^([^\\s]*)") + @Selector("article:nth-of-type(1) .wartosc", index = 0, regex = "^([^\\s]*)") lateinit var firstName: String - @Selector("article:nth-of-name(1) .wartosc", index = 0, regex = "\\s([^\\s]*)\\s", defValue = "") + @Selector("article:nth-of-type(1) .wartosc", index = 0, regex = "\\s([^\\s]*)\\s", defValue = "") lateinit var secondName: String - @Selector("article:nth-of-name(1) .wartosc", index = 0, regex = "[^,]+ (.+)") + @Selector("article:nth-of-type(1) .wartosc", index = 0, regex = "[^,]+ (.+)") lateinit var surname: String @Format("dd.MM.yyyy") - @Selector("article:nth-of-name(1) .wartosc", index = 1, regex = "^(.+?),") + @Selector("article:nth-of-type(1) .wartosc", index = 1, regex = "^(.+?),") lateinit var birthDate: Date - @Selector("article:nth-of-name(1) .wartosc", index = 1, regex = "[^,]+, (.+)") + @Selector("article:nth-of-type(1) .wartosc", index = 1, regex = "[^,]+, (.+)") lateinit var birthPlace: String - @Selector("article:nth-of-name(1) .wartosc", index = 2) + @Selector("article:nth-of-type(1) .wartosc", index = 2) lateinit var pesel: String - @Selector("article:nth-of-name(1) .wartosc", index = 3) + @Selector("article:nth-of-type(1) .wartosc", index = 3) lateinit var gender: String - @Selector("article:nth-of-name(1) .wartosc", index = 4) + @Selector("article:nth-of-type(1) .wartosc", index = 4) lateinit var polishCitizenship: String - @Selector("article:nth-of-name(1) .wartosc", index = 5) + @Selector("article:nth-of-type(1) .wartosc", index = 5) lateinit var familyName: String - @Selector("article:nth-of-name(1) .wartosc", index = 6) + @Selector("article:nth-of-type(1) .wartosc", index = 6) lateinit var parentsNames: String - @Selector("article:nth-of-name(2) .wartosc", index = 0) + @Selector("article:nth-of-type(2) .wartosc", index = 0) lateinit var address: String - @Selector("article:nth-of-name(2) .wartosc", index = 1) + @Selector("article:nth-of-type(2) .wartosc", index = 1) lateinit var registeredAddress: String - @Selector("article:nth-of-name(2) .wartosc", index = 2) + @Selector("article:nth-of-type(2) .wartosc", index = 2) lateinit var correspondenceAddress: String - @Selector("article:nth-of-name(3) .wartosc", index = 0) + @Selector("article:nth-of-type(3) .wartosc", index = 0) lateinit var phoneNumber: String - @Selector("article:nth-of-name(3) .wartosc", index = 1) + @Selector("article:nth-of-type(3) .wartosc", index = 1) lateinit var cellPhoneNumber: String - @Selector("article:nth-of-name(3) .wartosc", index = 2) + @Selector("article:nth-of-type(3) .wartosc", index = 2) lateinit var email: String } diff --git a/src/main/kotlin/io/github/wulkanowy/api/student/StudentInfo.kt b/src/main/kotlin/io/github/wulkanowy/api/student/StudentInfo.kt index cfb0a00b..c32308f2 100644 --- a/src/main/kotlin/io/github/wulkanowy/api/student/StudentInfo.kt +++ b/src/main/kotlin/io/github/wulkanowy/api/student/StudentInfo.kt @@ -7,6 +7,6 @@ class StudentInfo { @Selector(".mainContainer") lateinit var student: Student - @Selector(".mainContainer > article:nth-of-name(n+4)") + @Selector(".mainContainer > article:nth-of-type(n+4)") var family: List = emptyList() } diff --git a/src/main/kotlin/io/github/wulkanowy/api/timetable/TimetableResponse.kt b/src/main/kotlin/io/github/wulkanowy/api/timetable/TimetableResponse.kt index fd958473..20c1ed78 100644 --- a/src/main/kotlin/io/github/wulkanowy/api/timetable/TimetableResponse.kt +++ b/src/main/kotlin/io/github/wulkanowy/api/timetable/TimetableResponse.kt @@ -7,7 +7,7 @@ import java.util.* class TimetableResponse { - @Selector(".presentData thead th:not(:nth-of-name(1)):not(:nth-of-name(2))", regex = "\\s(.*)") + @Selector(".presentData thead th:not(:nth-of-type(1)):not(:nth-of-type(2))", regex = "\\s(.*)") @Format("dd.MM.yyyy") var days: List = emptyList() @@ -25,7 +25,7 @@ class TimetableResponse { @Selector("td", index = 1, regex = "(\\S*\$)") lateinit var endTime: String - @Selector("td:not(:nth-of-name(1)):not(:nth-of-name(2))") + @Selector("td:not(:nth-of-type(1)):not(:nth-of-type(2))") var lessons: List = emptyList() class TimetableCell {