forked from freeCodeCamp/freeCodeCamp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: convert intro page rwd to Playwright (freeCodeCamp#54666)
- Loading branch information
Showing
2 changed files
with
47 additions
and
41 deletions.
There are no files selected for viewing
41 changes: 0 additions & 41 deletions
41
cypress/e2e/default/learn/responsive-web-design/intro-page.ts
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
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(); | ||
}); | ||
}); |