-
Notifications
You must be signed in to change notification settings - Fork 4
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
00653a0
commit 7ee0589
Showing
12 changed files
with
75 additions
and
10 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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 |
---|---|---|
@@ -1,9 +1,40 @@ | ||
import { test, expect } from "@playwright/test" | ||
import { siteUrl } from "../util" | ||
import { WwwPage, siteUrl } from "../util" | ||
|
||
test("Course page have title in <head>", async ({ page }) => { | ||
test("Home page has title in <head>", async ({ page }) => { | ||
await page.goto(siteUrl("www")) | ||
await expect(page).toHaveTitle( | ||
"MIT OpenCourseWare | Free Online Course Materials" | ||
) | ||
}) | ||
|
||
test("Social links exist and open correct social media pages", async ({ | ||
page | ||
}) => { | ||
const SOCIAL_LINKS = [ | ||
["facebook", /https:\/\/www.facebook.com\/MITOCW\/?/], | ||
["instagram", /https:\/\/www.instagram.com\/mitocw\/?/], | ||
["twitter", /https:\/\/twitter.com\/MITOCW\/?/], | ||
["youtube", /https:\/\/www.youtube.com\/mitocw\/?/], | ||
["linkedin", /https:\/\/www.linkedin.com\/company\/mit-opencourseware\/?/] | ||
] | ||
|
||
const www = new WwwPage(page) | ||
await www.goto() | ||
|
||
for (const [name, url] of SOCIAL_LINKS) { | ||
for (const location of [".social-icon-row", "#footer-container"]) { | ||
const popupPromise = page.waitForEvent("popup") | ||
|
||
const link = page | ||
.locator(location) | ||
.getByRole("link", { name, exact: true }) | ||
await expect(link).toBeVisible() | ||
await link.click() | ||
|
||
const popup = await popupPromise | ||
await popup.waitForURL(url, { timeout: 10000, waitUntil: "commit" }) | ||
await popup.close() | ||
} | ||
} | ||
}) |
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 |
---|---|---|
|
@@ -251,7 +251,7 @@ $searchbox-height: 50px; | |
} | ||
|
||
.social-icon-row { | ||
width: 225px; | ||
width: 270px; | ||
} | ||
|
||
> div { | ||
|
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.