This file contains 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
trigger: | |
- main | |
pool: | |
vmImage: ubuntu-latest | |
variables: | |
npm_config_cache: $(Pipeline.Workspace)/.npm | |
steps: | |
- task: Cache@2 |
This file contains 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 { PlaywrightTestConfig } from '@playwright/test'; | |
import { devices } from 'playwright'; | |
import dotenv from 'dotenv'; | |
dotenv.config(); | |
export const storageStatePath = 'storage-state/storageState.json'; | |
const config: PlaywrightTestConfig = { | |
use: { |
This file contains 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 { test as setup } from '@playwright/test'; | |
import { storageStatePath } from './playwright.config'; | |
const username = process.env.MEETUP_USERNAME ?? ''; | |
const password = process.env.MEETUP_PASSWORD ?? ''; | |
setup('Login a user', async ({ page }) => { | |
await page.goto('https://www.meetup.com/login'); | |
await page.getByLabel('Email').fill(username); | |
await page.getByLabel('Password', { exact: true }).fill(password); |
This file contains 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 { test as setup } from '@playwright/test'; | |
import { storageStatePath } from './playwright.config'; | |
const username = process.env.MEETUP_USERNAME ?? ''; | |
const password = process.env.MEETUP_PASSWORD ?? ''; | |
setup('Login a user', async ({ page }) => { | |
await page.goto('https://www.meetup.com/login'); | |
await page.getByLabel('Email').fill(username); | |
await page.getByLabel('Password', { exact: true }).fill(password); |
This file contains 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 { chromium } from '@playwright/test'; | |
import login from './utils/login'; | |
const username = process.env.MEETUP_USERNAME ?? ''; | |
const password = process.env.MEETUP_PASSWORD ?? ''; | |
async function globalSetup(config: FullConfig): Promise<void> { | |
const { storageState } = config.projects[0].use; | |
// TODO: Remove headless after this has been tested | |
const browser = await chromium.launch({ headless: false }); |
This file contains 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 { test, expect } from '@playwright/test'; | |
test('example test', async ({ page }) => { | |
await page.goto('http://localhost:3000'); | |
await page.waitForLoadState('networkidle'); | |
await expect(page).toHaveScreenshot({ | |
maxDiffPixelRatio: 0.02, | |
mask: [page.locator('data-test-id=random-game-image')], | |
}); | |
}); |
This file contains 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 { test, expect } from '@playwright/test'; | |
test('example test', async ({ page }) => { | |
await page.goto('http://localhost:3000'); | |
await expect(page).toHaveScreenshot(); | |
}); |
This file contains 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 { test, expect } from '@playwright/test'; | |
test('example test', async ({ page }) => { | |
await page.goto('http://localhost:3000'); | |
await page.waitForLoadState('networkidle'); | |
await expect(page).toHaveScreenshot({ maxDiffPixelRatio: 0.02 }); | |
}); |
This file contains 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
<img data-test-id="random-game-image" src="https://api.lorem.space/image/game?w=250" alt="random-game-poster"/> |
This file contains 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 { test, expect } from '@playwright/test'; | |
test('example test', async ({ page }) => { | |
await page.goto('http://localhost:3000'); | |
await expect(page).toHaveScreenshot({ maxDiffPixelRatio: 0.02 }); | |
}); |
NewerOlder