

from wlauto.common.resources import FileResource


class ReventFile(FileResource):

    name = 'revent'

    def __init__(self, owner, stage):
        super(ReventFile, self).__init__(owner)
        self.stage = stage


class JarFile(FileResource):

    name = 'jar'


class ApkFile(FileResource):

    name = 'apk'

    def __init__(self, owner, platform=None):
        super(ApkFile, self).__init__(owner)
        self.platform = platform

    def __str__(self):
        return '<{}\'s {} APK>'.format(self.owner, self.platform)



from wlauto.common.resources import FileResource


class ReventFile(FileResource):

    name = 'revent'

    def __init__(self, owner, stage):
        super(ReventFile, self).__init__(owner)
        self.stage = stage


class JarFile(FileResource):

    name = 'jar'


class ApkFile(FileResource):

    name = 'apk'

    def __init__(self, owner, platform=None):
        super(ApkFile, self).__init__(owner)
        self.platform = platform

    def __str__(self):
        return '<{}\'s {} APK>'.format(self.owner, self.platform)


class UiautoApkFile(FileResource):

    name = 'uiautoapk'

    def __init__(self, owner, platform=None):
        super(UiautoApkFile, self).__init__(owner)
        self.platform = platform

    def __str__(self):
        return '<{}\'s {} UiAuto APK>'.format(self.owner, self.platform)

Add a UiautoApk resource type.
AndroidResource: Add a UiautoApk resource type.

When moving to Uiautomation 2, tests are now complied into apk files rather than
jar files. To avoid conflicts with regular workload apks a new resource type is
added to retrieve the test files which will be renamed to have the extension
.uiautoapk

  
  
  from wlauto.common.resources import FileResource
  
  
  class ReventFile(FileResource):
  
      name = 'revent'
  
      def __init__(self, owner, stage):
          super(ReventFile, self).__init__(owner)
          self.stage = stage
  
  
  class JarFile(FileResource):
  
      name = 'jar'
  
  
  class ApkFile(FileResource):
  
      name = 'apk'
  
      def __init__(self, owner, platform=None):
          super(ApkFile, self).__init__(owner)
          self.platform = platform
  
      def __str__(self):
          return '<{}\'s {} APK>'.format(self.owner, self.platform)
  
+ 
+ class UiautoApkFile(FileResource):
+ 
+     name = 'uiautoapk'
+ 
+     def __init__(self, owner, platform=None):
+         super(UiautoApkFile, self).__init__(owner)
+         self.platform = platform
+ 
+     def __str__(self):
+         return '<{}\'s {} UiAuto APK>'.format(self.owner, self.platform)
+ 
Add a UiautoApk resource type.
## Code Before:


from wlauto.common.resources import FileResource


class ReventFile(FileResource):

    name = 'revent'

    def __init__(self, owner, stage):
        super(ReventFile, self).__init__(owner)
        self.stage = stage


class JarFile(FileResource):

    name = 'jar'


class ApkFile(FileResource):

    name = 'apk'

    def __init__(self, owner, platform=None):
        super(ApkFile, self).__init__(owner)
        self.platform = platform

    def __str__(self):
        return '<{}\'s {} APK>'.format(self.owner, self.platform)

## Instruction:
Add a UiautoApk resource type.
## Code After:


from wlauto.common.resources import FileResource


class ReventFile(FileResource):

    name = 'revent'

    def __init__(self, owner, stage):
        super(ReventFile, self).__init__(owner)
        self.stage = stage


class JarFile(FileResource):

    name = 'jar'


class ApkFile(FileResource):

    name = 'apk'

    def __init__(self, owner, platform=None):
        super(ApkFile, self).__init__(owner)
        self.platform = platform

    def __str__(self):
        return '<{}\'s {} APK>'.format(self.owner, self.platform)


class UiautoApkFile(FileResource):

    name = 'uiautoapk'

    def __init__(self, owner, platform=None):
        super(UiautoApkFile, self).__init__(owner)
        self.platform = platform

    def __str__(self):
        return '<{}\'s {} UiAuto APK>'.format(self.owner, self.platform)
