gpt-driver-node 1.0.0-alpha.8 → 1.0.0-alpha.9
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.
- package/dist/index.cjs +9 -8
- package/dist/index.mjs +9 -8
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var axios = require('axios');
|
|
4
|
-
var seleniumWebdriver = require('selenium-webdriver');
|
|
5
4
|
var sharp = require('sharp');
|
|
6
5
|
|
|
7
6
|
const delay = async (milliseconds) => {
|
|
@@ -83,18 +82,20 @@ class GptDriver {
|
|
|
83
82
|
let platformVersion;
|
|
84
83
|
let deviceName;
|
|
85
84
|
let sessionId;
|
|
86
|
-
if (this.driver
|
|
87
|
-
const
|
|
85
|
+
if (this.driver.sessionId == null) {
|
|
86
|
+
const driver = this.driver;
|
|
87
|
+
const capabilities = await driver.getCapabilities();
|
|
88
88
|
platform = capabilities.get("platformName");
|
|
89
89
|
platformVersion = capabilities.get("platformVersion") ?? this.appiumSessionConfig?.platformVersion;
|
|
90
90
|
deviceName = this.appiumSessionConfig?.deviceName ?? capabilities.get("deviceName");
|
|
91
|
-
const session = await
|
|
91
|
+
const session = await driver.getSession();
|
|
92
92
|
sessionId = session.getId();
|
|
93
93
|
} else {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
94
|
+
const driver = this.driver;
|
|
95
|
+
platform = driver.capabilities["appium:platformName"];
|
|
96
|
+
platformVersion = driver.capabilities["appium:platformVersion"];
|
|
97
|
+
deviceName = this.appiumSessionConfig?.deviceName ?? driver.capabilities["appium:deviceName"] ?? "";
|
|
98
|
+
sessionId = driver.sessionId;
|
|
98
99
|
}
|
|
99
100
|
this.appiumSessionConfig = {
|
|
100
101
|
...this.appiumSessionConfig,
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
|
-
import { WebDriver } from 'selenium-webdriver';
|
|
3
2
|
import sharp from 'sharp';
|
|
4
3
|
|
|
5
4
|
const delay = async (milliseconds) => {
|
|
@@ -81,18 +80,20 @@ class GptDriver {
|
|
|
81
80
|
let platformVersion;
|
|
82
81
|
let deviceName;
|
|
83
82
|
let sessionId;
|
|
84
|
-
if (this.driver
|
|
85
|
-
const
|
|
83
|
+
if (this.driver.sessionId == null) {
|
|
84
|
+
const driver = this.driver;
|
|
85
|
+
const capabilities = await driver.getCapabilities();
|
|
86
86
|
platform = capabilities.get("platformName");
|
|
87
87
|
platformVersion = capabilities.get("platformVersion") ?? this.appiumSessionConfig?.platformVersion;
|
|
88
88
|
deviceName = this.appiumSessionConfig?.deviceName ?? capabilities.get("deviceName");
|
|
89
|
-
const session = await
|
|
89
|
+
const session = await driver.getSession();
|
|
90
90
|
sessionId = session.getId();
|
|
91
91
|
} else {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
const driver = this.driver;
|
|
93
|
+
platform = driver.capabilities["appium:platformName"];
|
|
94
|
+
platformVersion = driver.capabilities["appium:platformVersion"];
|
|
95
|
+
deviceName = this.appiumSessionConfig?.deviceName ?? driver.capabilities["appium:deviceName"] ?? "";
|
|
96
|
+
sessionId = driver.sessionId;
|
|
96
97
|
}
|
|
97
98
|
this.appiumSessionConfig = {
|
|
98
99
|
...this.appiumSessionConfig,
|