From de26eb6f074da65776e3b3224182198275c7ad79 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9rgio=20Martins?=
<26721377+sergiomartins8@users.noreply.github.com>
Date: Tue, 27 Feb 2024 13:21:29 +0000
Subject: [PATCH] Update dependencies (#21)
* Update dependencies
* update ci to java 17
* update remaining dependencies to support with java 17
---
.github/workflows/daily_update.yml | 4 ++--
.github/workflows/pull_request.yml | 4 ++--
.github/workflows/release-candidate.yml | 4 ++--
.github/workflows/release.yml | 4 ++--
pom.xml | 14 +++++++-------
.../java/qa/jobs/portugal/pages/ItJobsPage.java | 9 ++-------
.../jobs/portugal/utils/constants/SearchFor.java | 11 ++++++++++-
7 files changed, 27 insertions(+), 23 deletions(-)
diff --git a/.github/workflows/daily_update.yml b/.github/workflows/daily_update.yml
index 2f06a3f..e71dd6c 100644
--- a/.github/workflows/daily_update.yml
+++ b/.github/workflows/daily_update.yml
@@ -15,10 +15,10 @@ jobs:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, will fail to push refs to dest repo
- - name: Setup JDK 11
+ - name: Setup JDK 17
uses: actions/setup-java@v1
with:
- java-version: 11
+ java-version: 17
- name: Run chrome browser
run: docker-compose up -d chrome
diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml
index a8b8992..75dc053 100644
--- a/.github/workflows/pull_request.yml
+++ b/.github/workflows/pull_request.yml
@@ -12,10 +12,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- - name: Setup JDK 11
+ - name: Setup JDK 17
uses: actions/setup-java@v1
with:
- java-version: 11
+ java-version: 17
- name: Lint
run: mvn -B validate
diff --git a/.github/workflows/release-candidate.yml b/.github/workflows/release-candidate.yml
index 857673e..5020b2e 100644
--- a/.github/workflows/release-candidate.yml
+++ b/.github/workflows/release-candidate.yml
@@ -12,10 +12,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- - name: Setup JDK 11
+ - name: Setup JDK 17
uses: actions/setup-java@v1
with:
- java-version: 11
+ java-version: 17
- name: Lint
run: mvn -B validate
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 130507c..33ab8b1 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -12,10 +12,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- - name: Setup JDK 11
+ - name: Setup JDK 17
uses: actions/setup-java@v1
with:
- java-version: 11
+ java-version: 17
- name: Lint
run: mvn -B validate
diff --git a/pom.xml b/pom.xml
index 9857ee1..3cc7726 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
qa.jobs.portugal
qa-jobs-in-portugal
- 1.5.0
+ 1.6.0
jar
qa-jobs-in-portugal
@@ -24,10 +24,10 @@
org.apache.maven.plugins
maven-compiler-plugin
- 3.8.1
+ 3.12.1
-
- 11
+
+ 17
@@ -82,18 +82,18 @@
ch.qos.logback
logback-classic
- 1.2.3
+ 1.4.14
org.projectlombok
lombok
true
- 1.18.10
+ 1.18.30
com.codeborne
selenide
- 5.18.0
+ 7.1.0
diff --git a/src/main/java/qa/jobs/portugal/pages/ItJobsPage.java b/src/main/java/qa/jobs/portugal/pages/ItJobsPage.java
index 70cf4be..a21915c 100644
--- a/src/main/java/qa/jobs/portugal/pages/ItJobsPage.java
+++ b/src/main/java/qa/jobs/portugal/pages/ItJobsPage.java
@@ -6,7 +6,6 @@
import java.util.List;
import java.util.stream.Collectors;
-import java.util.stream.Stream;
import static com.codeborne.selenide.Selenide.$$;
@@ -18,17 +17,13 @@ public class ItJobsPage implements VacancyPage {
@Override
public List getJobs() {
return $$(BLOCK_BORDERLESS_SELECTOR)
+ .filterBy(SearchFor.KEYWORDS)
+ .asFixedIterable()
.stream()
- .filter(this::containsQuery)
.map(element -> Job.builder().title(getTitle(element)).company(getCompany(element)).url(getUrl(element)).build())
.collect(Collectors.toList());
}
- private boolean containsQuery(SelenideElement element) {
- return Stream.of(SearchFor.KEYWORDS)
- .anyMatch(keyword -> element.$(TITLE_SELECTOR).getText().toLowerCase().contains(keyword));
- }
-
private String getTitle(SelenideElement element) {
return element.$(TITLE_SELECTOR).getText().trim();
}
diff --git a/src/main/java/qa/jobs/portugal/utils/constants/SearchFor.java b/src/main/java/qa/jobs/portugal/utils/constants/SearchFor.java
index 2dca33c..f01a9e5 100644
--- a/src/main/java/qa/jobs/portugal/utils/constants/SearchFor.java
+++ b/src/main/java/qa/jobs/portugal/utils/constants/SearchFor.java
@@ -1,10 +1,19 @@
package qa.jobs.portugal.utils.constants;
+import com.codeborne.selenide.WebElementCondition;
import lombok.experimental.UtilityClass;
+import static com.codeborne.selenide.Condition.anyOf;
+import static com.codeborne.selenide.Condition.text;
+
@UtilityClass
public class SearchFor {
- public static final String[] KEYWORDS = new String[]{"qa", "test", "quality", "assurance"};
+ public static final WebElementCondition KEYWORDS = anyOf(
+ text("qa"),
+ text("test"),
+ text("quality"),
+ text("assurance")
+ );
public static final String TEST_AUTOMATION_QUERY = "test automation";
public static final String QUALITY_ASSURANCE_QUERY = "quality assurance";