diff --git a/.github/workflows/broken-links.yml b/.github/workflows/broken-links.yml index 16a3f37..e2f3597 100644 --- a/.github/workflows/broken-links.yml +++ b/.github/workflows/broken-links.yml @@ -31,13 +31,13 @@ jobs: GH_TOKEN: ${{ github.token }} - name: Close issue if everything is fine - if: env.lychee_exit_code == 0 && steps.find-issue.outputs.number != '' + if: steps.lychee.outputs.exit_code == 0 && steps.find-issue.outputs.number != '' run: gh issue close -r 'not planned' ${{ steps.find-issue.outputs.number }} env: GH_TOKEN: ${{ github.token }} - name: Create Issue From File - if: env.lychee_exit_code != 0 + if: steps.lychee.outputs.exit_code != 0 uses: peter-evans/create-issue-from-file@e8ef132d6df98ed982188e460ebb3b5d4ef3a9cd # v5 with: issue-number: ${{ steps.find-issue.outputs.number }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 210ef8c..5f8fb83 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -104,9 +104,6 @@ jobs: runs-on: ubuntu-latest needs: [prepare-release] timeout-minutes: 60 - permissions: - contents: read - packages: write steps: - uses: actions/checkout@v4 @@ -121,15 +118,17 @@ jobs: with: # running setup-java overwrites the settings.xml distribution: 'temurin' java-version: '17' + server-id: github-central + server-password: PACKAGES_CENTRAL_TOKEN gpg-passphrase: MAVEN_GPG_PASSPHRASE gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Only import once - - name: Publish to Central Portal - run: ../mvnw -B deploy -P publish -DskipTests -DaltDeploymentRepository=github::https://maven.pkg.github.com/${{ github.repository }} + - name: Publish to GitHub Packages Central + run: ../mvnw -B deploy -P publish -DskipTests -DaltDeploymentRepository=github-central::https://maven.pkg.github.com/xdev-software/central + working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PACKAGES_CENTRAL_TOKEN: ${{ secrets.PACKAGES_CENTRAL_TOKEN }} MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} - working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} - name: Set up JDK uses: actions/setup-java@v4 diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml deleted file mode 100644 index df6dbb7..0000000 --- a/.github/workflows/sonar.yml +++ /dev/null @@ -1,79 +0,0 @@ -name: Sonar - -on: - workflow_dispatch: - push: - branches: [ develop ] - paths-ignore: - - '**.md' - - '.config/**' - - '.github/**' - - '.idea/**' - - 'assets/**' - pull_request: - branches: [ develop ] - paths-ignore: - - '**.md' - - '.config/**' - - '.github/**' - - '.idea/**' - - 'assets/**' - -env: - SONARCLOUD_ORG: ${{ github.event.organization.login }} - SONARCLOUD_HOST: https://sonarcloud.io - -jobs: - token-check: - runs-on: ubuntu-latest - if: ${{ !(github.event_name == 'pull_request' && startsWith(github.head_ref, 'renovate/')) }} - timeout-minutes: 5 - outputs: - hasToken: ${{ steps.check-token.outputs.has }} - steps: - - id: check-token - run: | - [ -z $SONAR_TOKEN ] && echo "has=false" || echo "has=true" >> "$GITHUB_OUTPUT" - env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - - sonar-scan: - runs-on: ubuntu-latest - needs: token-check - if: ${{ needs.token-check.outputs.hasToken }} - timeout-minutes: 30 - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - - name: Set up JDK - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: 17 - - - name: Cache SonarCloud packages - uses: actions/cache@v4 - with: - path: ~/.sonar/cache - key: ${{ runner.os }}-sonar - restore-keys: ${{ runner.os }}-sonar - - - name: Cache Maven packages - uses: actions/cache@v4 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 - - - name: Build with Maven - run: | - ./mvnw -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \ - -DskipTests \ - -Dsonar.projectKey=${{ env.SONARCLOUD_ORG }}_${{ github.event.repository.name }} \ - -Dsonar.organization=${{ env.SONARCLOUD_ORG }} \ - -Dsonar.host.url=${{ env.SONARCLOUD_HOST }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml index 922eda0..046be63 100644 --- a/.github/workflows/test-deploy.yml +++ b/.github/workflows/test-deploy.yml @@ -10,9 +10,6 @@ jobs: publish-maven: runs-on: ubuntu-latest timeout-minutes: 60 - permissions: - contents: read - packages: write steps: - uses: actions/checkout@v4 @@ -21,14 +18,16 @@ jobs: with: # running setup-java overwrites the settings.xml distribution: 'temurin' java-version: '17' + server-id: github-central + server-password: PACKAGES_CENTRAL_TOKEN gpg-passphrase: MAVEN_GPG_PASSPHRASE gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Only import once - - name: Publish to GitHub Packages - run: ../mvnw -B deploy -P publish -DskipTests -DaltDeploymentRepository=github::https://maven.pkg.github.com/${{ github.repository }} + - name: Publish to GitHub Packages Central + run: ../mvnw -B deploy -P publish -DskipTests -DaltDeploymentRepository=github-central::https://maven.pkg.github.com/xdev-software/central working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PACKAGES_CENTRAL_TOKEN: ${{ secrets.PACKAGES_CENTRAL_TOKEN }} MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} - name: Set up JDK diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties index 3112b8e..6a6b8b2 100644 --- a/.mvn/wrapper/maven-wrapper.properties +++ b/.mvn/wrapper/maven-wrapper.properties @@ -14,4 +14,4 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.10/apache-maven-3.9.10-bin.zip +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.11/apache-maven-3.9.11-bin.zip diff --git a/CHANGELOG.md b/CHANGELOG.md index cff82d2..dea1571 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 1.0.4 +* ``ImprovedWebElement#hasAttribute`` now waits for loading operations to complete (now calls ``prepareForOperation`` as ``getProperty`` already does) + # 1.0.3 * Removed reflection calls in ``CustomizableJsonToWebElementConverter`` as https://github.com/SeleniumHQ/selenium/issues/15884 was fixed #11 * Selenium version 4.34+ is required diff --git a/README.md b/README.md index 4ef1006..0879313 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ [![Latest version](https://img.shields.io/maven-central/v/software.xdev/selenium-elements?logo=apache%20maven)](https://mvnrepository.com/artifact/software.xdev/selenium-elements) [![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/selenium-elements/check-build.yml?branch=develop)](https://github.com/xdev-software/selenium-elements/actions/workflows/check-build.yml?query=branch%3Adevelop) -[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=xdev-software_selenium-elements&metric=alert_status)](https://sonarcloud.io/dashboard?id=xdev-software_selenium-elements) # Elements for Selenium diff --git a/selenium-elements/src/main/java/software/xdev/selenium/elements/ImprovedWebElement.java b/selenium-elements/src/main/java/software/xdev/selenium/elements/ImprovedWebElement.java index 7839a95..896c004 100644 --- a/selenium-elements/src/main/java/software/xdev/selenium/elements/ImprovedWebElement.java +++ b/selenium-elements/src/main/java/software/xdev/selenium/elements/ImprovedWebElement.java @@ -109,6 +109,7 @@ default void dispatchCustomEvent( default boolean hasAttribute(final String attribute) { + this.prepareForOperation(); return (boolean)this.callFunction("hasAttribute", attribute); }