forked from ampproject/amphtml
-
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.
(bento-youtube) add e2e test (ampproject#36438)
* (bento-youtube) add e2e test * Update test/fixtures/e2e/bento/bento-youtube.html Co-authored-by: Alan Orozco <[email protected]> * (bento-youtube) rename variables in e2e test Co-authored-by: Alan Orozco <[email protected]>
- Loading branch information
1 parent
44a18b0
commit 584cd3c
Showing
2 changed files
with
56 additions
and
0 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,26 @@ | ||
describes.endtoend( | ||
'bento-youtube', | ||
{ | ||
version: '1.0', | ||
fixture: 'bento/bento-youtube.html', | ||
environments: ['single'], | ||
}, | ||
(env) => { | ||
let controller; | ||
|
||
beforeEach(() => { | ||
controller = env.controller; | ||
}); | ||
|
||
it('should render a youtube video', async () => { | ||
const element = await controller.findElement('bento-youtube'); | ||
await controller.switchToShadowRoot(element); | ||
|
||
const iframe = await controller.findElement('iframe'); | ||
|
||
await expect(controller.getElementAttribute(iframe, 'src')).to.equal( | ||
'https://www.youtube.com/embed/dQw4w9WgXcQ?enablejsapi=1&=1&playsinline=1' | ||
); | ||
}); | ||
} | ||
); |
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,30 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>Bento Youtube</title> | ||
<meta | ||
name="viewport" | ||
content="width=device-width,minimum-scale=1,initial-scale=1" | ||
/> | ||
<script async src="https://cdn.ampproject.org/bento.js"></script> | ||
<script | ||
async | ||
src="https://cdn.ampproject.org/v0/bento-youtube-1.0.js" | ||
></script> | ||
</head> | ||
<body> | ||
<h1>Youtube</h1> | ||
<p> | ||
<bento-youtube | ||
data-videoid="dQw4w9WgXcQ" | ||
width="358" | ||
height="204" | ||
layout="responsive" | ||
style="height: 204px; width: 358px" | ||
> | ||
fallback message here | ||
</bento-youtube> | ||
</p> | ||
</body> | ||
</html> |