This repository has been archived by the owner on Aug 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
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
73f82b7
commit cb02492
Showing
6 changed files
with
199 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,31 @@ | ||
import assert from 'assert' | ||
import { Vector3 } from 'three' | ||
import { EtherealEngineBot } from 'ee-bot/src/bot/bot-class' | ||
import { BotHooks } from 'ee-bot/src/enums/BotHooks' | ||
|
||
const vector3 = new Vector3() | ||
|
||
//const domain = process.env.APP_HOST | ||
const domain = 'localhost:3000' | ||
const locationName = 'apartment' | ||
const sqrt2 = Math.sqrt(2) | ||
|
||
describe('My Bot Tests', () => { | ||
const bot = new EtherealEngineBot({ name: 'bot', headless:false, verbose: true }) | ||
before(async () => { | ||
await bot.launchBrowser() | ||
await bot.enterLocation(`https://${domain}/location/${locationName}`) | ||
await bot.awaitHookPromise(BotHooks.LocationLoaded) | ||
await bot.clickAllButtons() | ||
}) | ||
|
||
after(async () => { | ||
await bot.quit() | ||
}) | ||
|
||
it('Can spawn in the world', async () => { | ||
const pos = await bot.awaitHookPromise(BotHooks.GetPlayerPosition) | ||
// assert(vector3.copy(pos).length() < sqrt2 * 2) // sqrt2 * 2 is the default size of our spawn area | ||
}) | ||
}) | ||
|
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,39 @@ | ||
import assert from 'assert' | ||
import { Vector3 } from 'three' | ||
import { EtherealEngineBot } from 'ee-bot/src/bot/bot-class' | ||
import { BotHooks } from 'ee-bot/src/enums/BotHooks' | ||
|
||
//const vector3 = new Vector3() | ||
|
||
//const domain = process.env.APP_HOST | ||
const domain = 'localhost:3000' | ||
const locationName = 'apartment' | ||
const sqrt2 = Math.sqrt(2) | ||
|
||
describe('My Bot Tests', () => { | ||
const bot = new EtherealEngineBot({ name: 'bot', headless:false, verbose: true }) | ||
before(async () => { | ||
await bot.launchBrowser() | ||
await bot.enterLocation(`https://${domain}/location/${locationName}`) | ||
await bot.awaitHookPromise(BotHooks.LocationLoaded) | ||
await bot.moveBot('forward', 2000) | ||
await bot.moveBot('backward',2000) | ||
await bot.moveBot('left',2000) | ||
await bot.moveBot('right',2000) | ||
await bot.moveBot('jump',2000) | ||
await bot.moveBot('up',2000) | ||
await bot.moveBot('down',2000) | ||
await bot.moveBot('arrowleft',1000) | ||
await bot.moveBot('arrowright',1000) | ||
}) | ||
|
||
after(async () => { | ||
await bot.quit() | ||
}) | ||
|
||
it('Can spawn in the world', async () => { | ||
const pos = await bot.awaitHookPromise(BotHooks.GetPlayerPosition) | ||
//assert(vector3.copy(pos).length() < sqrt2 * 2) // sqrt2 * 2 is the default size of our spawn area | ||
}) | ||
}) | ||
|
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,31 @@ | ||
import assert from 'assert' | ||
import { Vector3 } from 'three' | ||
import { EtherealEngineBot } from 'ee-bot/src/bot/bot-class' | ||
import { BotHooks } from 'ee-bot/src/enums/BotHooks' | ||
|
||
//const vector3 = new Vector3() | ||
|
||
//const domain = process.env.APP_HOST | ||
const domain = 'localhost:3000' | ||
const locationName = 'apartment' | ||
const sqrt2 = Math.sqrt(2) | ||
|
||
describe('My Bot Tests', () => { | ||
const bot = new EtherealEngineBot({ name: 'bot', headless:false, verbose: true }) | ||
before(async () => { | ||
await bot.launchBrowser() | ||
await bot.enterLocation(`https://${domain}/location/${locationName}`) | ||
await bot.awaitHookPromise(BotHooks.LocationLoaded) | ||
await bot.clickEmoteButtonAndSelectEmote() | ||
}) | ||
|
||
after(async () => { | ||
await bot.quit() | ||
}) | ||
|
||
it('Can spawn in the world', async () => { | ||
const pos = await bot.awaitHookPromise(BotHooks.GetPlayerPosition) | ||
//assert(vector3.copy(pos).length() < sqrt2 * 2) // sqrt2 * 2 is the default size of our spawn area | ||
}) | ||
}) | ||
|
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,31 @@ | ||
import assert from 'assert' | ||
import { Vector3 } from 'three' | ||
import { EtherealEngineBot } from 'ee-bot/src/bot/bot-class' | ||
import { BotHooks } from 'ee-bot/src/enums/BotHooks' | ||
|
||
//const vector3 = new Vector3() | ||
|
||
//const domain = process.env.APP_HOST | ||
const domain = 'localhost:3000' | ||
const locationName = 'apartment' | ||
const sqrt2 = Math.sqrt(2) | ||
|
||
describe('My Bot Tests', () => { | ||
const bot = new EtherealEngineBot({ name: 'bot', headless:false, verbose: true }) | ||
before(async () => { | ||
await bot.launchBrowser() | ||
await bot.enterLocation(`https://${domain}/location/${locationName}`) | ||
await bot.awaitHookPromise(BotHooks.LocationLoaded) | ||
await bot.moveBot('forward',2000) | ||
}) | ||
|
||
after(async () => { | ||
await bot.quit() | ||
}) | ||
|
||
it('Can spawn in the world', async () => { | ||
const pos = await bot.awaitHookPromise(BotHooks.GetPlayerPosition) | ||
//assert(vector3.copy(pos).length() < sqrt2 * 2) // sqrt2 * 2 is the default size of our spawn area | ||
}) | ||
}) | ||
|
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,34 @@ | ||
import assert from 'assert' | ||
import { Vector3 } from 'three' | ||
import { EtherealEngineBot } from 'ee-bot/src/bot/bot-class' | ||
import { BotHooks } from 'ee-bot/src/enums/BotHooks' | ||
import { makeAdmin } from 'ee-bot/src/bot/utils/make-user-admin' | ||
|
||
const vector3 = new Vector3() | ||
|
||
//const domain = process.env.APP_HOST | ||
const domain = 'localhost:3000' | ||
const locationName = 'default' | ||
const sqrt2 = Math.sqrt(2) | ||
|
||
describe('My Bot Tests', () => { | ||
const bot = new EtherealEngineBot({ name: 'bot', headless:false, verbose: true }) | ||
before(async () => { | ||
await bot.launchBrowser() | ||
//await bot.enterLocation(`https://${domain}`) | ||
//await bot.awaitHookPromise(BotHooks.LocationLoaded) | ||
await bot.enterEditor(`https://${domain}/studio/default-project/apartment`,`https://${domain}` ) | ||
await bot.physics_triggers() | ||
await bot.enterLocation(`https://${domain}/location/${locationName}`) | ||
await bot.awaitHookPromise(BotHooks.LocationLoaded) | ||
await bot.moveBot('forward',2000) | ||
}) | ||
|
||
after(async () => { | ||
await bot.quit() | ||
}) | ||
|
||
it('Can spawn in the world', async () => { | ||
}) | ||
}) | ||
|
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,33 @@ | ||
import assert from 'assert' | ||
import { Vector3 } from 'three' | ||
import { EtherealEngineBot } from 'ee-bot/src/bot/bot-class' | ||
import { BotHooks } from 'ee-bot/src/enums/BotHooks' | ||
|
||
const vector3 = new Vector3() | ||
|
||
//const domain = process.env.APP_HOST | ||
const domain = 'localhost:3000' | ||
const locationName = 'apartment' | ||
const sqrt2 = Math.sqrt(2) | ||
|
||
describe('My Bot Tests', () => { | ||
const bot = new EtherealEngineBot({ name: 'bot', headless:false, verbose: true }) | ||
before(async () => { | ||
await bot.launchBrowser() | ||
await bot.enterLocation(`https://${domain}/location/${locationName}`) | ||
await bot.awaitHookPromise(BotHooks.LocationLoaded) | ||
await bot.moveBot('forward',3000) | ||
await bot.moveBot('left',2000) | ||
await bot.moveBot('backward',4000) | ||
}) | ||
|
||
after(async () => { | ||
await bot.quit() | ||
}) | ||
|
||
it('Can spawn in the world', async () => { | ||
const pos = await bot.awaitHookPromise(BotHooks.GetPlayerPosition) | ||
// assert(vector3.copy(pos).length() < sqrt2 * 2) // sqrt2 * 2 is the default size of our spawn area | ||
}) | ||
}) | ||
|