You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if [ "$(az aks show --resource-group ${{ vars.DKM_RG }} --name ${{ vars.DKM_AKS_NAME }} --query "powerState.code" -o tsv)" = "Running" ]; then echo "AKS is running"; else az aks start --resource-group ${{ vars.DKM_RG }} --name ${{ vars.DKM_AKS_NAME }}; fi
"body": "<p>Dear Team,</p><p>We would like to inform you that the ${{ env.accelerator_name }} Test Automation process has completed successfully.</p><p><strong>Run URL:</strong> <a href="${RUN_URL}">${RUN_URL}</a><br></p><p><strong>Test Report:</strong> <a href="${REPORT_URL}">${REPORT_URL}</a></p><p>Best regards,<br>Your Automation Team</p>",
103
+
"subject": "${{ env.accelerator_name }} Test Automation - Success"
104
+
}
105
+
EOF
106
+
)
107
+
else
108
+
EMAIL_BODY=$(cat <<EOF
109
+
{
110
+
"body": "<p>Dear Team,</p><p>We would like to inform you that the ${{ env.accelerator_name }} Test Automation process has encountered an issue and has failed to complete successfully.</p><p><strong>Run URL:</strong> <a href="${RUN_URL}">${RUN_URL}</a><br></p><p><strong>Test Report:</strong> <a href="${REPORT_URL}">${REPORT_URL}</a></p><p>Please investigate the matter at your earliest convenience.</p><p>Best regards,<br>Your Automation Team</p>",
111
+
"subject": "${{ env.accelerator_name }} Test Automation - Failure"
112
+
}
113
+
EOF
114
+
)
115
+
fi
116
+
117
+
# Send the notification
118
+
curl -X POST "${{ secrets.EMAILNOTIFICATION_LOGICAPP_URL_TA }}" \
119
+
-H "Content-Type: application/json" \
120
+
-d "$EMAIL_BODY" || echo "Failed to send notification"
121
+
122
+
- name: Stop AKS
123
+
if: always()
124
+
uses: azure/cli@v2
125
+
with:
126
+
azcliversion: 'latest'
127
+
inlineScript: |
128
+
az aks install-cli
129
+
if [ "$(az aks show --resource-group ${{ vars.DKM_RG }} --name ${{ vars.DKM_AKS_NAME }} --query "powerState.code" -o tsv)" = "Running" ]; then az aks stop --resource-group ${{ vars.DKM_RG }} --name ${{ vars.DKM_AKS_NAME }}; else echo "AKS is already stopped"; fi
# Test Automation for Document Knowledge Mining Accelerator
2
+
3
+
Write end-to-end tests for your web apps with [Playwright](https://github.com/microsoft/playwright-python) and [pytest](https://docs.pytest.org/en/stable/).
4
+
5
+
- Support for **all modern browsers** including Chromium, WebKit and Firefox.
6
+
- Support for **headless and headed** execution.
7
+
-**Built-in fixtures** that provide browser primitives to test functions.
8
+
9
+
Pre-Requisites:
10
+
11
+
- Install Visual Studio Code: Download and Install Visual Studio Code(VSCode).
12
+
- Install NodeJS: Download and Install Node JS
13
+
14
+
Create and Activate Python Virtual Environment
15
+
16
+
- From your directory open and run cmd : "python -m venv microsoft"
17
+
This will create a virtual environment directory named microsoft inside your current directory
18
+
- To enable virtual environment, copy location for "microsoft\Scripts\activate.bat" and run from cmd
19
+
20
+
Installing Playwright Pytest from Virtual Environment
21
+
22
+
- To install libraries run "pip install -r requirements.txt"
23
+
24
+
Run test cases
25
+
26
+
- To run test cases from your 'tests' folder : "pytest --html=report.html --self-contained-html"
27
+
28
+
Create .env file in project root level with web app url and client credentials
29
+
30
+
- create a .env file in project root level and the application url. please refer 'sample_dotenv_file.txt' file.
31
+
32
+
## Documentation
33
+
34
+
See on [playwright.dev](https://playwright.dev/python/docs/test-runners) for examples and more detailed information.
0 commit comments