MCPcopy
hub / github.com/ampproject/amphtml / runTest

Function runTest

test/integration/test-released.js:11–51  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9});
10
11function runTest() {
12 describe('Rendering of released components', function () {
13 this.timeout(5000);
14 let fixture;
15 beforeEach(async () => {
16 this.timeout(3100);
17 fixture = await createFixtureIframe('test/fixtures/released.html', 3000);
18 });
19
20 it('all components should get loaded', function () {
21 this.timeout(15000);
22 return pollForLayout(fixture.win, 12, 10000)
23 .then(() => {
24 expect(
25 fixture.doc.querySelectorAll('.i-amphtml-element')
26 ).to.have.length(16);
27 expect(
28 fixture.doc.querySelectorAll('.i-amphtml-layout')
29 ).to.have.length(12);
30 expect(
31 fixture.doc.querySelectorAll('.i-amphtml-error')
32 ).to.have.length(0);
33 checkGlobalScope(fixture.win);
34 })
35 .then(() => {
36 return expectBodyToBecomeVisible(fixture.win);
37 });
38 });
39
40 it('sanity for Firefox while we skip above', function () {
41 this.timeout(15000);
42 // Test this only in firefox.
43 if (!navigator.userAgent.match(/Firefox/)) {
44 return;
45 }
46 return pollForLayout(fixture.win, 11, 10000).then(() => {
47 return expectBodyToBecomeVisible(fixture.win);
48 });
49 });
50 });
51}
52
53function checkGlobalScope(win) {
54 // Checks that we don't leak certain symbols to the global scope.

Callers

nothing calls this directly

Calls 9

createFixtureIframeFunction · 0.90
pollForLayoutFunction · 0.90
beforeEachFunction · 0.85
expectFunction · 0.85
checkGlobalScopeFunction · 0.85
lengthMethod · 0.80
itFunction · 0.50
thenMethod · 0.45

Tested by

no test coverage detected