Skip to content

Commit ef5129b

Browse files
committed
update yml
1 parent 745d69e commit ef5129b

File tree

3 files changed

+26
-7
lines changed

3 files changed

+26
-7
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
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
1112
E2ETESTS_Sauce__Username: '$(asplab-sauce-labs-username)'
1213
E2ETESTS_Sauce__AccessKey: '$(asplab-sauce-labs-access-key)'
@@ -19,8 +20,13 @@ jobs:
1920
buildArgs: -test
2021
isTestingJob: true
2122
agentOs: Windows
22-
jobName: BlazorDailyTests
23-
jobDisplayName: "Blazor Daily Tests"
23+
jobName: BlazorDailyTests_macOS_Chrome
24+
jobDisplayName: "Blazor Daily Tests (macOS/Chrome)"
25+
variables:
26+
E2ETESTS_Sauce__TestName: 'Blazor Daily Tests - macOS/Chrome'
27+
E2ETESTS_Sauce__Platform: 'macOS 10.13'
28+
E2ETESTS_Sauce__BrowserName: 'Chrome'
29+
E2ETESTS_Sauce__Browserversion: 'latest'
2430
artifacts:
2531
- name: Windows_Logs
2632
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
}

0 commit comments

Comments
 (0)