Skip to content

Commit a4572df

Browse files
authored
refactor(playwrighttesting): improve error messaging when reporting returns 403 (Azure#47742)
* refactor(playwrighttesting): improve error messaging when reporting returns 403 * chore(): update error message --------- Co-authored-by: Siddharth Singha Roy <[email protected]>
1 parent a89f12c commit a4572df

File tree

1 file changed

+6
-1
lines changed
  • sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src

1 file changed

+6
-1
lines changed

sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Constants.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,12 @@ internal class ReporterConstants
248248
internal static readonly string s_cONFLICT_409_ERROR_MESSAGE = "Test run with id {runId} already exists. Provide a unique run id.";
249249
internal static readonly string s_cONFLICT_409_ERROR_MESSAGE_KEY = "DuplicateRunId";
250250

251-
internal static readonly string s_fORBIDDEN_403_ERROR_MESSAGE = "Reporting is not enabled for your workspace {workspaceId}. Enable the Reporting feature under Feature management settings using the Playwright portal: https://playwright.microsoft.com/workspaces/{workspaceId}/settings/general";
251+
internal static readonly string s_fORBIDDEN_403_ERROR_MESSAGE = @"You do not have the required permissions to upload test results. This could be because
252+
253+
a. Reporting is not enabled for your workspace {workspaceId}. Enable the Reporting feature under Feature management settings using the Playwright portal: https://playwright.microsoft.com/workspaces/{workspaceId}/settings/general
254+
b. You do not have the required roles on the workspace. Only Owner and Contributor roles can upload test results. Contact the service administrator.
255+
c. The workspace you are trying to run the tests on is in a different Azure tenant than what you are signed into. Check the tenant id from Azure portal (https://aka.ms/mpt/find-tenant-id) and login using the command 'az login --tenant <TENANT_ID>.
256+
";
252257
internal static readonly string s_fORBIDDEN_403_ERROR_MESSAGE_KEY = "ReportingNotEnabled";
253258
internal static readonly string s_uNKNOWN_ERROR_MESSAGE = "Unknown error occured.";
254259
}

0 commit comments

Comments
 (0)