-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(test-functional): rewrite test
- Loading branch information
1 parent
9d81bcd
commit 2328132
Showing
3 changed files
with
236 additions
and
188 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(); | ||
} | ||
}); | ||
}); |
Oops, something went wrong.