-
Notifications
You must be signed in to change notification settings - Fork 303
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
9b0dacf
commit 2472956
Showing
2 changed files
with
41 additions
and
37 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 |
---|---|---|
@@ -1,35 +1,35 @@ | ||
const assert = require('assert'); | ||
|
||
describe('misc_instancing', function _() { | ||
let result; | ||
before(async () => { | ||
result = await loadExample( | ||
'examples/misc_instancing.html', | ||
this.fullTitle(), | ||
); | ||
}); | ||
let pageLoaded; | ||
const title = this.fullTitle(); | ||
|
||
it('should run', async () => { | ||
assert.ok(result); | ||
it("should load 'misc_instancing' page", async function _it() { | ||
pageLoaded = await loadExample('examples/misc_instancing.html', title); | ||
assert.ok(pageLoaded); | ||
}); | ||
|
||
it('should load the trees and lights objects', async () => { | ||
const objects = await page.evaluate( | ||
() => { | ||
const res = []; | ||
if (view.scene) { | ||
const objects3d = view.scene; | ||
objects3d.traverse((obj) => { | ||
if (obj.isInstancedMesh) { | ||
if (obj.parent && obj.parent.layer) { | ||
res.push(obj.parent.layer.name); | ||
it('should load the trees and lights objects', async function _it() { | ||
if (pageLoaded) { | ||
const objects = await page.evaluate( | ||
() => { | ||
const res = []; | ||
if (view.scene) { | ||
const objects3d = view.scene; | ||
objects3d.traverse((obj) => { | ||
if (obj.isInstancedMesh) { | ||
if (obj.parent && obj.parent.layer) { | ||
res.push(obj.parent.layer.name); | ||
} | ||
} | ||
} | ||
}); | ||
} | ||
return res; | ||
}); | ||
assert.ok(objects.indexOf('lights') >= 0); | ||
assert.ok(objects.indexOf('trees') >= 0); | ||
}); | ||
} | ||
return res; | ||
}); | ||
assert.ok(objects.indexOf('lights') >= 0); | ||
assert.ok(objects.indexOf('trees') >= 0); | ||
} else { | ||
this.skip(); | ||
} | ||
}); | ||
}); |
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,18 +1,22 @@ | ||
const assert = require('assert'); | ||
|
||
describe('source_stream_wfs_3d', function _() { | ||
let result; | ||
before(async () => { | ||
result = await loadExample('examples/source_stream_wfs_3d.html', this.fullTitle()); | ||
}); | ||
let pageLoaded; | ||
const title = this.fullTitle(); | ||
|
||
it('should run', async () => { | ||
assert.ok(result); | ||
it("should load 'source_stream_wfs_3d' page", async function _it() { | ||
pageLoaded = await loadExample('examples/source_stream_wfs_3d.html', title); | ||
assert.ok(pageLoaded); | ||
}); | ||
it('should remove GeometryLayer', async () => { | ||
const countGeometryLayerStart = await page.evaluate(() => view.getLayers(l => l.isGeometryLayer).length); | ||
await page.evaluate(() => view.removeLayer('WFS Bus lines')); | ||
const countGeometryLayerEnd = await page.evaluate(() => view.getLayers(l => l.isGeometryLayer).length); | ||
assert.ok(countGeometryLayerStart - countGeometryLayerEnd === 1); | ||
|
||
it('should remove GeometryLayer', async function _it() { | ||
if (pageLoaded) { | ||
const countGeometryLayerStart = await page.evaluate(() => view.getLayers(l => l.isGeometryLayer).length); | ||
await page.evaluate(() => view.removeLayer('WFS Bus lines')); | ||
const countGeometryLayerEnd = await page.evaluate(() => view.getLayers(l => l.isGeometryLayer).length); | ||
assert.ok(countGeometryLayerStart - countGeometryLayerEnd === 1); | ||
} else { | ||
this.skip(); | ||
} | ||
}); | ||
}); |