이미 존재하는 계정으로 견적요청, 제안 생성 Flow (존재하는 계정 정보 필요)

보안 및 동일한 테스트 환경 구성을 위해 test/config/test.config.ts 파일에서 관리

.gitignore 파일에 추가해서 github에 안올라가도록 설정

# Test configuration
/test/config/test.config.ts

test.config.ts 파일 생성 후 아래 코드 복붙

interface TestUser {
  email: string;
  password: string;
}

interface TestMover {
  email: string;
}

export interface TestConfig {
  customer: TestUser;
  movers: TestMover[];
  defaultPassword: string;
}

export const TEST_CONFIG = {
  customer: {
    email: '[email protected]',
    password: 'moving123!',
  },
  movers: [
    { email: '[email protected]' },
    { email: '[email protected]' },
    { email: '[email protected]' },
    { email: '[email protected]' },
  ],
  defaultPassword: 'moving123!',
} as const;

테스트 실행 명령 - package.json파일 참고


# 특정 테스트 시나리오만 실행
$ npm run test:e2e:new-user      # 신규 사용자 테스트
$ npm run test:e2e:existing-user # 기존 사용자 테스트
$ npm run test:e2e:estimate-flow # 견적 요청 흐름 테스트 (견적 요청 생성까지만, 기사 견적 제안 X)

$pnpm test:e2e:new-user
$pnpm test:e2e:existing-user
$pnpm test:e2e:estimate-flow

# 자세한 로그와 함께 보고싶으면 명령어 뒤에 :verbose 붙이기
ex) $ npm run test:e2e:new-user:verbose

image.png