@testim/testim-cli 3.274.0 → 3.278.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,7 +14,7 @@ const getNpmVersion = localRunnerCache.memoize(() => npmWrapper.getLatestPackage
14
14
 
15
15
  function getPackageVersion() {
16
16
  try {
17
- logger.info('Get package version');
17
+ logger.debug('Get package version');
18
18
  const path = `${__dirname}/package.json`;
19
19
  if (!fs.existsSync(path)) {
20
20
  // This usually means that the program runs from a dev environment (in which __dirname
@@ -76,8 +76,13 @@ class WorkerAppium extends BaseWorker {
76
76
  _executionId, _testId, _testResultId,
77
77
  _options: { project: projectId },
78
78
  } = testRunHandler;
79
+ const { projectData: { type: projectType }, company: { companyId }, gridId } = this.options;
80
+
81
+ const selectedDeviceArr = await testimServicesApi.getMobileDevicesFromGrid({ projectType, companyId, gridId, selectors: `device_id:${activeSession.capabilities.udid}` });
82
+ const deviceName = selectedDeviceArr[0]?.name;
83
+
79
84
  const device = {
80
- name: activeSession.capabilities.deviceName,
85
+ name: deviceName,
81
86
  model: activeSession.capabilities.deviceModel,
82
87
  osVersion: activeSession.capabilities.platformVersion,
83
88
  udid: activeSession.capabilities.udid,
@@ -1,61 +0,0 @@
1
- module.exports = function(blobs) {
2
- function blobToFile(theBlob, fileName) {
3
- try {
4
- // Doesn't work on IE11/Edge https://developer.mozilla.org/en-US/docs/Web/API/File/File
5
- return new File([theBlob], fileName, {type: theBlob.type});
6
- } catch (err) {
7
- var date = new Date();
8
- theBlob.lastModifiedDate = date;
9
- theBlob.lastModified = date.getTime();
10
- theBlob.name = fileName;
11
- return theBlob;
12
- }
13
- }
14
-
15
- function createDropEvent(files) {
16
- // add item function - FileList spec
17
- files.item = function (index) {
18
- return this[index];
19
- };
20
- function getItems() {
21
- var items = [];
22
- files.forEach(function (file) {
23
- items.push({
24
- kind: "file",
25
- type: file.type,
26
- getAsFile: function () {
27
- return file;
28
- }
29
- });
30
- });
31
- return items;
32
- }
33
- var dataTransferObject = {
34
- enumerable: true,
35
- configurable: true,
36
- get: function () {
37
- return {
38
- files: files,
39
- types: ["Files"],
40
- items: getItems()
41
- };
42
- },
43
- };
44
- var event = document.createEvent("HTMLEvents");
45
- event.initEvent("drop", true, true);
46
- Object.defineProperties(event, {
47
- originalEvent: {
48
- enumerable: true,
49
- configurable: true,
50
- get: function () {
51
- return event;
52
- }
53
- },
54
- dataTransfer: dataTransferObject
55
- });
56
- return event;
57
- }
58
-
59
- var files = blobs.map(function(blob) { return blobToFile(blob.blob, blob.name); });
60
- return createDropEvent(files);
61
- };