diff --git a/.config/checkstyle/checkstyle.xml b/.config/checkstyle/checkstyle.xml index 262c9f9..b585880 100644 --- a/.config/checkstyle/checkstyle.xml +++ b/.config/checkstyle/checkstyle.xml @@ -81,14 +81,13 @@ - + + - - - + @@ -145,6 +144,8 @@ + + diff --git a/.config/pmd/java/ruleset.xml b/.config/pmd/java/ruleset.xml index 9dc7a0f..8dde42b 100644 --- a/.config/pmd/java/ruleset.xml +++ b/.config/pmd/java/ruleset.xml @@ -13,6 +13,7 @@ + @@ -45,8 +46,10 @@ + + @@ -138,6 +141,7 @@ + @@ -154,6 +158,7 @@ + @@ -417,7 +422,8 @@ If you are 100% sure that you escaped the value properly and you have no better @@ -440,7 +446,7 @@ A `Set` also prevents duplicates when the ORM reads multiple identical rows from diff --git a/.config/topo/upstream.yml b/.config/topo/upstream.yml new file mode 100644 index 0000000..0cc67cd --- /dev/null +++ b/.config/topo/upstream.yml @@ -0,0 +1,2 @@ +- url: https://github.com/xdev-software/standard-maven-template.git + branch: master diff --git a/.github/.lycheeignore b/.github/.lycheeignore index dc88a07..217b0ae 100644 --- a/.github/.lycheeignore +++ b/.github/.lycheeignore @@ -1,3 +1,4 @@ # Ignorefile for broken link check localhost mvnrepository.com +stackoverflow.com diff --git a/.github/workflows/broken-links.yml b/.github/workflows/broken-links.yml index 5b50d06..8aeed09 100644 --- a/.github/workflows/broken-links.yml +++ b/.github/workflows/broken-links.yml @@ -3,7 +3,7 @@ name: Broken links on: workflow_dispatch: schedule: - - cron: "23 23 * * 0" + - cron: "23 5 * * 0" permissions: issues: write @@ -13,14 +13,15 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 15 steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - run: mv .github/.lycheeignore .lycheeignore - name: Link Checker id: lychee - uses: lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411 # v2 + uses: lycheeverse/lychee-action@e7477775783ea5526144ba13e8db5eec57747ce8 # v2 with: + args: "--verbose --no-progress './**/*.md'" fail: false # Don't fail on broken links, create an issue instead - name: Find already existing issue diff --git a/.github/workflows/check-build.yml b/.github/workflows/check-build.yml index e814e8b..b9014f5 100644 --- a/.github/workflows/check-build.yml +++ b/.github/workflows/check-build.yml @@ -28,7 +28,7 @@ jobs: java: [17, 21, 25] distribution: [temurin] steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - name: Set up JDK uses: actions/setup-java@v5 @@ -37,7 +37,7 @@ jobs: java-version: ${{ matrix.java }} - name: Cache Maven - uses: actions/cache@v5 + uses: actions/cache@v6 with: path: ~/.m2/repository key: ${{ runner.os }}-mvn-build-${{ hashFiles('**/pom.xml') }} @@ -45,7 +45,7 @@ jobs: ${{ runner.os }}-mvn-build- - name: Build with Maven - run: ./mvnw -B clean package + run: ./mvnw -B clean package -Dchecks.disable=true - name: Check for uncommited changes run: | @@ -74,7 +74,7 @@ jobs: java: [21] distribution: [temurin] steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - name: Set up JDK uses: actions/setup-java@v5 @@ -83,7 +83,7 @@ jobs: java-version: ${{ matrix.java }} - name: Cache Maven - uses: actions/cache@v5 + uses: actions/cache@v6 with: path: ~/.m2/repository key: ${{ runner.os }}-mvn-checkstyle-${{ hashFiles('**/pom.xml') }} @@ -91,7 +91,7 @@ jobs: ${{ runner.os }}-mvn-checkstyle- - name: CheckStyle Cache - uses: actions/cache@v5 + uses: actions/cache@v6 with: path: '**/target/checkstyle-cachefile' key: ${{ runner.os }}-checkstyle-${{ hashFiles('**/pom.xml') }} @@ -110,7 +110,7 @@ jobs: java: [17] distribution: [temurin] steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - name: Set up JDK uses: actions/setup-java@v5 @@ -119,7 +119,7 @@ jobs: java-version: ${{ matrix.java }} - name: Cache Maven - uses: actions/cache@v5 + uses: actions/cache@v6 with: path: ~/.m2/repository key: ${{ runner.os }}-mvn-pmd-${{ hashFiles('**/pom.xml') }} @@ -127,7 +127,7 @@ jobs: ${{ runner.os }}-mvn-pmd- - name: PMD Cache - uses: actions/cache@v5 + uses: actions/cache@v6 with: path: '**/target/pmd/pmd.cache' key: ${{ runner.os }}-pmd-${{ hashFiles('**/pom.xml') }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2b7941b..dc0033e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - name: Set up JDK uses: actions/setup-java@v5 @@ -28,7 +28,7 @@ jobs: # Try to reuse existing cache from check-build - name: Try restore Maven Cache - uses: actions/cache/restore@v5 + uses: actions/cache/restore@v6 with: path: ~/.m2/repository key: ${{ runner.os }}-mvn-build-${{ hashFiles('**/pom.xml') }} @@ -63,7 +63,7 @@ jobs: outputs: upload_url: ${{ steps.create-release.outputs.upload_url }} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - name: Configure Git run: | @@ -91,7 +91,7 @@ jobs: - name: Create Release id: create-release - uses: shogo82148/actions-create-release@6a396031bc74c57403da1018fec74d24c6aa03cd # v1 + uses: shogo82148/actions-create-release@8674c0ecee617c8dfb006526bcc22a362c70b88a # v1 with: tag_name: v${{ steps.version.outputs.release }} release_name: v${{ steps.version.outputs.release }} @@ -115,7 +115,7 @@ jobs: needs: [prepare-release] timeout-minutes: 60 steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - name: Init Git and pull run: | @@ -163,7 +163,7 @@ jobs: needs: [prepare-release] timeout-minutes: 15 steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - name: Init Git and pull run: | @@ -179,7 +179,7 @@ jobs: # Try to reuse existing cache from check-build - name: Try restore Maven Cache - uses: actions/cache/restore@v5 + uses: actions/cache/restore@v6 with: path: ~/.m2/repository key: ${{ runner.os }}-mvn-build-${{ hashFiles('**/pom.xml') }} @@ -191,7 +191,7 @@ jobs: working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} - name: Deploy to Github pages - uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4 + uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./${{ env.PRIMARY_MAVEN_MODULE }}/target/site @@ -202,7 +202,7 @@ jobs: needs: [publish-maven] timeout-minutes: 10 steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - name: Init Git and pull run: | diff --git a/.github/workflows/report-gha-workflow-security-problems.yml b/.github/workflows/report-gha-workflow-security-problems.yml index b17aa53..7847028 100644 --- a/.github/workflows/report-gha-workflow-security-problems.yml +++ b/.github/workflows/report-gha-workflow-security-problems.yml @@ -17,7 +17,7 @@ jobs: # Only run this in our repos (Prevent notification spam by forks) if: ${{ github.repository_owner == 'xdev-software' }} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - name: Check id: check diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 6471ce7..dc68d05 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 with: sparse-checkout: .github/labels.yml diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml index 2d13d77..96e5d2a 100644 --- a/.github/workflows/test-deploy.yml +++ b/.github/workflows/test-deploy.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 60 steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - name: Set up JDK uses: actions/setup-java@v5 diff --git a/.github/workflows/update-from-template.yml b/.github/workflows/update-from-template.yml deleted file mode 100644 index f447710..0000000 --- a/.github/workflows/update-from-template.yml +++ /dev/null @@ -1,320 +0,0 @@ -name: Update from Template - -# This workflow keeps the repo up to date with changes from the template repo (REMOTE_URL) -# It duplicates the REMOTE_BRANCH (into UPDATE_BRANCH) and tries to merge it into -# this repos default branch (which is checked out here) -# Note that this requires a PAT (Personal Access Token) - at best from a servicing account -# PAT permissions: read:discussion, read:org, repo, workflow -# Also note that you should have at least once merged the template repo into the current repo manually -# otherwise a "refusing to merge unrelated histories" error might occur. - -on: - schedule: - - cron: '55 2 * * 1' - workflow_dispatch: - inputs: - no_automatic_merge: - type: boolean - description: 'No automatic merge' - default: false - -env: - UPDATE_BRANCH: update-from-template - UPDATE_BRANCH_MERGED: update-from-template-merged - REMOTE_URL: https://github.com/xdev-software/standard-maven-template.git - REMOTE_BRANCH: master - -permissions: - contents: write - pull-requests: write - -jobs: - update: - runs-on: ubuntu-latest - timeout-minutes: 60 - outputs: - update_branch_merged_commit: ${{ steps.manage-branches.outputs.update_branch_merged_commit }} - create_update_branch_merged_pr: ${{ steps.manage-branches.outputs.create_update_branch_merged_pr }} - steps: - - uses: actions/checkout@v6 - with: - # Required because otherwise there are always changes detected when executing diff/rev-list - fetch-depth: 0 - # If no PAT is used the following error occurs on a push: - # refusing to allow a GitHub App to create or update workflow `.github/workflows/xxx.yml` without `workflows` permission - token: ${{ secrets.UPDATE_FROM_TEMPLATE_PAT }} - - - name: Init Git - run: | - git config --global user.email "111048771+xdev-gh-bot@users.noreply.github.com" - git config --global user.name "XDEV Bot" - - - name: Manage branches - id: manage-branches - run: | - echo "Adding remote template-repo" - git remote add template ${{ env.REMOTE_URL }} - - echo "Fetching remote template repo" - git fetch template - - echo "Deleting local branches that will contain the updates - if present" - git branch -D ${{ env.UPDATE_BRANCH }} || true - git branch -D ${{ env.UPDATE_BRANCH_MERGED }} || true - - echo "Checking if the remote template repo has new commits" - git rev-list ..template/${{ env.REMOTE_BRANCH }} - - if [ $(git rev-list --count ..template/${{ env.REMOTE_BRANCH }}) -eq 0 ]; then - echo "There are no commits new commits on the template repo" - - echo "Deleting origin branch(es) that contain the updates - if present" - git push -f origin --delete ${{ env.UPDATE_BRANCH }} || true - git push -f origin --delete ${{ env.UPDATE_BRANCH_MERGED }} || true - - echo "create_update_branch_pr=0" >> $GITHUB_OUTPUT - echo "create_update_branch_merged_pr=0" >> $GITHUB_OUTPUT - exit 0 - fi - - echo "Found new commits on the template repo" - - echo "Creating update branch" - git branch ${{ env.UPDATE_BRANCH }} template/${{ env.REMOTE_BRANCH }} - git branch --unset-upstream ${{ env.UPDATE_BRANCH }} - - echo "Pushing update branch" - git push -f -u origin ${{ env.UPDATE_BRANCH }} - - echo "Getting base branch" - base_branch=$(git branch --show-current) - echo "Base branch is $base_branch" - echo "base_branch=$base_branch" >> $GITHUB_OUTPUT - - echo "Trying to create auto-merged branch ${{ env.UPDATE_BRANCH_MERGED }}" - git branch ${{ env.UPDATE_BRANCH_MERGED }} ${{ env.UPDATE_BRANCH }} - git checkout ${{ env.UPDATE_BRANCH_MERGED }} - - echo "Merging branch $base_branch into ${{ env.UPDATE_BRANCH_MERGED }}" - git merge $base_branch && merge_exit_code=$? || merge_exit_code=$? - if [ $merge_exit_code -ne 0 ]; then - echo "Auto merge failed! Manual merge required" - echo "::notice ::Auto merge failed - Manual merge required" - - echo "Cleaning up failed merge" - git merge --abort - git checkout $base_branch - git branch -D ${{ env.UPDATE_BRANCH_MERGED }} || true - - echo "Deleting auto-merge branch - if present" - git push -f origin --delete ${{ env.UPDATE_BRANCH_MERGED }} || true - - echo "create_update_branch_pr=1" >> $GITHUB_OUTPUT - echo "create_update_branch_merged_pr=0" >> $GITHUB_OUTPUT - exit 0 - fi - - echo "Post processing: Trying to automatically fill in template variables" - find . -type f \ - -not -path "./.git/**" \ - -not -path "./.github/workflows/update-from-template.yml" -print0 \ - | xargs -0 sed -i "s/template-placeholder/${GITHUB_REPOSITORY#*/}/g" - - git status - git add --all - - if [[ "$(git status --porcelain)" != "" ]]; then - echo "Filled in template; Committing" - - git commit -m "Fill in template" - fi - - echo "Pushing auto-merged branch" - git push -f -u origin ${{ env.UPDATE_BRANCH_MERGED }} - - echo "update_branch_merged_commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT - - echo "Restoring base branch $base_branch" - git checkout $base_branch - - echo "create_update_branch_pr=0" >> $GITHUB_OUTPUT - echo "create_update_branch_merged_pr=1" >> $GITHUB_OUTPUT - echo "try_close_update_branch_pr=1" >> $GITHUB_OUTPUT - - - name: Create/Update PR update_branch - if: steps.manage-branches.outputs.create_update_branch_pr == 1 - env: - GH_TOKEN: ${{ secrets.UPDATE_FROM_TEMPLATE_PAT }} - run: | - gh_pr_up() { - gh pr create -H "${{ env.UPDATE_BRANCH }}" "$@" || (git checkout "${{ env.UPDATE_BRANCH }}" && gh pr edit "$@") - } - gh_pr_up -B "${{ steps.manage-branches.outputs.base_branch }}" \ - --title "Update from template" \ - --body "An automated PR to sync changes from the template into this repo" - - # Ensure that only a single PR is open (otherwise confusion and spam) - - name: Close PR update_branch - if: steps.manage-branches.outputs.try_close_update_branch_pr == 1 - env: - GH_TOKEN: ${{ secrets.UPDATE_FROM_TEMPLATE_PAT }} - run: | - gh pr close "${{ env.UPDATE_BRANCH }}" || true - - - name: Create/Update PR update_branch_merged - if: steps.manage-branches.outputs.create_update_branch_merged_pr == 1 - env: - GH_TOKEN: ${{ secrets.UPDATE_FROM_TEMPLATE_PAT }} - run: | - gh_pr_up() { - gh pr create -H "${{ env.UPDATE_BRANCH_MERGED }}" "$@" || (git checkout "${{ env.UPDATE_BRANCH_MERGED }}" && gh pr edit "$@") - } - gh_pr_up -B "${{ steps.manage-branches.outputs.base_branch }}" \ - --title "Update from template (auto-merged)" \ - --body "An automated PR to sync changes from the template into this repo" - - # Wait a moment so that checks of PR have higher prio than following job - sleep 3 - - # Split into two jobs to help with executor starvation - auto-merge: - needs: [update] - if: needs.update.outputs.create_update_branch_merged_pr == 1 - runs-on: ubuntu-latest - timeout-minutes: 60 - steps: - - uses: actions/checkout@v6 - with: - # Required because otherwise there are always changes detected when executing diff/rev-list - fetch-depth: 0 - # If no PAT is used the following error occurs on a push: - # refusing to allow a GitHub App to create or update workflow `.github/workflows/xxx.yml` without `workflows` permission - token: ${{ secrets.UPDATE_FROM_TEMPLATE_PAT }} - - - name: Init Git - run: | - git config --global user.email "111048771+xdev-gh-bot@users.noreply.github.com" - git config --global user.name "XDEV Bot" - - - name: Checking if auto-merge for PR update_branch_merged can be done - id: auto-merge-check - env: - GH_TOKEN: ${{ secrets.UPDATE_FROM_TEMPLATE_PAT }} - run: | - not_failed_conclusion="skipped|neutral|success" - not_relevant_app_slug="dependabot|github-pages|sonarqubecloud" - - echo "Waiting for checks to start..." - sleep 40s - - for i in {1..20}; do - echo "Checking if PR can be auto-merged. Try: $i" - - echo "Checking if update-branch-merged exists" - git fetch - if [[ $(git ls-remote --heads origin refs/heads/${{ env.UPDATE_BRANCH_MERGED }}) ]]; then - echo "Branch still exists; Continuing..." - else - echo "Branch origin/${{ env.UPDATE_BRANCH_MERGED }} is missing" - exit 0 - fi - - echo "Fetching checks" - cs_response=$(curl -sL \ - --fail-with-body \ - --connect-timeout 60 \ - --max-time 120 \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer $GH_TOKEN" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/repos/${{ github.repository }}/commits/${{ needs.update.outputs.update_branch_merged_commit }}/check-suites) - - cs_data=$(echo $cs_response | jq '.check_suites[] | { conclusion: .conclusion, slug: .app.slug, check_runs_url: .check_runs_url }') - echo $cs_data - - if [[ -z "$cs_data" ]]; then - echo "No check suite data - Assuming that there are no checks to run" - - echo "perform=1" >> $GITHUB_OUTPUT - exit 0 - fi - - cs_failed=$(echo $cs_data | jq --arg x "$not_failed_conclusion" 'select ((.conclusion == null or (.conclusion | test($x))) | not)') - if [[ -z "$cs_failed" ]]; then - echo "No check failed so far; Checking if relevant checks are still running" - - cs_relevant_still_running=$(echo $cs_data | jq --arg x "$not_relevant_app_slug" 'select (.conclusion == null and (.slug | test($x) | not))') - if [[ -z $cs_relevant_still_running ]]; then - echo "All relevant checks finished - PR can be merged" - - echo "perform=1" >> $GITHUB_OUTPUT - exit 0 - else - echo "Relevant checks are still running" - echo $cs_relevant_still_running - fi - else - echo "Detected failed check" - echo $cs_failed - - echo "perform=0" >> $GITHUB_OUTPUT - exit 0 - fi - - echo "Waiting before next run..." - sleep 30s - done - - echo "Timed out - Assuming executor starvation - Forcing merge" - echo "perform=1" >> $GITHUB_OUTPUT - - - name: Auto-merge update_branch_merged - if: steps.auto-merge-check.outputs.perform == 1 - run: | - echo "Getting base branch" - base_branch=$(git branch --show-current) - echo "Base branch is $base_branch" - - echo "Fetching..." - git fetch - if [[ $(git rev-parse origin/${{ env.UPDATE_BRANCH_MERGED }}) ]]; then - echo "Branch still exists; Continuing..." - else - echo "Branch origin/${{ env.UPDATE_BRANCH_MERGED }} is missing" - exit 0 - fi - - expected_commit="${{ needs.update.outputs.update_branch_merged_commit }}" - actual_commit=$(git rev-parse origin/${{ env.UPDATE_BRANCH_MERGED }}) - if [[ "$expected_commit" != "$actual_commit" ]]; then - echo "Branch ${{ env.UPDATE_BRANCH_MERGED }} contains unexpected commit $actual_commit" - echo "Expected: $expected_commit" - - exit 0 - fi - - echo "Ensuring that current branch $base_branch is up-to-date" - git pull - - echo "Merging origin/${{ env.UPDATE_BRANCH_MERGED }} into $base_branch" - git merge origin/${{ env.UPDATE_BRANCH_MERGED }} && merge_exit_code=$? || merge_exit_code=$? - if [ $merge_exit_code -ne 0 ]; then - echo "Unexpected merge failure $merge_exit_code - Requires manual resolution" - - exit 0 - fi - - if [[ "${{ inputs.no_automatic_merge }}" == "true" ]]; then - echo "Exiting due no_automatic_merge" - - exit 0 - fi - - echo "Pushing" - git push - - echo "Cleaning up" - git branch -D ${{ env.UPDATE_BRANCH }} || true - git branch -D ${{ env.UPDATE_BRANCH_MERGED }} || true - git push -f origin --delete ${{ env.UPDATE_BRANCH }} || true - git push -f origin --delete ${{ env.UPDATE_BRANCH_MERGED }} || true diff --git a/.idea/PMDPlugin.xml b/.idea/PMDPlugin.xml deleted file mode 100644 index 0936e51..0000000 --- a/.idea/PMDPlugin.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml index a751c41..b8b753e 100644 --- a/.idea/checkstyle-idea.xml +++ b/.idea/checkstyle-idea.xml @@ -1,7 +1,7 @@ - 13.0.0 + latest JavaOnlyWithTests true true diff --git a/.idea/pmd-x.xml b/.idea/pmd-x.xml index 260e454..7b3b48f 100644 --- a/.idea/pmd-x.xml +++ b/.idea/pmd-x.xml @@ -10,6 +10,7 @@ diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties index c595b00..216df05 100644 --- a/.mvn/wrapper/maven-wrapper.properties +++ b/.mvn/wrapper/maven-wrapper.properties @@ -1,3 +1,3 @@ wrapperVersion=3.3.4 distributionType=only-script -distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.14/apache-maven-3.9.14-bin.zip +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.16/apache-maven-3.9.16-bin.zip diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f7635c..723e2b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# 1.2.0 +* `waitForServerLoadToFinishFunction` can now be changed after `ImprovedRemoteWebElement` was created +* Cache reflection methods to improve performance +* Updated dependencies + # 1.1.1 * Updated dependencies diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9da5906..cba4348 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,7 +4,7 @@ We would absolutely love to get the community involved, and we welcome any form ### Communication channels * Communication is primarily done using issues. -* If you need support as soon as possible and you can't wait for any pull request, feel free to use [our support](https://xdev.software/en/services/support). +* If you need support as soon as possible and you can't wait for any pull request, feel free to use [our support](https://xdev.software/en/services-products/support). * As a last resort measure or on otherwise important matter you may also [contact us directly](https://xdev.software/en/about-us/contact). ### Ways to help @@ -12,7 +12,7 @@ We would absolutely love to get the community involved, and we welcome any form * **Send pull requests**
If you want to contribute code, check out the development instructions below. * However when contributing larger new features, please first discuss the change you wish to make via issue with the owners of this repository before making it.
Otherwise your work might be rejected and your effort was pointless. -We also encourage you to read the [contribution instructions by GitHub](https://docs.github.com/en/get-started/quickstart/contributing-to-projects). +We also encourage you to read the [contribution instructions by GitHub](https://docs.github.com/en/get-started/exploring-projects-on-github/contributing-to-a-project). ## Developing @@ -20,17 +20,17 @@ We also encourage you to read the [contribution instructions by GitHub](https:// You should have the following things installed: * Git * Java 25 - should be as unmodified as possible (Recommended: [Eclipse Adoptium](https://adoptium.net/temurin/releases/)) -* Maven (Note that the [Maven Wrapper](https://maven.apache.org/wrapper/) is shipped with the repo) +* Maven (Note that the [Maven Wrapper](https://maven.apache.org/tools/wrapper/) is shipped with the repo) ### Recommended setup -* Install ``IntelliJ`` (Community Edition is sufficient) - * Install the following plugins: - * [Save Actions](https://plugins.jetbrains.com/plugin/22113) - Provides save actions, like running the formatter or adding ``final`` to fields - * [SonarLint](https://plugins.jetbrains.com/plugin/7973-sonarlint) - CodeStyle/CodeAnalysis - * You may consider disabling telemetry in the settings under ``Tools > Sonarlint -> About`` - * [Checkstyle-IDEA](https://plugins.jetbrains.com/plugin/1065-checkstyle-idea) - CodeStyle/CodeAnalysis +* Install `IntelliJ` + * Recommended setup actions + * Disable not needed plugins + * Disable [telemetry](https://www.jetbrains.com/help/idea/settings-usage-statistics.html) + * Configure the available memory * Import the project - * Ensure that everything is encoded in ``UTF-8`` + * You will get prompted to install the required plugins + * Ensure that everything is encoded in `UTF-8` * Ensure that the JDK/Java-Version is correct diff --git a/README.md b/README.md index 0879313..7ac3b06 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Also contains a ton of other predefined utility, for example: * Waiting for some time until the element is present (``waitUntil``) Overall this should result in: -* Less [flaky](https://www.browserstack.com/test-reporting-and-analytics/features/test-reporting/what-is-flaky-test) tests +* Less [flaky](https://www.jetbrains.com/teamcity/ci-cd-guide/concepts/flaky-tests/) tests * Abstraction of elements in an object oriented way ## Usage @@ -73,7 +73,7 @@ You can also checkout the [integrated tests](./selenium-elements/src/test/java/) [Installation guide for the latest release](https://github.com/xdev-software/selenium-elements/releases/latest#Installation) ## Support -If you need support as soon as possible and you can't wait for any pull request, feel free to use [our support](https://xdev.software/en/services/support). +If you need support as soon as possible and you can't wait for any pull request, feel free to use [our support](https://xdev.software/en/services-products/support). ## Contributing See the [contributing guide](./CONTRIBUTING.md) for detailed instructions on how to get started with our project. diff --git a/pom.xml b/pom.xml index eff48b3..362e3df 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ software.xdev selenium-elements-root - 1.1.2-SNAPSHOT + 1.2.0-SNAPSHOT pom @@ -44,7 +44,7 @@ com.puppycrawl.tools checkstyle - 13.3.0 + 13.10.0 @@ -82,12 +82,12 @@ net.sourceforge.pmd pmd-core - 7.22.0 + 7.26.0 net.sourceforge.pmd pmd-java - 7.22.0 + 7.26.0 diff --git a/renovate.json5 b/renovate.json5 index 5cde43e..6bcfbcd 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -29,6 +29,16 @@ "maven" ], "groupName": "org.seleniumhq.selenium" + }, + { + "description": "Group org.slf4j", + "matchPackagePatterns": [ + "^org.slf4j" + ], + "datasources": [ + "maven" + ], + "groupName": "org.slf4j" } ] } diff --git a/selenium-elements/pom.xml b/selenium-elements/pom.xml index 17c5989..b1a1fb9 100644 --- a/selenium-elements/pom.xml +++ b/selenium-elements/pom.xml @@ -6,7 +6,7 @@ software.xdev selenium-elements - 1.1.2-SNAPSHOT + 1.2.0-SNAPSHOT jar selenium-elements @@ -53,7 +53,7 @@ org.seleniumhq.selenium selenium-support - 4.41.0 + 4.47.0 @@ -70,37 +70,37 @@ org.javassist javassist - 3.30.2-GA + 3.32.0-GA org.slf4j slf4j-api - 2.0.17 + 2.0.18 org.junit.jupiter junit-jupiter - 6.0.3 + 6.1.3 test org.slf4j slf4j-simple - 2.0.17 + 2.0.18 test software.xdev testcontainers-selenium - 2.0.0 + 2.1.1 test org.seleniumhq.selenium selenium-firefox-driver - 4.41.0 + 4.47.0 test @@ -113,7 +113,7 @@ org.seleniumhq.selenium selenium-chrome-driver - 4.41.0 + 4.47.0 test @@ -144,7 +144,7 @@ com.mycila license-maven-plugin - 5.0.0 + 5.1.1 ${project.organization.url} @@ -223,7 +223,7 @@ org.codehaus.mojo flatten-maven-plugin - 1.7.3 + 1.8.0 ossrh @@ -269,7 +269,7 @@ org.sonatype.central central-publishing-maven-plugin - 0.10.0 + 0.11.0 true sonatype-central-portal @@ -291,7 +291,7 @@ com.puppycrawl.tools checkstyle - 13.3.0 + 13.10.0 @@ -329,12 +329,12 @@ net.sourceforge.pmd pmd-core - 7.22.0 + 7.26.0 net.sourceforge.pmd pmd-java - 7.22.0 + 7.26.0 diff --git a/selenium-elements/src/main/java/software/xdev/selenium/elements/remote/CustomizableRemoteWebElementInstaller.java b/selenium-elements/src/main/java/software/xdev/selenium/elements/remote/CustomizableRemoteWebElementInstaller.java index b147d30..6b41328 100644 --- a/selenium-elements/src/main/java/software/xdev/selenium/elements/remote/CustomizableRemoteWebElementInstaller.java +++ b/selenium-elements/src/main/java/software/xdev/selenium/elements/remote/CustomizableRemoteWebElementInstaller.java @@ -30,15 +30,22 @@ @SuppressWarnings("java:S3011") // Force accessibility public final class CustomizableRemoteWebElementInstaller { + private static Method mSetElementConverter; + public static void install( final RemoteWebDriver driver, final Supplier remoteWebElementSupplier) { try { - final Method mSetElementConverter = - RemoteWebDriver.class.getDeclaredMethod("setElementConverter", JsonToWebElementConverter.class); - mSetElementConverter.setAccessible(true); + if(mSetElementConverter == null) + { + mSetElementConverter = RemoteWebDriver.class.getDeclaredMethod( + "setElementConverter", + JsonToWebElementConverter.class); + mSetElementConverter.setAccessible(true); + } + mSetElementConverter.invoke( driver, new CustomizableJsonToWebElementConverter(driver, remoteWebElementSupplier)); diff --git a/selenium-elements/src/main/java/software/xdev/selenium/elements/remote/ImprovedRemoteWebElement.java b/selenium-elements/src/main/java/software/xdev/selenium/elements/remote/ImprovedRemoteWebElement.java index db088c3..3832fa6 100644 --- a/selenium-elements/src/main/java/software/xdev/selenium/elements/remote/ImprovedRemoteWebElement.java +++ b/selenium-elements/src/main/java/software/xdev/selenium/elements/remote/ImprovedRemoteWebElement.java @@ -36,12 +36,20 @@ public class ImprovedRemoteWebElement extends RemoteWebElement implements CanFindElementsSelfSearchContext { protected Logger logger; - protected final String waitForServerLoadToFinishFunction; + + protected String waitForServerLoadToFinishFunction; protected boolean autoScrollIntoView = true; public ImprovedRemoteWebElement(final String waitForServerLoadToFinishFunction) + { + this.withWaitForServerLoadToFinishFunction(waitForServerLoadToFinishFunction); + } + + public ImprovedRemoteWebElement withWaitForServerLoadToFinishFunction( + final String waitForServerLoadToFinishFunction) { this.waitForServerLoadToFinishFunction = waitForServerLoadToFinishFunction; + return this; } public ImprovedRemoteWebElement withAutoScrollIntoView(final boolean autoScrollIntoView) diff --git a/selenium-elements/src/test/java/software/xdev/selenium/elements/SimpleContainerTest.java b/selenium-elements/src/test/java/software/xdev/selenium/elements/SimpleContainerTest.java index 45f2081..2623f8a 100644 --- a/selenium-elements/src/test/java/software/xdev/selenium/elements/SimpleContainerTest.java +++ b/selenium-elements/src/test/java/software/xdev/selenium/elements/SimpleContainerTest.java @@ -56,7 +56,9 @@ void simpleCheck(final Capabilities capabilities) () -> new ImprovedRemoteWebElement("return document.readyState == 'complete';")); this.remoteWebDriver.manage().window().maximize(); - this.remoteWebDriver.get(capabilities instanceof FirefoxOptions ? "about:support" : "chrome://version"); + this.remoteWebDriver.get(capabilities instanceof FirefoxOptions + ? "file:///proc/cpuinfo" + : "chrome://version"); final BodyElement bodyElement = this.waitForFirst(BodyElement.class); final String text = bodyElement.getText();