Skip to content

Commit

Permalink
feat: convert intro page rwd to Playwright (freeCodeCamp#54666)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sembauke authored May 6, 2024
1 parent 418ba64 commit 80b09bb
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 41 deletions.
41 changes: 0 additions & 41 deletions cypress/e2e/default/learn/responsive-web-design/intro-page.ts

This file was deleted.

47 changes: 47 additions & 0 deletions e2e/intro-page-rwd.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { test, expect } from '@playwright/test';

test.describe('Certification intro page', () => {
test('Should render and toggle correctly', async ({ page }) => {
const title = page.getByRole('button', {
name: 'Learn HTML by Building a Cat Photo App'
});

await page.goto('/learn/2022/responsive-web-design');

await expect(page).toHaveTitle(
'Responsive Web Design Certification | freeCodeCamp.org'
);

await expect(
page.getByText(
"this Responsive Web Design Certification, you'll learn the languages that developers use to build webpages"
)
).toBeVisible();

await expect(
page.getByText(
'HTML tags give a webpage its structure. You can use HTML tags to add photos, buttons, and other elements to your webpage.'
)
).toBeVisible();

await expect(
page.getByText(
'CSS tells the browser how to display your webpage. You can use CSS to set the color, font, size, and other aspects of HTML elements.'
)
).not.toBeVisible();

await title.click();
await expect(
page.getByText(
'HTML tags give a webpage its structure. You can use HTML tags to add photos, buttons, and other elements to your webpage.'
)
).not.toBeVisible();

await title.click();
await expect(
page.getByText(
'HTML tags give a webpage its structure. You can use HTML tags to add photos, buttons, and other elements to your webpage.'
)
).toBeVisible();
});
});

0 comments on commit 80b09bb

Please sign in to comment.