AppiumTestDistribution / appium-device-farm

This is an Appium 2.0 plugin designed to manage and create driver sessions on available devices.
https://devicefarm.org
Other
336 stars 102 forks source link

How to change TestName in build section #1374

Closed richy26 closed 1 month ago

richy26 commented 1 month ago

Please suggest any command or capability to set testname which appears in the build section.

saikrishna321 commented 1 month ago

@richy26

  await driver.executeScript('devicefarm: setSessionName', [
    {
      name: 'Test Name',
    },
  ]);
richy26 commented 1 month ago

@richy26

  await driver.executeScript('devicefarm: setSessionName', [
    {
      name: 'Test Name',
    },
  ]);

How to do the same in java ?

richy26 commented 1 month ago

Is there any capability we can set or any other way to do this?

erdncyz commented 1 month ago

Hi @richy26,

For buid area :

ı uses df:build: "" in capabilities area and then ı sent this value

[:caps]['df:build']= "#{BeINLib::BaseConfig.project}" + "#{Date.today.strftime('%d-%m-%Y').to_s}"

BeINLib::BaseConfig.project this is my project name and "#{Date.today.strftime('%d-%m-%Y').to_s} give me today date.

ı saw like this :

image

For test name area : $CAPS[:caps][:testName] = scenario.name

scenario means like

image

ı saw like this : image

richy26 commented 1 month ago

@richy26

  await driver.executeScript('devicefarm: setSessionName', [
    {
      name: 'Test Name',
    },
  ]);

Hi @saikrishna321 How to set this in Java? For example -
capabilities.setCapability("df:recordVideo", true); capabilities.setCapability("df:build", "Sep 30 Build");

I'm not able to change the test name and also the status as well in the dashboard Status is showing failed everytime

richy26 commented 1 month ago

@richy26

  await driver.executeScript('devicefarm: setSessionName', [
    {
      name: 'Test Name',
    },
  ]);

Hi @saikrishna321 How to set this in Java? For example - capabilities.setCapability("df:recordVideo", true); capabilities.setCapability("df:build", "Sep 30 Build");

I'm not able to change the test name and also the status as well in the dashboard Status is showing failed everytime

Does anyone have any idea about this ?

saikrishna321 commented 1 month ago

@richy26

driver.executeScript("devicefarm: setSessionName", ImmutableMap.of("name", "Test Name"));