일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- perfect
- STF_PortForwarding
- sshpass
- ssh
- rethinkdb
- STF
- SWIFT
- insert
- port forwarding
- postgres
- Jupyter
- Jupyter Notebook
- nohup
- PYTHON
- 실행권한
- appium
- ubuntu
- create table
- postgresql
- GoCD
- openpyxl
- mysql
- ftp
- nGrinder
- kitura
- 28015
- nmap
- Materials
- centos
- appium server
- Today
- Total
don't stop believing
gauge 개발 환경 만들기 2 (by Docker) 본문
gauge 개발환경 두 번째입니다.
Gauge로 API 자동화 툴을 만들려고 하는데 IDE는 Visual Studio Code로 진행할 예정입니다.
Visual Studio Code는 gauge plugin을 제공합니다.
Visual Studio Code를 설치하려면 아래 url에서 다운받아 설치하면 됩니다.
https://code.visualstudio.com/
Visual Studio Code가 설치되어 있다면 좌측 메뉴에서 확장을 클릭하고 gauge를 검색합니다.
gauge가 검색되면 설치를 해줍니다.
이번에는 docker image를 다시 열어 봅시다.
nglegauge 0.0.1을 가지고 api test용 Container를 만들겠습니다. Container를 만들때 -v 옵션으로 로컬 PC와 Container에 Directory를 연결하겠습니다.
docker image를 다시 확인해 봅시다.
1234567$ docker imagesREPOSITORY TAG IMAGE ID CREATED SIZEnglegauge 0.0.1 521e7493588b 2 days ago 965MBtongchun/nglegauge 0.0.1 521e7493588b 2 days ago 965MBpython latest 29d2f3226daf 4 weeks ago 912MBswift latest e8dc956c3315 5 weeks ago 1.35GBubuntu latest 452a96d81c30 5 weeks ago 79.6MB
tongchun/nglegauge 이미지로 container를 만들어 봅시다.
container를 만들때 directory를 연결해야 하니 로컬 PC에 적당한 폴더를 만들어 줍니다. 제 PC는 Mac 이라 아래와 같이 폴더를 만들었습니다.
/Users/tongchunkim/Documents/Gauge/apitest
로컬 PC에서 만든 apitest 폴더를 Container의 /apitest와 연결해 만들어 줍니다.
1$ docker run -it --name apitest -v /Users/tongchunkim/Documents/Gauge/apitest:/apitest tongchun/nglegauge:0.0.1 /bin/bash
Container에 연결된 후 ls -al 명령으로 root directory를 확인하면 /apitest directory가 생성된 것을 확인할 수 있습니다.
/apitest로 이동해서 gauge를 초기화 해줍니다.
12345# gauge init pythonDownloading python.zip.Copying Gauge template python to current directory ...Successfully initialized the project. Run specifications with "gauge run specs/".
gauge를 초기화하면 gauge 기본 파일들이 생성됩니다.
1234567891011# ls -altotal 16drwxr-xr-x 9 root root 288 Jun 4 03:01 .drwxr-xr-x 1 root root 4096 Jun 4 03:40 ..-rw-r--r-- 1 root root 131 Jun 4 03:01 .gitignoredrwxr-xr-x 3 root root 96 Jun 4 03:01 .vscodedrwxr-xr-x 3 root root 96 Jun 4 03:01 env-rw-r--r-- 1 root root 64 Jun 4 03:01 manifest.json-rw-r--r-- 1 root root 9 Jun 4 03:01 requirements.txtdrwxr-xr-x 3 root root 96 Jun 4 03:01 specsdrwxr-xr-x 4 root root 128 Jun 4 03:01 step_impl
연결된 directory인 로컬 PC의 apitest 폴더에도 동일한 폴더와 파일이 있는지 확인해 봅니다.
tree로 Directory구조를 확인해 보겠습니다.
123456789101112131415# tree.├── env│·· └── default│·· ├── default.properties│·· └── python.properties├── manifest.json├── requirements.txt├── specs│·· └── example.spec└── step_impl├── __init__.py└── step_impl.py4 directories, 7 files
바로 실행해 보겠습니다.
1234567891011# gauge run specsPython: 3.6.5# Specification Heading## Vowel counts in single word ✔ ✔## Vowel counts in multiple word ✔ ✔Successfully generated html-report to => /apitest/reports/html-report/index.htmlSpecifications: 1 executed 1 passed 0 failed 0 skippedScenarios: 2 executed 2 passed 0 failed 0 skippedTotal time taken: 1.257s
실행 잘 되는군요.
/apitest/reports/html-report/index.html로 Report도 잘 떨구네요.
여기까지 Docker를 이용한 gauge 환경구성 이었습니다.
'Testing Automation > Gauge' 카테고리의 다른 글
API 자동화 테스트 예제 작성과 설명 2 (python) (0) | 2018.06.07 |
---|---|
API 자동화 테스트 예제 작성과 설명 1 (python) (0) | 2018.06.07 |
Gauge Windows 환경 구성 (0) | 2018.06.05 |
gauge 개발 환경 만들기 1 (by Docker) (0) | 2018.06.01 |