Skip to content

Commit 28ad600

Browse files
authored
Fix "Error: No request context set" in credentials fixture (#145)
Make sure that we've run the `context` fixture first, so that the request API is configured
1 parent 9f980bc commit 28ad600

File tree

1 file changed

+5
-1
lines changed
  • packages/element-web-playwright-common/src/fixtures

1 file changed

+5
-1
lines changed

packages/element-web-playwright-common/src/fixtures/user.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ export const test = base.extend<{
7070
user: Credentials;
7171
}>({
7272
displayName: undefined,
73-
credentials: async ({ homeserver, displayName: testDisplayName }, use, testInfo) => {
73+
74+
// We don't directly depend upon the `context` fixture, but we do need to make sure that it has been run
75+
// before this fixture, since it is responsible for configuring the APIRequestContext on the homeserver, so
76+
// without it we cannot register the user.
77+
credentials: async ({ context, homeserver, displayName: testDisplayName }, use, testInfo) => {
7478
const names = ["Alice", "Bob", "Charlie", "Daniel", "Eve", "Frank", "Grace", "Hannah", "Isaac", "Judy"];
7579
const password = uniqueId("password_");
7680
const displayName = testDisplayName ?? sample(names)!;

0 commit comments

Comments
 (0)