mirror of
https://github.com/hanzoai/playwright.git
synced 2026-09-24 17:01:53 +00:00
devops: add android bot to tests_secondary (#40799)
This commit is contained in:
@@ -320,3 +320,34 @@ jobs:
|
||||
flakiness-subscription-id: ${{ secrets.AZURE_FLAKINESS_DASHBOARD_SUBSCRIPTION_ID }}
|
||||
env:
|
||||
PWTEST_CHANNEL: chromium
|
||||
|
||||
test_android:
|
||||
name: Android
|
||||
environment: ${{ github.event_name == 'push' && 'allow-uploading-flakiness-results' || null }}
|
||||
runs-on: playwright-x64-ubuntu24-64-core
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '21'
|
||||
- name: Enable KVM group perms
|
||||
run: |
|
||||
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
|
||||
sudo udevadm control --reload-rules
|
||||
sudo udevadm trigger --name-match=kvm
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
- name: Create Android Emulator
|
||||
run: utils/avd_recreate.sh
|
||||
- name: Start Android Emulator
|
||||
run: utils/avd_start.sh
|
||||
- uses: ./.github/actions/run-test
|
||||
with:
|
||||
browsers-to-install: android
|
||||
command: npm run atest
|
||||
bot-name: "android"
|
||||
flakiness-client-id: ${{ secrets.AZURE_FLAKINESS_DASHBOARD_CLIENT_ID }}
|
||||
flakiness-tenant-id: ${{ secrets.AZURE_FLAKINESS_DASHBOARD_TENANT_ID }}
|
||||
flakiness-subscription-id: ${{ secrets.AZURE_FLAKINESS_DASHBOARD_SUBSCRIPTION_ID }}
|
||||
|
||||
@@ -40,6 +40,7 @@ const config: Config<ServerWorkerOptions & PlaywrightWorkerOptions & PlaywrightT
|
||||
reporter: process.env.CI ? [
|
||||
['dot'],
|
||||
['json', { outputFile: path.join(outputDir, 'report.json') }],
|
||||
['blob'],
|
||||
] : 'line',
|
||||
projects: [],
|
||||
};
|
||||
|
||||
@@ -161,13 +161,16 @@ it('should work with unicode chars', async ({ page }) => {
|
||||
expect(result).toBe(42);
|
||||
});
|
||||
|
||||
it('should work with large strings', async ({ page }) => {
|
||||
it('should work with large strings', async ({ page, isAndroid }) => {
|
||||
it.skip(isAndroid, 'string is too long :(');
|
||||
|
||||
const expected = 'x'.repeat(40000);
|
||||
expect(await page.evaluate(data => data, expected)).toBe(expected);
|
||||
});
|
||||
|
||||
it('should work with large unicode strings', async ({ page, browserName, platform }) => {
|
||||
it('should work with large unicode strings', async ({ page, browserName, platform, isAndroid }) => {
|
||||
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/16367' });
|
||||
it.skip(isAndroid, 'string is too long :(');
|
||||
|
||||
const expected = '🎭'.repeat(10000);
|
||||
expect(await page.evaluate(data => data, expected)).toBe(expected);
|
||||
|
||||
@@ -1036,8 +1036,10 @@ for (const method of ['fulfill', 'continue', 'fallback', 'abort'] as const) {
|
||||
});
|
||||
}
|
||||
|
||||
it('should intercept when postData is more than 1MB', async ({ page, server }) => {
|
||||
it('should intercept when postData is more than 1MB', async ({ page, server, isAndroid }) => {
|
||||
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/22753' });
|
||||
it.fixme(isAndroid);
|
||||
|
||||
await page.goto(server.EMPTY_PAGE);
|
||||
let interceptionCallback;
|
||||
const interceptionPromise = new Promise(x => interceptionCallback = x);
|
||||
|
||||
@@ -16,7 +16,7 @@ cd ${ANDROID_HOME}/cmdline-tools
|
||||
COMMAND_LINE_TOOLS_ZIP=${ANDROID_HOME}/commandlinetools.zip
|
||||
# https://developer.android.com/studio
|
||||
curl https://dl.google.com/android/repository/commandlinetools-mac-11076708_latest.zip -o ${COMMAND_LINE_TOOLS_ZIP}
|
||||
unzip ${COMMAND_LINE_TOOLS_ZIP}
|
||||
unzip ${COMMAND_LINE_TOOLS_ZIP}
|
||||
rm ${COMMAND_LINE_TOOLS_ZIP}
|
||||
mv cmdline-tools latest
|
||||
|
||||
|
||||
@@ -6,6 +6,13 @@ if [[ -z "${ANDROID_HOME}" ]]; then
|
||||
export ANDROID_HOME="$PWD/.android-sdk"
|
||||
fi
|
||||
|
||||
# Pin AVD storage to ~/.android so cmdline-tools (avdmanager) and the
|
||||
# emulator binary agree on the location. On Linux runners that set
|
||||
# XDG_CONFIG_HOME (e.g. GitHub Actions), avdmanager otherwise writes to
|
||||
# $XDG_CONFIG_HOME/.android/avd while `emulator` only searches $HOME/.android/avd.
|
||||
export ANDROID_USER_HOME="$HOME/.android"
|
||||
export ANDROID_AVD_HOME="$HOME/.android/avd"
|
||||
|
||||
ANDROID_ARCH="x86_64"
|
||||
|
||||
# on MacOS M1 we need to use arm64 (can't emulate x86_64)
|
||||
|
||||
@@ -6,6 +6,10 @@ if [[ -z "${ANDROID_HOME}" ]]; then
|
||||
export ANDROID_HOME="$PWD/.android-sdk"
|
||||
fi
|
||||
|
||||
# Keep in sync with avd_recreate.sh — both tools must agree on the AVD path.
|
||||
export ANDROID_USER_HOME="$HOME/.android"
|
||||
export ANDROID_AVD_HOME="$HOME/.android/avd"
|
||||
|
||||
bash $PWD/utils/avd_stop.sh
|
||||
|
||||
EMULATOR_EXTRA_ARGS=()
|
||||
|
||||
Reference in New Issue
Block a user