0
0
Remixframework~20 mins

End-to-end testing with Playwright in Remix - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Playwright Remix Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
What is the test result of this Playwright snippet?
Consider this Playwright test code for a Remix app login page. What will be the test execution result?
Remix
import { test, expect } from '@playwright/test';

test('login button is visible', async ({ page }) => {
  await page.goto('/login');
  const loginButton = page.locator('button[type="submit"]');
  await expect(loginButton).toBeVisible();
});
ATest passes if the login button is present and visible on the /login page
BTest passes even if the button is hidden
CTest fails due to missing await before page.goto
DTest fails because the locator syntax is incorrect
Attempts:
2 left
💡 Hint
Check the locator syntax and the use of await for asynchronous calls.
locator
intermediate
2:00remaining
Choose the best locator for a navigation link in Remix
You want to select a navigation link with the text 'Dashboard' in a Remix app for your Playwright test. Which locator is best practice?
Apage.locator('a:has-text("Dashboard")')
Bpage.locator('a[href="/dashboard"]')
Cpage.locator('text=Dashboard')
Dpage.locator('a').filter({ hasText: 'Dashboard' })
Attempts:
2 left
💡 Hint
Consider stability and specificity of locators in tests.
assertion
advanced
2:00remaining
Which assertion correctly verifies an error message appears?
You want to check that an error message with text 'Invalid credentials' appears after a failed login in your Remix app test. Which assertion is correct?
Remix
const errorMessage = page.locator('.error-message');
Aawait expect(errorMessage).toHaveValue('Invalid credentials');
Bawait expect(errorMessage).toBeVisible('Invalid credentials');
Cawait expect(errorMessage).toContainText('Invalid credentials');
Dawait expect(errorMessage).toHaveText('Invalid credentials');
Attempts:
2 left
💡 Hint
Check the Playwright assertion methods for text content.
🔧 Debug
advanced
2:00remaining
Why does this Playwright test fail intermittently?
This test sometimes fails with a timeout error. What is the likely cause? Code: await page.goto('/profile'); await page.click('button#load-data'); await expect(page.locator('.data-loaded')).toBeVisible();
AThe test does not wait for the data to load after clicking the button
BThe page.goto URL is wrong causing navigation failure
CThe locator '.data-loaded' is incorrect and does not exist
DThe button selector 'button#load-data' is invalid syntax
Attempts:
2 left
💡 Hint
Think about asynchronous actions after clicking a button.
framework
expert
2:00remaining
How to integrate Playwright tests in a Remix app CI pipeline?
Which approach correctly integrates Playwright end-to-end tests into a Remix app continuous integration (CI) pipeline?
AOnly run Playwright tests locally, not in CI
BRun Playwright tests before building the Remix app in CI
CRun Playwright tests without building the Remix app in CI
DRun 'npm run build' then 'npx playwright test' after Remix app build in CI
Attempts:
2 left
💡 Hint
Consider the app state required for end-to-end tests.