This repository has been archived by the owner on Jan 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
75 lines (61 loc) · 1.94 KB
/
Makefile
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Parameters
GOCMD=go
GOGET=$(GOCMD) get
GOINSTALL=$(GOCMD) install
GOMOD=$(GOCMD) mod
GOENV=$(GOCMD) env
DOCKERCMD=docker
DOCKERBUILD=$(DOCKERCMD) build
DOCKERRUN=$(DOCKERCMD) run
DOCKERCONTAINER=$(DOCKERCMD) container
DOCKERRM=$(DOCKERCMD) rm
DOCKERRMI=$(DOCKERCMD) rmi
DOCKERPULL=$(DOCKERCMD) pull
# kill selenium port
kill-port:
@kill -9 $$(lsof -t -i:4444)
@echo "Port 4444 is killed"
docker-rm: container-rm images-rm
# remove all docker container
container-rm:
@$(DOCKERRM) -vf $$(docker ps -aq)
@echo "Docker container successfully removed"
# remove all docker images
images-rm:
@$(DOCKERRMI) -f $$(docker images -aq)
@echo "Docker images successfully removed"
# run selenium server
selenium: update-selenium run-selenium-hub run-selenium-node
update-selenium:
$(DOCKERPULL) selenium/hub
$(DOCKERPULL) selenium/node-chrome
$(DOCKERPULL) selenium/node-firefox
run-selenium-hub:
$(DOCKERRUN) -d -p 4444:4444 --name selenium-hub selenium/hub
@echo "Run selenium-hub successfully"
run-selenium-node:
$(DOCKERRUN) -d --link selenium-hub:hub selenium/node-chrome
$(DOCKERRUN) -d --link selenium-hub:hub selenium/node-firefox
@echo "Run selenium-hub node browser successfully"
# download dependencies
deps:
$(GOINSTALL) github.com/cucumber/godog/cmd/[email protected]
$(GOGET) -d github.com/onsi/ginkgo/v2/ginkgo
$(GOINSTALL) github.com/onsi/ginkgo/v2/ginkgo
$(GOGET) -d github.com/qiniu/checkstyle/gocheckstyle
$(GOINSTALL) github.com/qiniu/checkstyle/gocheckstyle
$(GOMOD) download
$(GOMOD) tidy
@echo "Get package successfully"
# copy paste rename .sample
cp: env properties
env:
cp env.sample .env
properties:
cp capabilities-android.properties.sample capabilities-android.properties
cp capabilities-ios.properties.sample capabilities-ios.properties
cp capabilities-web.properties.sample capabilities-web.properties
api-godog:
godog --tags=@api --random --format=cucumber > test/report/cucumber_report.json
api-ginkgo:
ginkgo -p --randomize-all