-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b41eea0
commit 950f81d
Showing
6 changed files
with
108 additions
and
44 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Playwright Tests | ||
on: | ||
push: | ||
branches: [ main, master ] | ||
pull_request: | ||
branches: [ main, master ] | ||
jobs: | ||
test: | ||
timeout-minutes: 60 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: lts/* | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Install Playwright Browsers | ||
run: npx playwright install --with-deps | ||
- name: Run Playwright tests | ||
run: npx playwright test | ||
- uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: playwright-report | ||
path: playwright-report/ | ||
retention-days: 30 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,3 +31,6 @@ coverage | |
|
||
test-results/ | ||
playwright-report/ | ||
blob-report/ | ||
e2e/.cache/ | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { test, expect } from '@playwright/test' | ||
|
||
test('visits the app login page and login', async ({ page }) => { | ||
// Navigate to the target page | ||
await page.goto('/') | ||
|
||
// Check for the presence of "Hi there! 👋" | ||
const hiThereText = page.locator('div.text-h5') | ||
await expect(hiThereText).toHaveText('Hi there! 👋') | ||
|
||
// Check for the presence of the logo | ||
const logo = page.locator('img.logo') | ||
await expect(logo).toBeVisible() | ||
|
||
// Check for the presence of the "HangTime" text | ||
const hangTimeText = page.locator('h2.text-h4') | ||
await expect(hangTimeText).toHaveText('HangTime') | ||
|
||
// Check for the "Hangboard Training App" subtitle | ||
const subtitleText = page.locator('h1.text-subtitle-2') | ||
await expect(subtitleText).toHaveText('Hangboard Training App') | ||
|
||
// Check for the presence of the login buttons | ||
const facebookButton = page.locator('button:has-text("Sign in with Facebook")') | ||
const googleButton = page.locator('button:has-text("Sign in with Google")') | ||
const appleButton = page.locator('button:has-text("Sign in with Apple")') | ||
await expect(facebookButton).toBeVisible() | ||
await expect(googleButton).toBeVisible() | ||
await expect(appleButton).toBeVisible() | ||
|
||
// Check for the presence of the email input field | ||
const emailInput = page.getByLabel('E-mail', { exact: true }) | ||
await expect(emailInput).toBeVisible() | ||
|
||
// Check for the presence of the password input field | ||
const passwordInput = page.getByLabel('Password', { exact: true }) | ||
await expect(passwordInput).toBeVisible() | ||
|
||
// Check for the presence of the login button | ||
const loginButton = page.getByRole('button', { name: 'Login' }) | ||
await expect(loginButton).toBeVisible() | ||
await expect(loginButton).toBeEnabled() | ||
|
||
// Perform login with dummy account | ||
await emailInput.fill('mail@stevie-ray.nl') | ||
await passwordInput.fill('8Ty>g{Q"F!#4') | ||
await loginButton.click() | ||
|
||
// Check if login was successful | ||
const workoutTab = page.getByText('My Workouts') | ||
await expect(workoutTab).toBeVisible() | ||
}) |
This file was deleted.
Oops, something went wrong.
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
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