Skip to content

Commit fae2886

Browse files
committed
More changes
1 parent df74243 commit fae2886

File tree

3 files changed

+26
-14
lines changed

3 files changed

+26
-14
lines changed

.azure/pipelines/blazor-daily-tests.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
variables:
99
SAUCE_CONNECT_DOWNLOAD_ON_INSTALL: true
1010
E2ETESTS_SauceTest: true
11-
E2ETESTS_Sauce__TestName: 'Blazor Daily Tests'
1211
E2ETESTS_Sauce__TunnelIdentifier: 'blazor-e2e-sc-proxy-tunnel'
1312
E2ETESTS_Sauce__HostName: 'sauce.local'
1413
jobs:
@@ -17,9 +16,10 @@ jobs:
1716
buildDirectory: src/Components
1817
isTestingJob: true
1918
agentOs: Windows
20-
jobName: BlazorDailyTests_Android_Chrome
19+
jobName: BlazorDailyTests
2120
jobDisplayName: "Blazor Daily Tests"
2221
afterBuild:
22+
2323
# macOS/Safari
2424
- script: 'dotnet test --filter "StandaloneAppTest"'
2525
workingDirectory: 'src/Components/test/E2ETest'
@@ -30,9 +30,12 @@ jobs:
3030
E2ETESTS_Sauce__Username: '$(asplab-sauce-labs-username)'
3131
E2ETESTS_Sauce__AccessKey: '$(asplab-sauce-labs-access-key)'
3232
# Set platform/browser configuration.
33-
E2ETESTS_Sauce__PlatformName: 'macOS 10.14'
34-
E2ETESTS_Sauce__BrowserName: 'safari'
35-
E2ETESTS_Sauce__BrowserVersion: 'latest'
33+
E2ETESTS_Sauce__TestName: 'Blazor Daily Tests - macOS/Safari'
34+
E2ETESTS_Sauce__PlatformName: 'macOS 10.15'
35+
E2ETESTS_Sauce__BrowserName: 'Safari'
36+
# Need to explicitly set version here because some older versions don't support timeouts in Safari.
37+
E2ETESTS_Sauce__SeleniumVersion: '3.4.0'
38+
3639
# Android/Chrome
3740
- script: 'dotnet test --filter "StandaloneAppTest"'
3841
workingDirectory: 'src/Components/test/E2ETest'
@@ -43,6 +46,7 @@ jobs:
4346
E2ETESTS_Sauce__Username: '$(asplab-sauce-labs-username)'
4447
E2ETESTS_Sauce__AccessKey: '$(asplab-sauce-labs-access-key)'
4548
# Set platform/browser configuration.
49+
E2ETESTS_Sauce__TestName: 'Blazor Daily Tests - Android/Chrome'
4650
E2ETESTS_Sauce__PlatformName: 'Android'
4751
E2ETESTS_Sauce__PlatformVersion: '10.0'
4852
E2ETESTS_Sauce__BrowserName: 'Chrome'

src/Shared/E2ETesting/BrowserFixture.cs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -183,17 +183,16 @@ public async Task DisposeAsync()
183183
capabilities.SetCapability("accessKey", sauce.AccessKey);
184184
capabilities.SetCapability("tunnelIdentifier", sauce.TunnelIdentifier);
185185
capabilities.SetCapability("name", name);
186-
capabilities.SetCapability("browserName", sauce.BrowserName);
186+
capabilities.SetCapability("platformName", sauce.PlatformName);
187187

188-
if (!string.IsNullOrEmpty(sauce.PlatformVersion))
188+
if (!string.IsNullOrEmpty(sauce.BrowserName))
189189
{
190-
capabilities.SetCapability("platformName", sauce.PlatformName);
191-
capabilities.SetCapability("platformVersion", sauce.PlatformVersion);
190+
capabilities.SetCapability("browserName", sauce.BrowserName);
192191
}
193-
else
192+
193+
if (!string.IsNullOrEmpty(sauce.PlatformVersion))
194194
{
195-
// In some cases (like macOS), SauceLabs expects us to set "platform" instead of "platformName".
196-
capabilities.SetCapability("platform", sauce.PlatformName);
195+
capabilities.SetCapability("platformVersion", sauce.PlatformVersion);
197196
}
198197

199198
if (!string.IsNullOrEmpty(sauce.BrowserVersion))
@@ -216,6 +215,11 @@ public async Task DisposeAsync()
216215
capabilities.SetCapability("appiumVersion", sauce.AppiumVersion);
217216
}
218217

218+
if (!string.IsNullOrEmpty(sauce.SeleniumVersion))
219+
{
220+
capabilities.SetCapability("seleniumVersion", sauce.SeleniumVersion);
221+
}
222+
219223
await SauceConnectServer.StartAsync(output);
220224

221225
var attempt = 0;
@@ -244,7 +248,7 @@ public async Task DisposeAsync()
244248

245249
} while (attempt < maxAttempts);
246250

247-
throw new InvalidOperationException("Couldn't create a SauceLabs remote driver client. The server is irresponsive");
251+
throw new InvalidOperationException("Couldn't create a SauceLabs remote driver client.");
248252
}
249253
}
250254
}

src/Shared/E2ETesting/SauceOptions.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ public class SauceOptions
1515

1616
public string TestName { get; set; }
1717

18+
public bool IsRealDevice { get; set; }
19+
1820
public string PlatformName { get; set; }
1921

2022
public string PlatformVersion { get; set; }
@@ -28,5 +30,7 @@ public class SauceOptions
2830
public string DeviceOrientation { get; set; }
2931

3032
public string AppiumVersion { get; set; }
33+
34+
public string SeleniumVersion { get; set; }
3135
}
32-
}
36+
}

0 commit comments

Comments
 (0)