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 - 11 + 17 + 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";