From 6f2524fecb3dbb68f35b930a1c9bb3e582a2bee3 Mon Sep 17 00:00:00 2001 From: jackydnb Date: Fri, 28 Oct 2022 12:33:49 +0300 Subject: [PATCH 1/5] suacelab version update --- .travis.yml | 44 ------------------- pom.xml | 39 +++++++++++++--- .../uiobjects/example/entities/Contacts.java | 2 +- .../example/entities/MarvelUserInfo.java | 2 +- .../uiobjects/example/entities/User.java | 2 +- .../example/site/custom/MultiDropdown.java | 8 ++-- .../example/site/sections/ContactForm.java | 2 +- .../mytests/tests/example/DataTableTests.java | 2 +- .../tests/testng/RetryListenerClass.java | 2 +- src/test/resources/test.properties | 2 +- 10 files changed, 43 insertions(+), 62 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2326d18..0000000 --- a/.travis.yml +++ /dev/null @@ -1,44 +0,0 @@ -language: java -before_install: -- sudo apt-get -y install jq -- java -Xmx32m -version -before_script: -- ls -lah -- google-chrome-stable --version - -addons: - chrome: stable - apt: - packages: - - openjdk-8-jdk - -stages: -- prepare -- compile -jobs: - include: - - stage: prepare - name: JDI LIGHT SAUCELABS TEMPLATE - script: - - echo ------------------- WELCOME TO JDI LIGHT SAUCELABS TEMPLATE ---------------------- - - mvn --version - - - stage: compile - name: Compile jdi light saucelabs template - script: - - mvn install -DskipTests - after_failure: - - echo "Build was failed" - after_success: - - echo "Build was successful" - -notifications: - webhooks: - urls: - - https://outlook.office.com/webhook/ac8f242a-5a99-4fab-a4d7-799de8968df5@b41b72d0-4e9f-4c26-8a69-f949f367c91d/TravisCI/cac0ca45d141409da3358ea48a956ed5/1d65db1e-26ce-4372-9a58-9c3635f1f0bd - on_success: always # default: always - on_failure: always # default: always - -# extra time during long builds -install: -- travis_wait diff --git a/pom.xml b/pom.xml index 54bceb5..f780ede 100644 --- a/pom.xml +++ b/pom.xml @@ -16,12 +16,13 @@ 1.9.6 https://jdi-testing.github.io/jdi-light/ - 2.13.3 + 2.19.0 2.10.0 - 9.4.12.RC2 - 1.3.14 - - + 2.17.1 + 11.0.12 + 1.4.5 + oauth-k.poltorykhin-158a6 + 85f0134b-e183-451e-98a2-1f55bbd7c10b @@ -55,7 +56,31 @@ org.testng testng - 6.14.3 + 7.4.0 + + + + org.apache.logging.log4j + log4j-api + ${log4j2.version} + + + + org.apache.logging.log4j + log4j-core + ${log4j2.version} + + + + org.apache.logging.log4j + log4j-slf4j-impl + ${log4j2.version} + + + + org.apache.logging.log4j + log4j-1.2-api + ${log4j2.version} @@ -70,7 +95,7 @@ org.apache.maven.plugins maven-surefire-plugin - 2.21.0 + 3.0.0-M7 src/test/resources/general.xml diff --git a/src/main/java/org/mytests/uiobjects/example/entities/Contacts.java b/src/main/java/org/mytests/uiobjects/example/entities/Contacts.java index 7ba08b0..54fee42 100644 --- a/src/main/java/org/mytests/uiobjects/example/entities/Contacts.java +++ b/src/main/java/org/mytests/uiobjects/example/entities/Contacts.java @@ -1,6 +1,6 @@ package org.mytests.uiobjects.example.entities; -import com.epam.jdi.tools.DataClass; +import com.jdiai.tools.DataClass; public class Contacts extends DataClass { public String firstName; diff --git a/src/main/java/org/mytests/uiobjects/example/entities/MarvelUserInfo.java b/src/main/java/org/mytests/uiobjects/example/entities/MarvelUserInfo.java index ae93b21..2f95eeb 100644 --- a/src/main/java/org/mytests/uiobjects/example/entities/MarvelUserInfo.java +++ b/src/main/java/org/mytests/uiobjects/example/entities/MarvelUserInfo.java @@ -1,6 +1,6 @@ package org.mytests.uiobjects.example.entities; -import com.epam.jdi.tools.DataClass; +import com.jdiai.tools.DataClass; public class MarvelUserInfo extends DataClass { public String number, type, user, description; diff --git a/src/main/java/org/mytests/uiobjects/example/entities/User.java b/src/main/java/org/mytests/uiobjects/example/entities/User.java index 157ee74..42643a0 100644 --- a/src/main/java/org/mytests/uiobjects/example/entities/User.java +++ b/src/main/java/org/mytests/uiobjects/example/entities/User.java @@ -1,7 +1,7 @@ package org.mytests.uiobjects.example.entities; -import com.epam.jdi.tools.DataClass; +import com.jdiai.tools.DataClass; public class User extends DataClass { public String name = "Roman"; diff --git a/src/main/java/org/mytests/uiobjects/example/site/custom/MultiDropdown.java b/src/main/java/org/mytests/uiobjects/example/site/custom/MultiDropdown.java index 9d44307..486e59b 100644 --- a/src/main/java/org/mytests/uiobjects/example/site/custom/MultiDropdown.java +++ b/src/main/java/org/mytests/uiobjects/example/site/custom/MultiDropdown.java @@ -18,10 +18,10 @@ import static com.epam.jdi.light.elements.init.UIFactory.$; import static com.epam.jdi.light.elements.init.UIFactory.$$; import static com.epam.jdi.light.logger.LogLevels.DEBUG; -import static com.epam.jdi.tools.EnumUtils.getEnumValues; -import static com.epam.jdi.tools.LinqUtils.ifSelect; -import static com.epam.jdi.tools.LinqUtils.map; -import static com.epam.jdi.tools.LinqUtils.toList; +import static com.jdiai.tools.EnumUtils.getEnumValues; +import static com.jdiai.tools.LinqUtils.ifSelect; +import static com.jdiai.tools.LinqUtils.map; +import static com.jdiai.tools.LinqUtils.toList; import static java.util.Arrays.asList; import static org.jsoup.internal.StringUtil.isBlank; diff --git a/src/main/java/org/mytests/uiobjects/example/site/sections/ContactForm.java b/src/main/java/org/mytests/uiobjects/example/site/sections/ContactForm.java index 01c2581..bdf07c2 100644 --- a/src/main/java/org/mytests/uiobjects/example/site/sections/ContactForm.java +++ b/src/main/java/org/mytests/uiobjects/example/site/sections/ContactForm.java @@ -11,7 +11,7 @@ import java.lang.reflect.Field; -import static com.epam.jdi.tools.ReflectionUtils.isInterface; +import static com.jdiai.tools.ReflectionUtils.isInterface; public class ContactForm extends Form { TextField name, lastName, position, passportNumber, passportSeria; diff --git a/src/test/java/org/mytests/tests/example/DataTableTests.java b/src/test/java/org/mytests/tests/example/DataTableTests.java index 3841b85..a198f3f 100644 --- a/src/test/java/org/mytests/tests/example/DataTableTests.java +++ b/src/test/java/org/mytests/tests/example/DataTableTests.java @@ -11,7 +11,7 @@ import static com.epam.jdi.light.elements.complex.table.Column.inColumn; import static com.epam.jdi.light.elements.complex.table.TableMatcher.containsValue; import static com.epam.jdi.light.elements.complex.table.TableMatcher.hasValue; -import static com.epam.jdi.tools.StringUtils.LINE_BREAK; +import static com.jdiai.tools.StringUtils.LINE_BREAK; import static java.util.Arrays.asList; import static org.apache.commons.lang3.StringUtils.isBlank; import static org.hamcrest.Matchers.greaterThan; diff --git a/src/test/java/org/mytests/tests/testng/RetryListenerClass.java b/src/test/java/org/mytests/tests/testng/RetryListenerClass.java index 6f6e3ef..ea703f5 100644 --- a/src/test/java/org/mytests/tests/testng/RetryListenerClass.java +++ b/src/test/java/org/mytests/tests/testng/RetryListenerClass.java @@ -11,7 +11,7 @@ public class RetryListenerClass implements IAnnotationTransformer { @Override public void transform(ITestAnnotation testannotation, Class testClass, Constructor testConstructor, Method testMethod) { - IRetryAnalyzer retry = testannotation.getRetryAnalyzer(); + Class retry = testannotation.getRetryAnalyzerClass(); if (retry == null) { testannotation.setRetryAnalyzer(RetryFailedTestCases.class); } diff --git a/src/test/resources/test.properties b/src/test/resources/test.properties index 96b8697..3139680 100644 --- a/src/test/resources/test.properties +++ b/src/test/resources/test.properties @@ -3,7 +3,7 @@ driver=${driver} timeout.wait.element=5 timeout.wait.page=25 domain=${domain} -driver.getLatest=true +#driver.getLatest=true smart.locators=#%s smart.locator=#%s log.level=INFO From 1a3d3b2483ce61831fad509625bdfb189495043d Mon Sep 17 00:00:00 2001 From: jackydnb Date: Mon, 14 Nov 2022 13:29:15 +0300 Subject: [PATCH 2/5] pom.xml & ci update --- .github/workflows/maven.yml | 3 +++ pom.xml | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index c531921..ac646e9 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -10,6 +10,9 @@ on: branches: [ master ] pull_request: branches: [ master ] + repository_dispatch: + types: + - webhook jobs: build: diff --git a/pom.xml b/pom.xml index f780ede..f18bdfb 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ 2.10.0 2.17.1 11.0.12 - 1.4.5 + oauth-k.poltorykhin-158a6 85f0134b-e183-451e-98a2-1f55bbd7c10b @@ -43,7 +43,13 @@ com.epam.jdi jdi-light-html - ${jdi.version} + LATEST + + + + org.jsoup + jsoup + LATEST From 2e2e970af12a1b4a760539e2a18bc8026f7e17f9 Mon Sep 17 00:00:00 2001 From: jackydnb Date: Thu, 17 Nov 2022 14:28:09 +0300 Subject: [PATCH 3/5] updated ci and pom --- .github/workflows/maven.yml | 31 ++++++++++--------- pom.xml | 11 ++----- .../example/site/custom/MultiDropdown.java | 2 +- 3 files changed, 20 insertions(+), 24 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index ac646e9..cbbba75 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -4,6 +4,7 @@ name: Java CI with Maven env: ALLURE_VERSION: "2.10.0" + SUREFIRE_ARGS: "--add-opens java.base/java.lang=ALL-UNNAMED" on: push: @@ -17,7 +18,7 @@ on: jobs: build: name: Tests on JDK - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 strategy: max-parallel: 1 fail-fast: false @@ -25,49 +26,45 @@ jobs: java: [ 8, 9, 10, 11, 12, 13, 14, 15 ] # doesn't work on 16 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v1 + uses: actions/setup-java@v3 with: java-version: ${{ matrix.java }} java-package: jdk + distribution: 'zulu' + cache: 'maven' - name: Build with Maven id: build run: mvn install -DskipTests -ntp - name: Start Selenoid - uses: n-ton4/selenoid-github-action@master + uses: Xotabu4/selenoid-github-action@v2 id: start-selenoid if: github.event_name == 'pull_request' && success() with: - version: 1.10.1 - args: -limit 6 - browsers: firefox:91.0 - last-versions: 1 + selenoid-start-arguments: | + --args "-timeout 60s -limit 5" - name: Check Selenoid has been started run: curl http://localhost:4444/status - if: github.event_name == 'pull_request' && success() - name: Tests - id: ftests + id: functests timeout-minutes: 10 - if: github.event_name == 'pull_request' && success() run: mvn test -Pci -ntp - name: Get Allure history uses: actions/checkout@v2 id: allure-setup continue-on-error: true - if: github.event_name == 'pull_request' && failure() with: ref: gh-pages path: gh-pages - name: Generate Allure report uses: simple-elf/allure-report-action@master - if: github.event_name == 'pull_request' && always() with: allure_results: target/allure-results allure_report: target/allure-report @@ -75,15 +72,19 @@ jobs: - name: Upload Allure report uses: actions/upload-artifact@master - if: github.event_name == 'pull_request' && failure() with: name: Allure report path: target/allure-report - name: Deploy Allure report to Github Pages - if: github.event_name == 'pull_request' && always() uses: peaceiris/actions-gh-pages@v2 env: PERSONAL_TOKEN: ${{ secrets.GITHUB_TOKEN }} PUBLISH_BRANCH: gh-pages PUBLISH_DIR: allure-history + + - name: Check tests are passed + if: ${{ steps.functests.outcome != 'success' }} + run: | + echo Tests result: ${{ steps.functests.outcome }} + exit 1 \ No newline at end of file diff --git a/pom.xml b/pom.xml index f18bdfb..fb21271 100644 --- a/pom.xml +++ b/pom.xml @@ -11,10 +11,10 @@ UTF-8 - firefox + chrome - 1.9.6 + 1.9.7 https://jdi-testing.github.io/jdi-light/ 2.19.0 2.10.0 @@ -46,12 +46,7 @@ LATEST - - org.jsoup - jsoup - LATEST - - + io.qameta.allure diff --git a/src/main/java/org/mytests/uiobjects/example/site/custom/MultiDropdown.java b/src/main/java/org/mytests/uiobjects/example/site/custom/MultiDropdown.java index 486e59b..14652e6 100644 --- a/src/main/java/org/mytests/uiobjects/example/site/custom/MultiDropdown.java +++ b/src/main/java/org/mytests/uiobjects/example/site/custom/MultiDropdown.java @@ -23,7 +23,7 @@ import static com.jdiai.tools.LinqUtils.map; import static com.jdiai.tools.LinqUtils.toList; import static java.util.Arrays.asList; -import static org.jsoup.internal.StringUtil.isBlank; +import static org.apache.commons.lang3.StringUtils.isBlank; public class MultiDropdown extends UIListBase, MultiDropdown>> implements ICoreElement, HasLabel { From ce06809409d6261479f3d2b0f13e9563efbc33e5 Mon Sep 17 00:00:00 2001 From: jackydnb Date: Thu, 17 Nov 2022 14:36:31 +0300 Subject: [PATCH 4/5] Update maven.yml --- .github/workflows/maven.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index cbbba75..a49bcd8 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -84,7 +84,7 @@ jobs: PUBLISH_DIR: allure-history - name: Check tests are passed - if: ${{ steps.functests.outcome != 'success' }} - run: | - echo Tests result: ${{ steps.functests.outcome }} - exit 1 \ No newline at end of file + if: ${{ steps.functests.outcome != 'success' }} + run: | + echo Tests result: ${{ steps.functests.outcome }} + exit 1 \ No newline at end of file From c536f14d4057e84e2aebc7b78a20f829edd44af1 Mon Sep 17 00:00:00 2001 From: jackydnb Date: Fri, 25 Nov 2022 12:53:44 +0300 Subject: [PATCH 5/5] ci update --- .github/workflows/maven.yml | 70 +++++++++++----------------- pom.xml | 2 + src/test/resources/chrome.properties | 1 + 3 files changed, 30 insertions(+), 43 deletions(-) create mode 100644 src/test/resources/chrome.properties diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index a49bcd8..7302f9c 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -1,16 +1,19 @@ -# This workflow will build a Java project with Maven -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven - -name: Java CI with Maven +name: Run tests env: ALLURE_VERSION: "2.10.0" SUREFIRE_ARGS: "--add-opens java.base/java.lang=ALL-UNNAMED" on: push: - branches: [ master ] + branches: + - master + pull_request: - branches: [ master ] + branches: + - master + release: + types: # This configuration does not affect the page_build event above + - created repository_dispatch: types: - webhook @@ -18,12 +21,12 @@ on: jobs: build: name: Tests on JDK - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: max-parallel: 1 fail-fast: false matrix: - java: [ 8, 9, 10, 11, 12, 13, 14, 15 ] # doesn't work on 16 + java: [ 8, 11, 13, 14, 15, 17, 18 ] steps: - uses: actions/checkout@v3 @@ -31,37 +34,31 @@ jobs: uses: actions/setup-java@v3 with: java-version: ${{ matrix.java }} - java-package: jdk distribution: 'zulu' + java-package: jdk cache: 'maven' - - name: Build with Maven - id: build - run: mvn install -DskipTests -ntp + - name: Set parameters for AspectJ + id: aspect_j_params + if: ${{ matrix.java > 15 }} + run: | + echo "ASPECT_ARGS=-Daspectj.args="\"$SUREFIRE_ARGS\" >> $GITHUB_ENV - - name: Start Selenoid - uses: Xotabu4/selenoid-github-action@v2 - id: start-selenoid - if: github.event_name == 'pull_request' && success() - with: - selenoid-start-arguments: | - --args "-timeout 60s -limit 5" + - name: Set parameters for AspectJ + id: aspect_j_params_empty + if: ${{ matrix.java < 16 }} + run: | + echo "ASPECT_ARGS=-Daspectj.args=''" >> $GITHUB_ENV - - name: Check Selenoid has been started - run: curl http://localhost:4444/status + - name: Build with Maven + id: build + run: mvn clean install -DskipTests -ntp - name: Tests id: functests - timeout-minutes: 10 - run: mvn test -Pci -ntp - - - name: Get Allure history - uses: actions/checkout@v2 - id: allure-setup + timeout-minutes: 15 continue-on-error: true - with: - ref: gh-pages - path: gh-pages + run: mvn test -ntp ${{ env.ASPECT_ARGS }} --fail-at-end - name: Generate Allure report uses: simple-elf/allure-report-action@master @@ -70,19 +67,6 @@ jobs: allure_report: target/allure-report allure_history: allure-history - - name: Upload Allure report - uses: actions/upload-artifact@master - with: - name: Allure report - path: target/allure-report - - - name: Deploy Allure report to Github Pages - uses: peaceiris/actions-gh-pages@v2 - env: - PERSONAL_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PUBLISH_BRANCH: gh-pages - PUBLISH_DIR: allure-history - - name: Check tests are passed if: ${{ steps.functests.outcome != 'success' }} run: | diff --git a/pom.xml b/pom.xml index fb21271..b939f2f 100644 --- a/pom.xml +++ b/pom.xml @@ -23,6 +23,7 @@ oauth-k.poltorykhin-158a6 85f0134b-e183-451e-98a2-1f55bbd7c10b + @@ -102,6 +103,7 @@ src/test/resources/general.xml + ${aspectj.args} -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar" diff --git a/src/test/resources/chrome.properties b/src/test/resources/chrome.properties new file mode 100644 index 0000000..1ce1f7f --- /dev/null +++ b/src/test/resources/chrome.properties @@ -0,0 +1 @@ +arguments=--no-sandbox --headless --disable-dev-shm-usage --disable-gpu \ No newline at end of file