@@ -157,7 +157,12 @@ public async Task DisposeAsync()
157
157
158
158
private async Task < ( IWebDriver browser , ILogs log ) > CreateSauceBrowserAsync ( string context , ITestOutputHelper output )
159
159
{
160
- var name = "Blazor E2E tests" ;
160
+ if ( E2ETestOptions . Instance . Sauce == null )
161
+ {
162
+ throw new InvalidOperationException ( "SauceLabs environment variables not set." ) ;
163
+ }
164
+
165
+ var name = E2ETestOptions . Instance . Sauce . TestName ;
161
166
if ( ! string . IsNullOrEmpty ( context ) )
162
167
{
163
168
name = $ "{ name } - { context } ";
@@ -169,9 +174,9 @@ public async Task DisposeAsync()
169
174
capabilities . SetCapability ( "tunnelIdentifier" , E2ETestOptions . Instance . Sauce . TunnelIdentifier ) ;
170
175
capabilities . SetCapability ( "name" , name ) ;
171
176
172
- capabilities . SetCapability ( "browserName " , "Chrome" ) ;
173
- capabilities . SetCapability ( "platform " , "macOS 10.13" ) ;
174
- capabilities . SetCapability ( "version" , "latest" ) ;
177
+ capabilities . SetCapability ( "platform " , E2ETestOptions . Instance . Sauce . Platform ) ;
178
+ capabilities . SetCapability ( "browserName " , E2ETestOptions . Instance . Sauce . BrowserName ) ;
179
+ capabilities . SetCapability ( "version" , E2ETestOptions . Instance . Sauce . BrowserVersion ) ;
175
180
176
181
await SauceConnectServer . StartAsync ( output ) ;
177
182
@@ -201,7 +206,7 @@ public async Task DisposeAsync()
201
206
202
207
} while ( attempt < maxAttempts ) ;
203
208
204
- throw new InvalidOperationException ( "Couldn't create a Selenium remote driver client. The server is irresponsive" ) ;
209
+ throw new InvalidOperationException ( "Couldn't create a SauceLabs remote driver client. The server is irresponsive" ) ;
205
210
}
206
211
}
207
212
}
0 commit comments