Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/AppInsightsAvailabilityFixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const test = baseTest.extend({
page: async ({ page }, use, testInfo) => {
console.log(appInsightsAvailabilityTesterTag, testInfo.title);

var pwat = new PlaywrightAvailabilityTester();
var pwat = new PlaywrightAvailabilityTester(testInfo.title);

let browserContext = page.context();
if (browserContext) {
Expand Down
10 changes: 4 additions & 6 deletions src/PlaywrightAvailabilityTester.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ export class PlaywrightAvailabilityTester {

private options?: PlaywrightAvailabilityTesterOptions;

constructor(options?: PlaywrightAvailabilityTesterOptions) {
constructor(testName: any, options?: PlaywrightAvailabilityTesterOptions) {
this.options = options;
this.testName = testName.toString();

if (options?.logDebugToTelemetryClient) {
options.log = (...args: any[]) =>
Expand Down Expand Up @@ -181,11 +182,8 @@ export class PlaywrightAvailabilityTester {

// Azure Functions uses 'APPSETTING_WEBSITE_SITE_NAME' environment variable to pass the logic app name
// APPSETTING_TESTNAME can be used to override that
let testName = this.testName;
if (!testName || testName == "") {
testName = process.env.APPSETTING_TESTNAME || process.env.APPSETTING_WEBSITE_SITE_NAME || "NO_TESTNAME";
}
bci.testName = testName;

bci.testName = this.testName;

(<any>browserContext)[BrowserContextInsights.browserContextInsightsAttachedPropertyName] = bci;
}
Expand Down