Skip to content

Instantly share code, notes, and snippets.

@343max
Created July 14, 2023 13:02
Show Gist options
  • Save 343max/4b09a9771cfbfea2d961c947ab4e867f to your computer and use it in GitHub Desktop.
Save 343max/4b09a9771cfbfea2d961c947ab4e867f to your computer and use it in GitHub Desktop.
import { SessionConfig } from "@appetize/playwright/dist/core/session"
import { defineConfig } from "@playwright/test"
const androidConfig: SessionConfig = {
publicKey: process.env.APPETIZE_PUBLIC_KEY,
device: "pixel6",
osVersion: "13",
}
const iosConfig: SessionConfig = {
publicKey: process.env.APPETIZE_PUBLIC_KEY,
device: "iphone8",
osVersion: "16.2",
}
export default defineConfig<{ config: SessionConfig }>({
testDir: "./appetize",
outputDir: "./appetize/results",
timeout: 120 * 1000,
expect: {
toMatchSnapshot: {
maxDiffPixelRatio: 0.0,
maxDiffPixels: 0,
},
},
forbidOnly: !!process.env.CI,
retries: 0,
reporter: "line",
// correlates to number of concurrent Appetize sessions at a time
workers: 1,
fullyParallel: false,
use: {
trace: "retain-on-failure",
baseURL: "https://appetize.io",
// Appetize session configuration
config: androidConfig,
},
projects: [
{
name: "android-dark",
use: { config: { ...androidConfig, appearance: "dark" } },
},
{
name: "android-light",
use: { config: { ...androidConfig, appearance: "light" } },
},
{ name: "ios-dark", use: { config: { ...iosConfig, appearance: "dark" } } },
{
name: "ios-light",
use: { config: { ...iosConfig, appearance: "light" } },
},
],
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment