From 828d320e0f9f9d38b6beca019c9cdf3b97245a49 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Sat, 25 May 2019 21:16:26 +0400 Subject: [PATCH] #120 try to run test in docker --- .gitlab-ci.yml | 2 +- src/main/java/ru/ulstu/grant/page/KiasPage.java | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fb4c0ed..6709891 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,7 +22,7 @@ checkRun: checkStyle: stage: test - script: ./gradlew check -x test + script: ./gradlew check deploy: stage: deploy diff --git a/src/main/java/ru/ulstu/grant/page/KiasPage.java b/src/main/java/ru/ulstu/grant/page/KiasPage.java index ea9bdb4..631f5db 100644 --- a/src/main/java/ru/ulstu/grant/page/KiasPage.java +++ b/src/main/java/ru/ulstu/grant/page/KiasPage.java @@ -8,9 +8,9 @@ import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; -import java.util.NoSuchElementException; public class KiasPage { + private final static String KIAS_GRANT_DATE_FORMAT = "dd.MM.yyyy HH:mm"; private WebDriver driver; public KiasPage(WebDriver webDriver) { @@ -23,10 +23,9 @@ public class KiasPage { driver.findElement(By.id("js-ctrlNext")).click(); return true; } - } catch (NoSuchElementException e) { + } finally { return false; } - return false; } public List getPageOfGrants() { @@ -41,7 +40,7 @@ public class KiasPage { public Date parseDeadLineDate(WebElement grantElement) throws ParseException { String deadlineDate = getFirstDeadline(grantElement); //10.06.2019 23:59 - SimpleDateFormat formatter = new SimpleDateFormat("dd.MM.yyyy HH:mm"); + SimpleDateFormat formatter = new SimpleDateFormat(KIAS_GRANT_DATE_FORMAT); return formatter.parse(deadlineDate); }