@@ -63,84 +63,77 @@ const CONFIG_JSON: Partial<IConfigOptions> = {
63
63
} ,
64
64
} ;
65
65
66
- export type TestOptions = {
67
- cryptoBackend : "legacy" | "rust" ;
68
- } ;
69
-
70
66
interface CredentialsWithDisplayName extends Credentials {
71
67
displayName : string ;
72
68
}
73
69
74
- export const test = base . extend <
75
- TestOptions & {
76
- axe : AxeBuilder ;
77
- checkA11y : ( ) => Promise < void > ;
78
-
79
- /**
80
- * The contents of the config.json to send when the client requests it.
81
- */
82
- config : typeof CONFIG_JSON ;
83
-
84
- /**
85
- * The options with which to run the {@link #homeserver} fixture.
86
- */
87
- startHomeserverOpts : StartHomeserverOpts | string ;
88
-
89
- homeserver : HomeserverInstance ;
90
- oAuthServer : { port : number } ;
91
-
92
- /**
93
- * The displayname to use for the user registered in {@link #credentials}.
94
- *
95
- * To set it, call `test.use({ displayName: "myDisplayName" })` in the test file or `describe` block.
96
- * See {@link https://playwright.dev/docs/api/class-test#test-use}.
97
- */
98
- displayName ?: string ;
99
-
100
- /**
101
- * A test fixture which registers a test user on the {@link #homeserver} and supplies the details
102
- * of the registered user.
103
- */
104
- credentials : CredentialsWithDisplayName ;
105
-
106
- /**
107
- * The same as {@link https://playwright.dev/docs/api/class-fixtures#fixtures-page|`page`},
108
- * but adds an initScript which will populate localStorage with the user's details from
109
- * {@link #credentials} and {@link #homeserver}.
110
- *
111
- * Similar to {@link #user}, but doesn't load the app.
112
- */
113
- pageWithCredentials : Page ;
114
-
115
- /**
116
- * A (rather poorly-named) test fixture which registers a user per {@link #credentials}, stores
117
- * the credentials into localStorage per {@link #homeserver}, and then loads the front page of the
118
- * app.
119
- */
120
- user : CredentialsWithDisplayName ;
121
-
122
- /**
123
- * The same as {@link https://playwright.dev/docs/api/class-fixtures#fixtures-page|`page`},
124
- * but wraps the returned `Page` in a class of utilities for interacting with the Element-Web UI,
125
- * {@link ElementAppPage}.
126
- */
127
- app : ElementAppPage ;
128
-
129
- mailhog : { api : mailhog . API ; instance : Instance } ;
130
- crypto : Crypto ;
131
- room ?: { roomId : string } ;
132
- toasts : Toasts ;
133
- uut ?: Locator ; // Unit Under Test, useful place to refer a prepared locator
134
- botCreateOpts : CreateBotOpts ;
135
- bot : Bot ;
136
- slidingSyncProxy : ProxyInstance ;
137
- labsFlags : string [ ] ;
138
- webserver : Webserver ;
139
- }
140
- > ( {
141
- cryptoBackend : [ "legacy" , { option : true } ] ,
70
+ export const test = base . extend < {
71
+ axe : AxeBuilder ;
72
+ checkA11y : ( ) => Promise < void > ;
73
+
74
+ /**
75
+ * The contents of the config.json to send when the client requests it.
76
+ */
77
+ config : typeof CONFIG_JSON ;
78
+
79
+ /**
80
+ * The options with which to run the {@link #homeserver} fixture.
81
+ */
82
+ startHomeserverOpts : StartHomeserverOpts | string ;
83
+
84
+ homeserver : HomeserverInstance ;
85
+ oAuthServer : { port : number } ;
86
+
87
+ /**
88
+ * The displayname to use for the user registered in {@link #credentials}.
89
+ *
90
+ * To set it, call `test.use({ displayName: "myDisplayName" })` in the test file or `describe` block.
91
+ * See {@link https://playwright.dev/docs/api/class-test#test-use}.
92
+ */
93
+ displayName ?: string ;
94
+
95
+ /**
96
+ * A test fixture which registers a test user on the {@link #homeserver} and supplies the details
97
+ * of the registered user.
98
+ */
99
+ credentials : CredentialsWithDisplayName ;
100
+
101
+ /**
102
+ * The same as {@link https://playwright.dev/docs/api/class-fixtures#fixtures-page|`page`},
103
+ * but adds an initScript which will populate localStorage with the user's details from
104
+ * {@link #credentials} and {@link #homeserver}.
105
+ *
106
+ * Similar to {@link #user}, but doesn't load the app.
107
+ */
108
+ pageWithCredentials : Page ;
109
+
110
+ /**
111
+ * A (rather poorly-named) test fixture which registers a user per {@link #credentials}, stores
112
+ * the credentials into localStorage per {@link #homeserver}, and then loads the front page of the
113
+ * app.
114
+ */
115
+ user : CredentialsWithDisplayName ;
116
+
117
+ /**
118
+ * The same as {@link https://playwright.dev/docs/api/class-fixtures#fixtures-page|`page`},
119
+ * but wraps the returned `Page` in a class of utilities for interacting with the Element-Web UI,
120
+ * {@link ElementAppPage}.
121
+ */
122
+ app : ElementAppPage ;
123
+
124
+ mailhog : { api : mailhog . API ; instance : Instance } ;
125
+ crypto : Crypto ;
126
+ room ?: { roomId : string } ;
127
+ toasts : Toasts ;
128
+ uut ?: Locator ; // Unit Under Test, useful place to refer a prepared locator
129
+ botCreateOpts : CreateBotOpts ;
130
+ bot : Bot ;
131
+ slidingSyncProxy : ProxyInstance ;
132
+ labsFlags : string [ ] ;
133
+ webserver : Webserver ;
134
+ } > ( {
142
135
config : CONFIG_JSON ,
143
- page : async ( { context, page, config, cryptoBackend , labsFlags } , use ) => {
136
+ page : async ( { context, page, config, labsFlags } , use ) => {
144
137
await context . route ( `http://localhost:8080/config.json*` , async ( route ) => {
145
138
const json = { ...CONFIG_JSON , ...config } ;
146
139
json [ "features" ] = {
@@ -151,10 +144,6 @@ export const test = base.extend<
151
144
return obj ;
152
145
} , { } ) ,
153
146
} ;
154
- // the default is to use rust now, so set to `false` if on legacy backend
155
- if ( cryptoBackend === "legacy" ) {
156
- json . features . feature_rust_crypto = false ;
157
- }
158
147
await route . fulfill ( { json } ) ;
159
148
} ) ;
160
149
await use ( page ) ;
0 commit comments