This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { expect, test } from '@playwright/test'; | |
| import fs from 'fs'; | |
| test('mTLS authentication test', async ({ browser }) => { | |
| // Load client certificate from environment variable or file | |
| let certBuffer; | |
| if (process.env.CHECKLY_CERTIFICATE) { | |
| certBuffer = Buffer.from(process.env.CHECKLY_CERTIFICATE, "base64"); | |
| } else { | |
| const certPath = 'client.pem'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { expect, test } = require('@playwright/test') | |
| test('wait for an element to become visible', async ({ page }) => { | |
| await page.goto(process.env.ENVIRONMENT_URL || 'https://www.winzogames.us') | |
| await page.waitForLoadState('networkidle'); | |
| // Use the "toHaveScreenshot" matcher to compare screenshots between check runs | |
| // Don't forget to --update-snapshots on your first run! | |
| await expect(page).toHaveScreenshot({ | |
| maxDiffPixelRatio: 0.2, //Define your thresholds here |
OlderNewer