Skip to content

Commit

Permalink
✅ [bento-vimeo] add e2e test (#36664)
Browse files Browse the repository at this point in the history
* [bento-vimeo] add e2e test

* update test description

Co-authored-by: Alan Orozco <alanorozco@users.noreply.github.com>

Co-authored-by: Alan Orozco <alanorozco@users.noreply.github.com>
  • Loading branch information
dethstrobe and alanorozco committed Nov 2, 2021
1 parent e572b5b commit 5ebed63
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
26 changes: 26 additions & 0 deletions extensions/amp-vimeo/1.0/test-e2e/test-bento-vimeo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
describes.endtoend(
'bento-vimeo',
{
version: '1.0',
fixture: 'bento/vimeo.html',
environments: ['single'],
},
(env) => {
let controller;

beforeEach(() => {
controller = env.controller;
});

it('should render a vimeo video', async () => {
const element = await controller.findElement('bento-vimeo');
await controller.switchToShadowRoot(element);

const iframe = await controller.findElement('iframe');

await expect(controller.getElementAttribute(iframe, 'src')).to.equal(
'https://player.vimeo.com/video/23237102'
);
});
}
);
30 changes: 30 additions & 0 deletions test/fixtures/e2e/bento/vimeo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Bento Vimeo</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-vimeo-1.0.js"
></script>
</head>
<body>
<h1>Vimeo</h1>
<p>
<bento-vimeo
data-videoid="23237102"
width="358"
height="204"
layout="responsive"
style="height: 204px; width: 358px"
>
fallback message here
</bento-vimeo>
</p>
</body>
</html>

0 comments on commit 5ebed63

Please sign in to comment.