Skip to content

Commit

Permalink
Fix for device Name not showing up (#7578)
Browse files Browse the repository at this point in the history
  • Loading branch information
praveendvd committed Oct 21, 2021
1 parent 52fe29f commit f131373
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/wdio-cli/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ export function getRunnerName (caps: Capabilities.DesiredCapabilities = {}) {
caps.appPackage ||
caps.appWaitActivity ||
caps.app ||
caps.platformName
caps.platformName ||
caps['appium:platformName'] ||
caps['appium:appPackage'] ||
caps['appium:appWaitActivity'] ||
caps['appium:app']

// MultiRemote
if (!runner) {
Expand Down
4 changes: 4 additions & 0 deletions packages/wdio-cli/tests/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ test('runOnCompleteHook with failure returns 1', async () => {
})

test('getRunnerName', () => {
expect(getRunnerName({ 'appium:appPackage': 'foobar' })).toBe('foobar')
expect(getRunnerName({ 'appium:appWaitActivity': 'foobar' })).toBe('foobar')
expect(getRunnerName({ 'appium:app': 'foobar' })).toBe('foobar')
expect(getRunnerName({ 'appium:platformName': 'foobar' })).toBe('foobar')
expect(getRunnerName({ browserName: 'foobar' })).toBe('foobar')
expect(getRunnerName({ appPackage: 'foobar' })).toBe('foobar')
expect(getRunnerName({ appWaitActivity: 'foobar' })).toBe('foobar')
Expand Down
3 changes: 3 additions & 0 deletions packages/wdio-types/src/Capabilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,12 @@ export interface AppiumCapabilities {
// Appium General W3C Capabilities
export interface AppiumW3CCapabilities {
'appium:automationName'?: string;
'appium:platformName'?: string;
'appium:platformVersion'?: string;
'appium:deviceName'?: string;
'appium:app'?: string;
'appium:appPackage'?: string;
'appium:appWaitActivity'?: string;
'appium:newCommandTimeout'?: number;
'appium:language'?: string;
'appium:locale'?: string;
Expand Down

0 comments on commit f131373

Please sign in to comment.