Skip to content

Commit

Permalink
Update dependencies (#21)
Browse files Browse the repository at this point in the history
* Update dependencies

* update ci to java 17

* update remaining dependencies to support with java 17
  • Loading branch information
sergiomartins8 authored Feb 27, 2024
1 parent a758bdc commit de26eb6
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/daily_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-candidate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>qa.jobs.portugal</groupId>
<artifactId>qa-jobs-in-portugal</artifactId>
<version>1.5.0</version>
<version>1.6.0</version>
<packaging>jar</packaging>

<name>qa-jobs-in-portugal</name>
Expand All @@ -24,10 +24,10 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.12.1</version>
<configuration>
<source>11</source>
<target>11</target>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -82,18 +82,18 @@
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.3</version>
<version>1.4.14</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
<version>1.18.10</version>
<version>1.18.30</version>
</dependency>
<dependency>
<groupId>com.codeborne</groupId>
<artifactId>selenide</artifactId>
<version>5.18.0</version>
<version>7.1.0</version>
</dependency>
</dependencies>
</project>
9 changes: 2 additions & 7 deletions src/main/java/qa/jobs/portugal/pages/ItJobsPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import static com.codeborne.selenide.Selenide.$$;

Expand All @@ -18,17 +17,13 @@ public class ItJobsPage implements VacancyPage {
@Override
public List<Job> 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();
}
Expand Down
11 changes: 10 additions & 1 deletion src/main/java/qa/jobs/portugal/utils/constants/SearchFor.java
Original file line number Diff line number Diff line change
@@ -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";
Expand Down

0 comments on commit de26eb6

Please sign in to comment.