Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
chore: extract batch download action (#23410)
Yury Semikhatsky90aa378e8fd7
diff --git a/.github/actions/download-blob-report-from-azure/action.yml b/.github/actions/download-blob-report-from-azure/action.ymlnew file mode 100644index 0000000000..8986053183--- /dev/null+++ b/.github/actions/download-blob-report-from-azure/action.yml@@ -0,0 +1,23 @@+name: 'Download blob report from Azure'+description: 'Download blob report from Azure blob storage'+inputs:+ run_dir:+ description: 'Name of the Azure blob storage directory containing blob report'+ required: true+ type: string+ connection_string:+ description: 'Azure connection string'+ required: true+ type: string+runs:+ using: "composite"+ steps:+ - name: Download blob report from Azure+ shell: bash+ run: |+ mkdir -p ${{ inputs.run_dir }}+ LIST=$(az storage blob list -c '$web' --prefix ${{ inputs.run_dir }} --connection-string "${{ inputs.connection_string }}")+ for name in $(echo $LIST | jq --raw-output '.[].name | select(test(".jsonl$"))');+ do+ az storage blob download -c '$web' --name $name -f $name --connection-string "${{ inputs.connection_string }}"+ done\ No newline at end of filediff --git a/.github/workflows/tests_primary.yml b/.github/workflows/tests_primary.ymlindex 56b4eafb71..d84f9af2f3 100644--- a/.github/workflows/tests_primary.yml+++ b/.github/workflows/tests_primary.yml@@ -82,19 +82,15 @@ jobs:DEBUG: pw:installPLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1- run: npm run build- - name: Download Blob Reports from Azure Blob Storage- run: |- run_dir='run-${{ github.run_id }}-${{ github.sha }}-test_linux'- mkdir -p $run_dir- LIST=$(az storage blob list -c '$web' --prefix $run_dir --connection-string "${{ secrets.AZURE_CONNECTION_STRING_FOR_BLOB_REPORT }}")- for name in $(echo $LIST | jq --raw-output '.[].name | select(test(".jsonl$"))');- do- az storage blob download -c '$web' --name $name -f $name --connection-string "${{ secrets.AZURE_CONNECTION_STRING_FOR_BLOB_REPORT }}"- done+ - name: Download blob report from Azure+ uses: ./.github/actions/download-blob-report-from-azure+ with:+ run_dir: 'run-${{ github.run_id }}-${{ github.sha }}-test_linux'+ connection_string: '${{ secrets.AZURE_CONNECTION_STRING }}'- name: Merge into HTML Reportrun: |npx playwright merge-reports --reporter html --attachments missing 'run-${{ github.run_id }}-${{ github.sha }}-test_linux'- - name: Upload HTML Report to Azure Blob Storage+ - name: Upload HTML Report to Azurerun: |az storage blob upload-batch -s playwright-report -d '$web/run-${{ github.run_id }}-${{ github.sha }}-test_linux' --connection-string "${{ secrets.AZURE_CONNECTION_STRING_FOR_BLOB_REPORT }}"echo "Report url: https://mspwblobreport.z1.web.core.windows.net/run-${{ github.run_id }}-${{ github.sha }}-test_linux/index.html"@@ -227,19 +223,15 @@ jobs:DEBUG: pw:installPLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1- run: npm run build- - name: Download Blob Reports from Azure Blob Storage- run: |- run_dir='run-${{ github.run_id }}-${{ github.sha }}-test_test_runner'- mkdir -p $run_dir- LIST=$(az storage blob list -c '$web' --prefix $run_dir --connection-string "${{ secrets.AZURE_CONNECTION_STRING_FOR_BLOB_REPORT }}")- for name in $(echo $LIST | jq --raw-output '.[].name | select(test(".jsonl$"))');- do- az storage blob download -c '$web' --name $name -f $name --connection-string "${{ secrets.AZURE_CONNECTION_STRING_FOR_BLOB_REPORT }}"- done+ - name: Download blob report from Azure+ uses: ./.github/actions/download-blob-report-from-azure+ with:+ run_dir: 'run-${{ github.run_id }}-${{ github.sha }}-test_test_runner'+ connection_string: '${{ secrets.AZURE_CONNECTION_STRING }}'- name: Merge into HTML Reportrun: |npx playwright merge-reports --reporter html --attachments missing 'run-${{ github.run_id }}-${{ github.sha }}-test_test_runner'- - name: Upload HTML Report to Azure Blob Storage+ - name: Upload HTML report to Azurerun: |az storage blob upload-batch -s playwright-report -d '$web/run-${{ github.run_id }}-${{ github.sha }}-test_test_runner' --connection-string "${{ secrets.AZURE_CONNECTION_STRING_FOR_BLOB_REPORT }}"echo "Report url: https://mspwblobreport.z1.web.core.windows.net/run-${{ github.run_id }}-${{ github.sha }}-test_test_runner/index.html"diff --git a/.github/workflows/tests_secondary.yml b/.github/workflows/tests_secondary.ymlindex cfe54c9532..634bbbfd0e 100644--- a/.github/workflows/tests_secondary.yml+++ b/.github/workflows/tests_secondary.yml@@ -229,19 +229,15 @@ jobs:DEBUG: pw:installPLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1- run: npm run build- - name: Download Blob Reports from Azure Blob Storage- run: |- run_dir='run-${{ github.run_id }}-${{ github.sha }}-tracing_linux'- mkdir -p $run_dir- LIST=$(az storage blob list -c '$web' --prefix $run_dir --connection-string "${{ secrets.AZURE_CONNECTION_STRING_FOR_BLOB_REPORT }}")- for name in $(echo $LIST | jq --raw-output '.[].name | select(test(".jsonl$"))');- do- az storage blob download -c '$web' --name $name -f $name --connection-string "${{ secrets.AZURE_CONNECTION_STRING_FOR_BLOB_REPORT }}"- done+ - name: Download blob report from Azure+ uses: ./.github/actions/download-blob-report-from-azure+ with:+ run_dir: 'run-${{ github.run_id }}-${{ github.sha }}-tracing_linux'+ connection_string: '${{ secrets.AZURE_CONNECTION_STRING }}'- name: Merge into HTML Reportrun: |npx playwright merge-reports --reporter html --attachments missing 'run-${{ github.run_id }}-${{ github.sha }}-tracing_linux'- - name: Upload HTML Report to Azure Blob Storage+ - name: Upload HTML report to Azurerun: |az storage blob upload-batch -s playwright-report -d '$web/run-${{ github.run_id }}-${{ github.sha }}-tracing_linux' --connection-string "${{ secrets.AZURE_CONNECTION_STRING_FOR_BLOB_REPORT }}"echo "Report url: https://mspwblobreport.z1.web.core.windows.net/run-${{ github.run_id }}-${{ github.sha }}-tracing_linux/index.html"