partey_workadventure/front/src/Cypress/CypressAsserter.ts

37 lines
761 B
TypeScript
Raw Normal View History

2020-06-10 12:15:25 +02:00
declare let window:WindowWithCypressAsserter;
interface WindowWithCypressAsserter extends Window {
cypressAsserter: CypressAsserter;
}
2020-04-14 20:04:55 +02:00
//this class is used to communicate with cypress, our e2e testing client
//Since cypress cannot manipulate canvas, we notified it with console logs
class CypressAsserter {
2020-06-10 12:15:25 +02:00
2020-04-14 20:04:55 +02:00
constructor() {
window.cypressAsserter = this
}
2020-06-10 12:15:25 +02:00
2020-04-14 20:04:55 +02:00
gameStarted() {
console.log('Started the game')
}
preloadStarted() {
console.log('Preloading')
}
preloadFinished() {
console.log('Preloading done')
}
initStarted() {
console.log('startInit')
}
initFinished() {
console.log('startInit done')
}
}
2020-06-10 12:15:25 +02:00
export const cypressAsserter = new CypressAsserter()