Skip to content

Commit c92f4e5

Browse files
committed
update yml
1 parent 745d69e commit c92f4e5

File tree

4 files changed

+32
-11
lines changed

4 files changed

+32
-11
lines changed

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77
# The only Daily Tests we have run in Sauce Labs and only need to run on one machine (because they just trigger SauceLabs)
88
# Hence we use the 'default-build.yml' template because it represents a single phase
99
variables:
10+
SAUCE_CONNECT_DOWNLOAD_ON_INSTALL: true
1011
E2ETESTS_SauceTest: true
11-
E2ETESTS_Sauce__Username: '$(asplab-sauce-labs-username)'
12-
E2ETESTS_Sauce__AccessKey: '$(asplab-sauce-labs-access-key)'
1312
E2ETESTS_Sauce__TunnelIdentifier: 'blazor-e2e-sc-proxy-tunnel'
1413
E2ETESTS_Sauce__HostName: 'sauce.local'
1514
jobs:
@@ -19,8 +18,17 @@ jobs:
1918
buildArgs: -test
2019
isTestingJob: true
2120
agentOs: Windows
22-
jobName: BlazorDailyTests
23-
jobDisplayName: "Blazor Daily Tests"
21+
jobName: BlazorDailyTests_macOS_Chrome
22+
jobDisplayName: "Blazor Daily Tests (macOS/Chrome)"
23+
variables:
24+
E2ETESTS_Sauce__TestName: 'Blazor Daily Tests - macOS/Chrome'
25+
E2ETESTS_Sauce__Platform: 'macOS 10.13'
26+
E2ETESTS_Sauce__BrowserName: 'Chrome'
27+
E2ETESTS_Sauce__Browserversion: 'latest'
28+
env:
29+
# Secrets need to be explicitly mapped to env variables.
30+
E2ETESTS_Sauce__Username: $(asplab-sauce-labs-username)
31+
E2ETESTS_Sauce__AccessKey: $(asplab-sauce-labs-access-key)
2432
artifacts:
2533
- name: Windows_Logs
2634
path: ../../artifacts/log/

src/Shared/E2ETesting/BrowserFixture.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,12 @@ public async Task DisposeAsync()
157157

158158
private async Task<(IWebDriver browser, ILogs log)> CreateSauceBrowserAsync(string context, ITestOutputHelper output)
159159
{
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;
161166
if (!string.IsNullOrEmpty(context))
162167
{
163168
name = $"{name} - {context}";
@@ -169,9 +174,9 @@ public async Task DisposeAsync()
169174
capabilities.SetCapability("tunnelIdentifier", E2ETestOptions.Instance.Sauce.TunnelIdentifier);
170175
capabilities.SetCapability("name", name);
171176

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);
175180

176181
await SauceConnectServer.StartAsync(output);
177182

@@ -201,7 +206,7 @@ public async Task DisposeAsync()
201206

202207
} while (attempt < maxAttempts);
203208

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");
205210
}
206211
}
207212
}

src/Shared/E2ETesting/E2ETestOptions.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ public class SauceOptions
7070
public string TunnelIdentifier { get; set; }
7171

7272
public string HostName { get; set; }
73+
74+
public string TestName { get; set; }
75+
76+
public string Platform { get; set; }
77+
78+
public string BrowserName { get; set; }
79+
80+
public string BrowserVersion { get; set; }
7381
}
7482
}
7583
}

src/Shared/E2ETesting/SauceConnectServer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ public class SauceConnectServer : IDisposable
2828
private Process _sentinelProcess;
2929
private static IMessageSink _diagnosticsMessageSink;
3030

31-
// 1h 30 min
32-
private static int SauceConnectProcessTimeout = 3600;
31+
// 2h
32+
private static int SauceConnectProcessTimeout = 7200;
3333

3434
public SauceConnectServer(IMessageSink diagnosticsMessageSink)
3535
{

0 commit comments

Comments
 (0)