LoginSignup
2
0

More than 1 year has passed since last update.

AWS CodebuildでCypressを使って、統合テストのCI環境を構築する

Posted at

概要

ググっても英語の記事しか出なかったので、CypressでIntegration Test(統合テスト)をするCI環境を作る方法を書いておきます。

環境

イメージ

aws/codebuild/standard:5.0-21.04.23

クライアント

React ver 16.8.6
cypress 9.0.0

早速buildspec記載

version: 0.2

phases:
  install:
    commands:
      - apt update
      - apt install -y sudo curl
      - curl -sL https://raw.githubusercontent.com/Unitech/pm2/master/packager/setup.deb.sh | sudo -E bash -
      - node -v
      - npm -v
      - npm install -g pm2 wait-on
      - yarn -v
  pre_build:
    commands:
      - npm install
  build:
    commands:
      - pm2 start npm -- start ## dev server起動
      - wait-on http://localhost:3000
      - npm run cy:run

概要

React環境をpm2を使って、バックグラウンドで動かすってところがググってもなかなかでなかったです。
どうしてもインテグレーションテストの場合は、サーバーを動かさなきゃダメのようだったので。
間違いあればご指摘ください。

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0