serenity-bdd / serenity-cucumber-starter

A skeleton project for Serenity BDD and Cucumber JVM
Apache License 2.0
179 stars 286 forks source link

Issue serenity-cucumber-starter with serenity core 4.0.15 scaling with lambdatest to test an webpage #137

Open FerxxoD opened 8 months ago

FerxxoD commented 8 months ago

I've automated an scenario with appium to test a webpage. When I run the test with appium and a virtual managed device of android studio this test works well but scaling to lambdatest it won't work.

This is my serenity.conf to test an android app "With this configuration serenity can connect with lambdatest and run the test successfully"

lambdaAndroid{
        webdriver {
          driver = appium
        }

     appium{
       app="YOUR_APP_URL"
        hub = "xxxx.xxxxx@mobile-hub.lambdatest.com/wd/hub"
        user="xxxxx"
        accessKey="xxxx"
              w3c=false
              platform="ANDROID"
              platformName="ANDROID"
              deviceName="Pixel 8 Pro"
              platformVersion="14"
              isRealMobile=true
              isAppAutomate=true
              tunnel=true
          autoWebview = true
          automationName="UiAutomator2"
          appProfiling = false
          autoGrantPermissions = true
          autoAcceptAlerts=true
          deviceLog=true
          visual=true
          network=false
          console=true
          build="test"

     }
}

But, when I want to test a web page with chrome java returns the next mistake: This is the serenity.conf

lambdaAndroid{
        webdriver {
          driver = appium
        }

     appium{
       browserName="chrome"
       noReset=true
        hub = "xxxx.xxxxx@mobile-hub.lambdatest.com/wd/hub"
        user="xxxxx"
        accessKey="xxxx"
              w3c=false
              platform="ANDROID"
              platformName="ANDROID"
              deviceName="Pixel 8 Pro"
              platformVersion="14"
              isRealMobile=true
              isAppAutomate=true
              tunnel=true
          autoWebview = true
          automationName="UiAutomator2"
          appProfiling = false
          autoGrantPermissions = true
          autoAcceptAlerts=true
          deviceLog=true
          visual=true
          network=false
          console=true
          build="test"

     }
}

This is the mistake: Caused by: net.thucydides.core.webdriver.DriverConfigurationError: WebDriver was unable to create a new instance of type class io.appium.java_client.AppiumDriver WebDriver reported the following message: Could not start a new session. Response code 400. Message: platform name is missing in the capabilities

But the capabitily appium:platform is "ANDROID" is in my configuration.

This is the biuld.gradle: apply plugin: 'java' apply plugin: 'eclipse' apply plugin: 'idea' apply plugin: "net.serenity-bdd.serenity-gradle-plugin"

sourceCompatibility = 11 targetCompatibility = 11

ext { serenity_version = '4.0.15' lambdatest_version = '4.0.48' junit_platform_launcher_version="1.10.0" cucumber_junit_platform_engine_version="7.14.0" junit_platform_suite_version="1.10.0" junit_jupiter_engine_version="5.9.3" junit_vintage_engine_version="5.9.3" logback_classic_version="1.2.10" assertj_core_version="3.23.1" }

dependencies { dependencies { testImplementation "net.serenity-bdd:serenity-core:${serenity_version}" testImplementation "net.serenity-bdd:serenity-cucumber:${serenity_version}" testImplementation "net.serenity-bdd:serenity-screenplay:${serenity_version}" testImplementation "net.serenity-bdd:serenity-screenplay-webdriver:${serenity_version}" testImplementation "net.serenity-bdd:serenity-ensure:${serenity_version}" testImplementation "net.serenity-bdd:serenity-lambdatest:${lambdatest_version}" // implementation 'com.github.lambdatest:lambdatest-tunnel-binary:2.0.4' testImplementation "org.junit.platform:junit-platform-launcher:${junit_platform_launcher_version}" testImplementation "io.cucumber:cucumber-junit-platform-engine:${cucumber_junit_platform_engine_version}" testImplementation "org.junit.platform:junit-platform-suite:${junit_platform_suite_version}" testImplementation "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_engine_version}" testImplementation "org.junit.vintage:junit-vintage-engine:${junit_vintage_engine_version}" implementation "ch.qos.logback:logback-classic:${logback_classic_version}" testImplementation "org.assertj:assertj-core:${assertj_core_version}" testImplementation "io.appium:java-client:9.0.0" //implementation "com.github.appium:java-client:7.4.1" } }

Could you please help me. Thank you