diff --git a/Makefile b/Makefile index 91b79ef..6f3f314 100644 --- a/Makefile +++ b/Makefile @@ -72,10 +72,10 @@ deploy: ## Deploy the service on local Kubernetes .PHONY: build-docker build-docker: ## Build the docker image and push it to the registry $(info Building the docker image and pushing it to the registry...) - docker build -t shopcarts:1.0 . + docker build -t shopcarts:latest . sudo bash -c "echo '127.0.0.1 cluster-registry' >> /etc/hosts" - docker tag shopcarts:1.0 cluster-registry:32000/shopcarts:1.0 - docker push cluster-registry:32000/shopcarts:1.0 + docker tag shopcarts:latest cluster-registry:32000/shopcarts:latest + docker push cluster-registry:32000/shopcarts:latest .PHONY: setup-cluster setup-cluster: ## Setup the cluster and deploy the service diff --git a/features/shopcarts.feature b/features/shopcarts.feature index ba69b40..01dc169 100644 --- a/features/shopcarts.feature +++ b/features/shopcarts.feature @@ -143,7 +143,7 @@ Feature: The shopcarts service back-end And the "Item Product ID" field should not be empty And the "Item Product Price" field should not be empty And the "Item Quantity" field should not be empty - + # LIST ALL ITEMS IN SHOPCART Scenario: List all items in shopcart When I visit the "Home Page" @@ -152,11 +152,6 @@ Feature: The shopcarts service back-end Then I should see the message "Success" When I copy the "Shopcart ID" field And I paste the "Item Shopcart ID" field - And I press the "Search Item" button - Then the "Item ID" field should not be empty - And the "Item Product Name" field should not be empty - And the "Item Product ID" field should not be empty - And the "Item Product Price" field should not be empty - And the "Item Quantity" field should not be empty - - \ No newline at end of file + When I press the "Search Item" button + Then I should see "1" under the row "Product ID 1" in the table + And I should see "3" under the row "Product ID 3" in the table \ No newline at end of file diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml index 4f0e076..8e502e5 100644 --- a/k8s/deployment.yaml +++ b/k8s/deployment.yaml @@ -23,7 +23,7 @@ spec: containers: - name: shopcarts image: cluster-registry:32000/shopcarts:latest - imagePullPolicy: IfNotPresent + imagePullPolicy: Always ports: - containerPort: 8080 protocol: TCP diff --git a/service/static/js/rest_api.js b/service/static/js/rest_api.js index 8499dcc..fb3b007 100644 --- a/service/static/js/rest_api.js +++ b/service/static/js/rest_api.js @@ -454,7 +454,7 @@ $(function () { let firstItem = ""; for (let i = 0; i < res.length; i++) { let item = res[i]; - table += `