Skip to content

Commit

Permalink
ci: skip auth tests (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
garrappachc authored Nov 12, 2024
1 parent 986b0bf commit 86f8031
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
env:
WEBSITE_URL: 'http://localhost:3000'
MONGODB_URI: 'mongodb://localhost:27017/tf2pickup'
STEAM_API_KEY: ${{ secrets.STEAM_API_KEY }}
STEAM_API_KEY: ${{ secrets.STEAM_API_KEY || 'FAKE_STEAM_API_KEY' }}
QUEUE_CONFIG: '6v6'
THUMBNAIL_SERVICE_URL: 'https://mapthumbnails.tf2pickup.org'
LOG_RELAY_ADDRESS: '127.0.0.1'
Expand Down
17 changes: 10 additions & 7 deletions tests/00-misc/02-login.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { expect, test } from '@playwright/test'
import { test } from '@playwright/test'

test.skip(
() => !(process.env['STEAM_USERNAME'] && process.env['STEAM_PASSWORD']),
'STEAM_USERNAME and STEAM_PASSWORD are required to run this test',
)

test('login', async ({ page }) => {
const username = process.env['STEAM_USERNAME']
const password = process.env['STEAM_PASSWORD']
expect(username).toBeTruthy()
expect(password).toBeTruthy()
const username = process.env['STEAM_USERNAME']!
const password = process.env['STEAM_PASSWORD']!

await page.goto('/')
await page.getByRole('link', { name: 'Sign in through Steam' }).click()
Expand All @@ -17,9 +20,9 @@ test('login', async ({ page }) => {
.locator('form')
.filter({ hasText: 'Sign in with account' })
.locator('input[type="text"]')
.fill(username!)
.fill(username)
await page.locator('input[type="password"]').click()
await page.locator('input[type="password"]').fill(password!)
await page.locator('input[type="password"]').fill(password)
await page.getByRole('button', { name: 'Sign in' }).click()
await page.getByRole('button', { name: 'Sign In' }).click()
})

0 comments on commit 86f8031

Please sign in to comment.