File tree 2 files changed +20
-4
lines changed
2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,9 @@ export class SafariDriver extends BaseDriver {
69
69
const [ sessionId , caps ] = await super . createSession ( ...args ) ;
70
70
this . safari = new SafariDriverServer ( this . log ) ;
71
71
try {
72
- await this . safari . start ( formatCapsForServer ( caps ) ) ;
72
+ await this . safari . start ( formatCapsForServer ( caps ) , {
73
+ reqBasePath : this . basePath ,
74
+ } ) ;
73
75
} catch ( e ) {
74
76
await this . deleteSession ( ) ;
75
77
throw e ;
Original file line number Diff line number Diff line change @@ -115,16 +115,25 @@ export class SafariDriverServer {
115
115
return ! ! ( SAFARI_DRIVER_PROCESS . isRunning ) ;
116
116
}
117
117
118
- async start ( caps ) {
118
+ /**
119
+ *
120
+ * @param {import('@appium/types').StringRecord } caps
121
+ * @param {SessionOptions } [opts={}]
122
+ */
123
+ async start ( caps , opts = { } ) {
119
124
await SAFARI_DRIVER_PROCESS . init ( ) ;
120
125
121
- this . proxy = new SafariProxy ( {
126
+ const proxyOptions = {
122
127
server : '127.0.0.1' ,
123
128
port : SAFARI_DRIVER_PROCESS . port ,
124
129
base : '' ,
125
130
log : this . log ,
126
131
keepAlive : true ,
127
- } ) ;
132
+ } ;
133
+ if ( opts . reqBasePath ) {
134
+ proxyOptions . reqBasePath = opts . reqBasePath ;
135
+ }
136
+ this . proxy = new SafariProxy ( proxyOptions ) ;
128
137
this . proxy . didProcessExit = false ;
129
138
SAFARI_DRIVER_PROCESS . proc ?. on ( 'exit' , ( ) => {
130
139
if ( this . proxy ) {
@@ -185,3 +194,8 @@ export class SafariDriverServer {
185
194
}
186
195
187
196
export default SafariDriverServer ;
197
+
198
+ /**
199
+ * @typedef {Object } SessionOptions
200
+ * @property {string } [reqBasePath]
201
+ */
You can’t perform that action at this time.
0 commit comments