* Bring back tauri e2e tests Fixes #2061 once green * Fix if * Add bail mocha opt and more cleanup, disable second dir test * Add mocha types and tsconfig * Add 10sec delay for auth (worked in 22.04 local docker) * Add back close settings click * Disable open file * Re-enable settings test * Handle error page * Back to brower.execute location.href * Add --force to tauri-driver install (I think because of cache) --------- Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
		
			
				
	
	
		
			41 lines
		
	
	
		
			984 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			41 lines
		
	
	
		
			984 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
import os from 'os'
 | 
						|
import path from 'path'
 | 
						|
import { spawn, ChildProcess } from 'child_process'
 | 
						|
 | 
						|
let tauriDriver: ChildProcess
 | 
						|
 | 
						|
const application =
 | 
						|
  process.env.E2E_APPLICATION || `./src-tauri/target/release/zoo-modeling-app`
 | 
						|
 | 
						|
export const config = {
 | 
						|
  port: 4444,
 | 
						|
  specs: ['./e2e/tauri/specs/**/*.ts'],
 | 
						|
  maxInstances: 1,
 | 
						|
  capabilities: [
 | 
						|
    {
 | 
						|
      maxInstances: 1,
 | 
						|
      'tauri:options': {
 | 
						|
        application,
 | 
						|
      },
 | 
						|
    },
 | 
						|
  ],
 | 
						|
  reporters: ['spec'],
 | 
						|
  framework: 'mocha',
 | 
						|
  mochaOpts: {
 | 
						|
    bail: true,
 | 
						|
    ui: 'bdd',
 | 
						|
    timeout: 600000,
 | 
						|
  },
 | 
						|
 | 
						|
  // ensure we are running `tauri-driver` before the session starts so that we can proxy the webdriver requests
 | 
						|
  beforeSession: () =>
 | 
						|
    (tauriDriver = spawn(
 | 
						|
      path.resolve(os.homedir(), '.cargo', 'bin', 'tauri-driver'),
 | 
						|
      [],
 | 
						|
      { stdio: [null, process.stdout, process.stderr] }
 | 
						|
    )),
 | 
						|
 | 
						|
  // clean up the `tauri-driver` process we spawned at the start of the session
 | 
						|
  afterSession: () => tauriDriver.kill(),
 | 
						|
}
 |