File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ const store = require('../store')
88const event = require ( '../event' )
99const recorder = require ( '../recorder' )
1010const { debug } = require ( '../output' )
11- const isAsyncFunction = require ( '../utils' ) . isAsyncFunction
11+ const { isAsyncFunction } = require ( '../utils' )
1212
1313const defaultUser = {
1414 fetch : I => I . grabCookie ( ) ,
@@ -270,6 +270,12 @@ module.exports = function (config) {
270270
271271 const loginFunction = async name => {
272272 const I = container . support ( 'I' )
273+ const userSession = config . users [ name ]
274+
275+ if ( ! userSession ) {
276+ throw new Error ( `User '${ name } ' was not configured for authorization in auth plugin. Add it to the plugin config` )
277+ }
278+
273279 const test = store . currentTest
274280
275281 // we are in BeforeSuite hook
@@ -298,7 +304,6 @@ module.exports = function (config) {
298304
299305 section . start ( )
300306
301- const userSession = config . users [ name ]
302307 const cookies = store [ `${ name } _session` ]
303308 const shouldAwait = isAsyncFunction ( userSession . login ) || isAsyncFunction ( userSession . restore ) || isAsyncFunction ( userSession . check )
304309
You can’t perform that action at this time.
0 commit comments