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 { 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 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 { 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 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 { 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 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 { 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 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 { 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 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
<img data-test-id="random-game-image" src="https://api.lorem.space/image/game?w=250" alt="random-game-poster"/> |
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 { test, expect } from '@playwright/test'; | |
test('example test', async ({ page }) => { | |
await page.goto('http://localhost:3000'); | |
await expect(page).toHaveScreenshot({ maxDiffPixelRatio: 0.02 }); | |
}); |
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 { test, expect } from '@playwright/test'; | |
test('example test', async ({ page }) => { | |
await page.goto('http://localhost:3000'); | |
await expect(page).toHaveScreenshot(); | |
}); |
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'; | |
test('Navigate to notifications', async ({ page }) => { | |
await page.goto('https://www.meetup.com/notifications'); | |
await expect(page.locator(`"Nothing here yet"`).first()).toBeVisible(); | |
}); | |
test('Navigate to payment methods', async ({ page }) => { | |
await page.goto('https://www.meetup.com/account/payment-methods'); | |
await expect(page.locator(`"You don't have any saved cards."`).first()).toBeVisible(); |
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 config: PlaywrightTestConfig = { | |
globalSetup: './global-setup', | |
use: { | |
storageState: 'storage-state/storageState.json', | |
}, | |
}; |
NewerOlder