|
48 | 48 | AZURE_LOCATION: ${{ vars.AZURE_LOCATION }} |
49 | 49 | AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} |
50 | 50 |
|
| 51 | + - name: Get Store IPs |
| 52 | + id: kubectl_get_service |
| 53 | + run: | |
| 54 | + eval $(azd env get-values) |
| 55 | + #az aks get-credentials --resource-group $AZURE_RESOURCE_GROUP --name $AZURE_AKS_CLUSTER_NAME |
| 56 | + storeAdminIp=$(kubectl get service store-admin -n $AZURE_AKS_NAMESPACE -o jsonpath='{.status.loadBalancer.ingress[0].ip}') |
| 57 | + while [ -z "$storeAdminIp" ]; do |
| 58 | + sleep 60 |
| 59 | + storeAdminIp=$(kubectl get service store-admin -n $AZURE_AKS_NAMESPACE -o jsonpath='{.status.loadBalancer.ingress[0].ip}') |
| 60 | + done |
| 61 | + echo "STORE_ADMIN_IP=${storeAdminIp}" |
| 62 | + echo "STORE_ADMIN_IP=${storeAdminIp}" >> "$GITHUB_OUTPUT" |
| 63 | + storeFrontIp=$(kubectl get service store-front -n $AZURE_AKS_NAMESPACE -o jsonpath='{.status.loadBalancer.ingress[0].ip}') |
| 64 | + while [ -z "$storeFrontIp" ]; do |
| 65 | + sleep 60 |
| 66 | + storeFrontIp=$(kubectl get service store-front -n $AZURE_AKS_NAMESPACE -o jsonpath='{.status.loadBalancer.ingress[0].ip}') |
| 67 | + done |
| 68 | + echo "STORE_FRONT_IP=${storeFrontIp}" |
| 69 | + echo "STORE_FRONT_IP=${storeFrontIp}" >> "$GITHUB_OUTPUT" |
| 70 | +
|
| 71 | + - name: Install Playwright dependencies |
| 72 | + run: npm ci |
| 73 | + working-directory: tests |
| 74 | + |
| 75 | + - name: Install Playwright Browsers |
| 76 | + run: npx playwright install --with-deps |
| 77 | + working-directory: tests |
| 78 | + |
| 79 | + - name: Run Playwright tests |
| 80 | + run: npx playwright test |
| 81 | + working-directory: tests |
| 82 | + env: |
| 83 | + STORE_ADMIN_URL: ${{ steps.kubectl_get_service.outputs.STORE_ADMIN_IP }} |
| 84 | + STORE_FRONT_URL: ${{ steps.kubectl_get_service.outputs.STORE_FRONT_IP }} |
| 85 | + |
| 86 | + - uses: actions/upload-artifact@v3 |
| 87 | + if: always() |
| 88 | + with: |
| 89 | + name: playwright-report-store-admin |
| 90 | + path: tests/playwright-report |
| 91 | + retention-days: 30 |
| 92 | + |
51 | 93 | - name: Destroy environment |
52 | 94 | run: azd down --force --purge |
53 | 95 | if: always() |
|
0 commit comments