| 
									
										
										
										
											2018-06-08 09:00:20 -07:00
										 |  |  | import { getUrl } from './utils' | 
					
						
							| 
									
										
										
										
											2018-04-28 14:19:39 -07:00
										 |  |  | import { users } from './users' | 
					
						
							| 
									
										
										
										
											2018-02-19 17:18:40 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-06-08 09:00:20 -07:00
										 |  |  | // quick login using a secret page and a known access token (makes tests run faster)
 | 
					
						
							|  |  |  | async function login (t, user) { | 
					
						
							|  |  |  |   await t.navigateTo(`/settings/quick-login?instanceName=localhost:3000&accessToken=${user.accessToken}`) | 
					
						
							| 
									
										
										
										
											2018-08-29 21:42:57 -07:00
										 |  |  |     .expect(getUrl()).eql('http://localhost:4002/', { timeout: 30000 }) | 
					
						
							| 
									
										
										
										
											2018-02-19 17:18:40 -08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-26 13:51:41 -07:00
										 |  |  | // roles appear not to be working anymore :(
 | 
					
						
							|  |  |  | // export const foobarRole = Role('http://localhost:4002/settings/instances/add', async t => {
 | 
					
						
							|  |  |  | //   await login(t, users.foobar.email, users.foobar.password)
 | 
					
						
							|  |  |  | // })
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // export const lockedAccountRole = Role('http://localhost:4002/settings/instances/add', async t => {
 | 
					
						
							|  |  |  | //   await login(t, users.LockedAccount.email, users.LockedAccount.password)
 | 
					
						
							|  |  |  | // })
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export async function loginAsFoobar (t) { | 
					
						
							| 
									
										
										
										
											2018-06-08 09:00:20 -07:00
										 |  |  |   await login(t, users.foobar) | 
					
						
							| 
									
										
										
										
											2018-05-26 13:51:41 -07:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2018-04-28 14:19:39 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-26 13:51:41 -07:00
										 |  |  | export async function loginAsLockedAccount (t) { | 
					
						
							| 
									
										
										
										
											2018-06-08 09:00:20 -07:00
										 |  |  |   await login(t, users.LockedAccount) | 
					
						
							| 
									
										
										
										
											2018-05-26 13:51:41 -07:00
										 |  |  | } |