Open SorayaAzzaoui opened 1 year ago
Caused by: net.thucydides.core.webdriver.DriverConfigurationError: WebDriver was unable to create a new instance of type class org.openqa.selenium.chrome.ChromeDriver WebDriver reported the following message: Could not start a new session. Response code 500. Message: session not created: Chrome failed to start: exited normally. (session not created: DevToolsActivePort file doesn't exist) (The process started from chrome location /opt/google/chrome/chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
What happened?
Hello everyone I have a problem with my project, the tests are not running I have a buid failure error, locally it works who could help me please thank you
What did you expect to happen?
package com.PageObject;
import io.github.bonigarcia.wdm.WebDriverManager; import net.serenitybdd.core.pages.PageObject;
import java.time.Duration;
import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait;
public class LoginPage extends PageObject{
}
Serenity BDD version
3.6.21
JDK version
17
Execution environment
package com.gex.runners;
import io.cucumber.junit.CucumberOptions; import net.serenitybdd.core.Serenity; import net.serenitybdd.cucumber.CucumberWithSerenity; import org.junit.runner.RunWith;
@RunWith(CucumberWithSerenity.class) @CucumberOptions( plugin = {"pretty", "json:target/cucumber-reports/Cucumber.json"}, features = {"src/test/resources/features"}, glue = {"com.gex.steps"}
) public class TestRunner { String testPlanKey = Serenity.sessionVariableCalled("xray.testplan.key"); }
How to reproduce the bug.
name: Testing
on: workflow_dispatch: inputs: test_plan_key_variable: description: 'Test Plan Key Variable' default: 'AZ-' # You can set a default value here required: true
jobs: test: timeout-minutes: 180 runs-on: ubuntu-20.04 steps:
name: Debug Secrets run: | echo "CLIENT_ID: ${{ secrets.CLIENT_ID }}" echo "CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}"
name: Set inputs from workflow_dispatch if: github.event_name == 'workflow_dispatch' run: | PLAN_TEST="${{ github.event.inputs.test_plan_key_variable }}" echo "PLAN_TEST=$PLAN_TEST" >> $GITHUB_ENV
name: Checkout code uses: actions/checkout@v2 with: ref: main fetch-depth: 0
name: JAVA JDK 17 uses: actions/setup-java@v2 with: java-version: '17' distribution: 'adopt' overwrite-settings: false
name: Cache Maven packages uses: actions/cache@v2 with: path: ~/.m2 key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-m2
name: Install Chrome uses: browser-actions/setup-chrome@v1
name: Install unzip run: | sudo apt-get install unzip if: success() # Install unzip only if previous steps are successful
name: Get xray cloud API token run: | token=$(curl -H "Content-Type: application/json" -X POST --data '{ "client_id": "${{ secrets.XRAY_CLIENT_ID }}", "client_secret": "${{ secrets.XRAY_CLIENT_SECRET }}" }' https://xray.cloud.getxray.app/api/v2/authenticate | tr -d '"') echo "XRAY_TOKEN=$token" >> $GITHUB_ENV echo $token env: XRAY_CLIENT_ID: ${{ secrets.XRAY_CLIENT_ID }} XRAY_CLIENT_SECRET: ${{ secrets.XRAY_CLIENT_SECRET }}
name: Create features directory run: mkdir -p $GITHUB_WORKSPACE/my-temp-directory/features
name: Export scenarios from Xray and generate .feature file(s) run: | curl -X GET -L -H "Content-Type: application/json" -o $GITHUB_WORKSPACE/my-temp-directory/features.zip -X GET -H "Authorization: Bearer $token" "https://xray.cloud.getxray.app/api/v1/export/cucumber?keys=${{ github.event.inputs.test_plan_key_variable }}"
name: Check features.zip file size run: | ls -l $GITHUB_WORKSPACE/my-temp-directory/features.zip continue-on-error: true
name: Re-download features.zip run: | curl -X GET -L -H "Content-Type: application/json" -o $GITHUB_WORKSPACE/my-temp-directory/features.zip -H "Authorization: Bearer $XRAY_TOKEN" "https://xray.cloud.getxray.app/api/v1/export/cucumber?keys=${{ github.event.inputs.test_plan_key_variable }}"
name: Examine the contents of .zip run: | ZIP_FILE=$(find $GITHUB_WORKSPACE/my-temp-directory -name ".zip" -type f)
name: Examine and unzip the contents of .zip run: | for zip_file in $GITHUB_WORKSPACE/my-temp-directory/.zip; do if [ -e "$zip_file" ]; then unzip -o -q "$zip_file" -d $GITHUB_WORKSPACE/my-temp-directory/features fi done continue-on-error: true # Continue même s'il y a une erreur
name: Afficher le contenu des fichiers extraits run: | for file in $GITHUB_WORKSPACE/my-temp-directory/features/*; do if [ -f "$file" ]; then cat "$file" fi done continue-on-error: true
name: Créer le fichier test.feature run: touch $GITHUB_WORKSPACE/src/test/resources/features/test.feature
name: Copier le fichier .feature run: |
Rechercher un fichier avec l'extension .feature dans le répertoire source
name: Exécuter les tests Maven du fichier test.feature run: mvn clean verify -Dcucumber.features=$GITHUB_WORKSPACE/src/test/resources/features/test.feature -f $GITHUB_WORKSPACE/pom.xml || true
name: Archive Serenity Reports uses: actions/upload-artifact@v2 with: name: serenity-reports path: target/serenity-reports
name: Set Serenity Reports URL id: set-reports-url run: | ARTIFACT_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" echo "::set-output name=url::$ARTIFACT_URL"
name: Send email with Serenity report link run: | ARTIFACT_URL="${{ steps.set-reports-url.outputs.url }}" echo "Hi, Please find the Serenity test reports at the following link: Open Serenity Reports Best regards, Your CI Workflow" | mail -s "Serenity Test Reports" sorayaaikar@hotmail.com
name: Checkout gh-pages branch uses: actions/checkout@v2 with: ref: gh-pages path: gh-pages
name: Upload Serenity reports zip to GitHub Pages uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: gh-pages publish_branch: gh-pages keep_files: true
name: Get Serenity Reports URL id: get-reports-url run: | ARTIFACT_URL="https://github.com/${{ github.repository }}/tree/gh-pages" echo "::set-output name=url::$ARTIFACT_URL"
name: Send email with Serenity report link run: | ARTIFACT_URL="${{ steps.get-reports-url.outputs.url }}" echo "Hi, Please find the Serenity test reports at the following link: Open Serenity Reports Best regards, Your CI Workflow" | mail -s "Serenity Test Reports" soraya.azzaoui.partner@decathlon.com
name: Submit results to Xray if: always() uses: mikepenz/xray-action@v2.4.5 with: username: ${{ secrets.XRAY_CLIENT_ID }} password: ${{ secrets.XRAY_CLIENT_SECRET }} xrayCloud: true testFormat: "junit" testPaths: "/home/runner/work/GexSerenityBDDFramwork/GexSerenityBDDFramwork/target/failsafe-reports/TEST-*.xml" projectKey: "AZ" testExecKey: ${{ github.event.inputs.test_exec_key_variable }} testPlanKey: ${{ github.event.inputs.test_plan_key_variable }}
name: Remove the temporary directory run: | rm -rf $GITHUB_WORKSPACE/my-temp-directory
Downloaded from central: https://repo.maven.apache.org/maven2/org/bouncycastle/bcprov-jdk15on/1.64/bcprov-jdk15on-1.64.jar (4.8 MB at 15 MB/s) [INFO] Test results for 2 tests generated in 2.3 secs in directory: file:/home/runner/work/GexSerenityBDDFramwork/GexSerenityBDDFramwork/target/site/serenity/ [INFO] ------------------------------------------------ [INFO] | SERENITY TESTS: | ERROR [INFO] ------------------------------------------------ [INFO] | Test scenarios executed | 2 [INFO] | Total Test cases executed | 2 [INFO] | Tests passed | 0 [INFO] | Tests failed | 0 [INFO] | Tests with errors | 2 [INFO] | Tests compromised | 0 [INFO] | Tests aborted | 0 [INFO] | Tests pending | 0 [INFO] | Tests ignored/skipped | 0 [INFO] ------------------------------- | -------------- [INFO] | Total Duration| 10s 123ms [INFO] | Fastest test took| 550ms [INFO] | Slowest test took| 9s 573ms [INFO] ------------------------------------------------ [INFO] [INFO] SERENITY REPORTS [INFO] - Full Report: file:///home/runner/work/GexSerenityBDDFramwork/GexSerenityBDDFramwork/target/site/serenity/index.html [INFO] [INFO] --- maven-failsafe-plugin:3.0.0-M5:verify (default) @ SerenityBDDFramworkSoraya --- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 43.386 s [INFO] Finished at: 2023-10-24T11:08:28Z [INFO] ------------------------------------------------------------------------ Error: Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:3.0.0-M5:verify (default) on project SerenityBDDFramworkSoraya: There are test failures. Error:
Error: Please refer to /home/runner/work/GexSerenityBDDFramwork/GexSerenityBDDFramwork/target/failsafe-reports for the individual test results. Error: Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream. Error: -> [Help 1] Error:
Error: To see the full stack trace of the errors, re-run Maven with the -e switch. Error: Re-run Maven using the -X switch to enable full debug logging. Error:
Error: For more information about the errors and possible solutions, please read the following articles: Error: [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
How can we make it happen?
Work on this myself and propose a PR (with Serenity BDD team guidance)