Skip to content

Commit

Permalink
Merge branch 'microsoft:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt authored Jul 18, 2023
2 parents 6497994 + b24ec33 commit cd210d5
Show file tree
Hide file tree
Showing 1,714 changed files with 115,730 additions and 80,577 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ module.exports = {
"valid-typeof": 2,
"no-implicit-globals": [2],
"no-unused-expressions": [2, { "allowShortCircuit": true, "allowTernary": true, "allowTaggedTemplates": true}],
"no-proto": 2,

// es2015 features
"require-yield": 2,
Expand Down
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# text files must be lf for golden file tests to work
* text=auto eol=lf

# make project show as TS on GitHub
*.js linguist-detectable=false
97 changes: 60 additions & 37 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,66 @@ assignees: ''

---

**Context:**
- Playwright Version: [what Playwright version do you use?]
- Operating System: [e.g. Windows, Linux or Mac]
- Node.js version: [e.g. 12.22, 14.6]
- Browser: [e.g. All, Chromium, Firefox, WebKit]
- Extra: [any specific details about your environment]

<!-- CLI to auto-capture this info -->
<!-- npx envinfo --preset playwright --markdown -->

**Code Snippet**

Help us help you! Put down a short code snippet that illustrates your bug and
that we can run and debug locally. For example:

```javascript
const {chromium, webkit, firefox} = require('playwright');

(async () => {
const browser = await chromium.launch();
const context = await browser.newContext();
const page = await context.newPage();

// Please include a snippet of HTML that shows an example of the content
// you are testing.
await page.setContent(`
<div>
</div>
`);
// Alternatively, if you are testing a public application, include the URL:
// await page.goto('https://example.com/')

await page.locator(…);
})();
<!-- ⚠️⚠️ Do not delete this template ⚠️⚠️ -->

<!-- 🔎 Search existing issues to avoid creating duplicates. -->
<!-- 🧪 Test using the latest Playwright release to see if your issue has already been fixed -->
<!-- 💡 Provide enough information for us to be able to reproduce your issue locally -->

### System info
- Playwright Version: [v1.XX]
- Operating System: [All, Windows 11, Ubuntu 20, macOS 13.2, etc.]
- Browser: [All, Chromium, Firefox, WebKit]
- Other info:

### Source code

- [ ] I provided exact source code that allows reproducing the issue locally.

<!-- For simple cases, please provide a self-contained test file along with the config file -->
<!-- For larger cases, you can provide a GitHub repo you created for this issue -->
<!-- If we can not reproduce the problem locally, we won't be able to act on it -->
<!-- You can still file without the exact code and we will try to help, but if we can't repro, it will be closed -->

**Link to the GitHub repository with the repro**

[https://github.com/your_profile/playwright_issue_title]

or

**Config file**

```js
// playwright.config.ts
import { defineConfig, devices } from '@playwright/test';

export default defineConfig({
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'], },
},
});
```

**Test file (self-contained)**

```js
it('should check the box using setChecked', async ({ page }) => {
await page.setContent(`<input id='checkbox' type='checkbox'></input>`);
await page.getByRole('checkbox').check();
await expect(page.getByRole('checkbox')).toBeChecked();
});
```

**Describe the bug**
**Steps**
- [Run the test]
- [...]

**Expected**

[Describe expected behavior]

**Actual**

Add any other details about the problem here.
[Describe actual behavior]
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
contact_links:
- name: Join our GitHub Discussions community
url: https://github.com/microsoft/playwright/discussions
about: Ask questions and discuss with other community members
- name: Join our Discord Server
url: https://aka.ms/playwright/discord
about: Ask questions and discuss with other community members
10 changes: 0 additions & 10 deletions .github/ISSUE_TEMPLATE/question.md

This file was deleted.

26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/vscode-extension.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: VSCode extension bug
about: Something doesn't work like it should inside the Visual Studio Code extension or you have a feature request? Tell us!
title: "[BUG]"
labels: ''
assignees: ''

---

**Context:**
- Playwright Version: [what Playwright version do you use?]
- Operating System: [e.g. Windows, Linux or Mac]
- Node.js version: [e.g. 12.22, 14.6]
- Visual Studio Code version: [e.g. 1.65]
- Playwright for VSCode extension version: [e.g. 1.2.3]
- Browser: [e.g. All, Chromium, Firefox, WebKit]
- Extra: [any specific details about your environment]

**Code Snippet**

Help us help you! Put down a short code snippet that illustrates your bug and
that we can run and debug locally. For example:

**Describe the bug**

Add any other details about the problem here.
40 changes: 40 additions & 0 deletions .github/actions/download-artifact/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: 'Download blob report'
description: 'Download blob report from GitHub artifacts'
inputs:
name:
description: 'Name of the artifact to download'
required: true
type: string
default: 'blob-report'
path:
description: 'Directory with downloaded artifacts'
required: true
type: string
default: 'blob-report'
runs:
using: "composite"
steps:
- name: Download blob report
uses: actions/github-script@v6
with:
script: |
console.log(`downloading artifacts for workflow_run: ${context.payload.workflow_run.id}`);
console.log(`workflow_run: ${JSON.stringify(context.payload.workflow_run, null, 2)}`);
const { data } = await github.rest.actions.listWorkflowRunArtifacts({
...context.repo,
run_id: context.payload.workflow_run.id
});
console.log('total = ', data.total_count);
const name = '${{ inputs.name }}';
const report = data.artifacts.filter(a => a.name === name)[0];
const result = await github.rest.actions.downloadArtifact({
...context.repo,
artifact_id: report.id,
archive_format: 'zip'
});
console.log('download result', result);
const fs = require('fs');
fs.writeFileSync(`${name}.zip`, Buffer.from(result.data));
- name: Unzip blob report
shell: bash
run: unzip ${{ inputs.name }}.zip -d ${{ inputs.path }}
29 changes: 29 additions & 0 deletions .github/actions/download-blob-report-from-azure/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: 'Download blob report from Azure'
description: 'Download blob report from Azure blob storage'
inputs:
blob_prefix:
description: 'Name of the Azure blob storage directory containing blob report'
required: true
type: string
output_dir:
description: 'Output directory where downloaded blobs will be stored'
required: true
type: string
default: 'blob-report'
connection_string:
description: 'Azure connection string'
required: true
type: string
runs:
using: "composite"
steps:
- name: Download Blob Reports from Azure Blob Storage
shell: bash
run: |
OUTPUT_DIR='${{ inputs.output_dir }}'
mkdir -p $OUTPUT_DIR
LIST=$(az storage blob list -c '$web' --prefix ${{ inputs.blob_prefix }} --connection-string "${{ inputs.connection_string }}")
for name in $(echo $LIST | jq --raw-output '.[].name | select(test("report-.*\\.zip$"))');
do
az storage blob download -c '$web' --name $name -f $OUTPUT_DIR/$(basename $name) --connection-string "${{ inputs.connection_string }}"
done
38 changes: 38 additions & 0 deletions .github/actions/upload-blob-report/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: 'Upload blob report'
description: 'Upload blob to Azure blob storage or to GitHub artifacts (for pull requests)'
inputs:
report_dir:
description: 'Directory containing blob report'
required: true
type: string
default: 'test-results/blob-report'
connection_string:
description: 'Azure connection string'
required: true
type: string
runs:
using: "composite"
steps:
- name: Upload blob report to Azure
if: always() && github.event_name == 'push'
shell: bash
run: |
REPORT_DIR='run-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.sha }}'
az storage blob upload-batch -s "${{ inputs.report_dir }}" -d "\$web/$REPORT_DIR" --connection-string "${{ inputs.connection_string }}"
- name: Upload blob report to GitHub
if: always() && github.event_name == 'pull_request'
uses: actions/upload-artifact@v3
with:
name: blob-report-${{ github.run_attempt }}
path: ${{ inputs.report_dir }}
retention-days: 30
- name: Write triggering pull request number in a file
if: always() && github.event_name == 'pull_request'
shell: bash
run: echo '${{ github.event.number }}' > pull_request_number.txt;
- name: Upload artifact with the pull request number
if: always() && github.event_name == 'pull_request'
uses: actions/upload-artifact@v3
with:
name: pull-request
path: pull_request_number.txt
14 changes: 7 additions & 7 deletions .github/workflows/cherry_pick_into_release_branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
echo "Version is not a two digit semver version"
exit 1
fi
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
ref: release-${{ github.event.inputs.version }}
fetch-depth: 0
Expand All @@ -42,35 +42,35 @@ jobs:
console.log(process.argv[1]);
process.exit(0);
}
console.log(`chery-pick${match[2]}: ${match[1]}`);
console.log(`cherry-pick${match[2]}: ${match[1]}`);
' "$COMMIT_MESSAGE")
git commit -m "$COMMIT_MESSAGE"
done
LAST_COMMIT_MESSAGE=$(git show -s --format=%B)
echo "::set-output name=PR_TITLE::$LAST_COMMIT_MESSAGE"
echo "PR_TITLE=$LAST_COMMIT_MESSAGE" >> $GITHUB_OUTPUT
- name: Prepare branch
id: prepare-branch
run: |
BRANCH_NAME="cherry-pick-${{ github.event.inputs.version }}-$(date +%Y-%m-%d-%H-%M-%S)"
echo "::set-output name=BRANCH_NAME::$BRANCH_NAME"
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_OUTPUT
git checkout -b "$BRANCH_NAME"
git push origin $BRANCH_NAME
- name: Create Pull Request
uses: actions/github-script@v4
uses: actions/github-script@v6
with:
github-token: ${{ secrets.REPOSITORY_DISPATCH_PERSONAL_ACCESS_TOKEN }}
script: |
const readableCommitHashesList = '${{ github.event.inputs.commit_hashes }}'.split(',').map(hash => `- ${hash}`).join('\n');
const response = await github.pulls.create({
const response = await github.rest.pulls.create({
owner: 'microsoft',
repo: 'playwright',
head: 'microsoft:${{ steps.prepare-branch.outputs.BRANCH_NAME }}',
base: 'release-${{ github.event.inputs.version }}',
title: '${{ steps.cherry-pick.outputs.PR_TITLE }}',
body: `This PR cherry-picks the following commits:\n\n${readableCommitHashesList}`,
});
await github.issues.addLabels({
await github.rest.issues.addLabels({
owner: 'microsoft',
repo: 'playwright',
issue_number: response.data.number,
Expand Down
Loading

0 comments on commit cd210d5

Please sign in to comment.