diff --git a/contrib/docker/docker-compose.prod.yaml b/contrib/docker/docker-compose.prod.yaml index e5a7fb79..62be6749 100644 --- a/contrib/docker/docker-compose.prod.yaml +++ b/contrib/docker/docker-compose.prod.yaml @@ -66,6 +66,7 @@ services: API_URL: back:50051 JITSI_URL: $JITSI_URL JITSI_ISS: $JITSI_ISS + FRONT_URL: https://play.${DOMAIN} labels: - "traefik.http.routers.pusher.rule=Host(`pusher.${DOMAIN}`)" - "traefik.http.routers.pusher.entryPoints=web,traefik" diff --git a/deeployer.libsonnet b/deeployer.libsonnet index d3280ed2..0bbda264 100644 --- a/deeployer.libsonnet +++ b/deeployer.libsonnet @@ -101,7 +101,10 @@ "host": { "url": "maps-"+url }, - "ports": [80] + "ports": [80], + "env": { + "FRONT_URL": "https://play-"+url + } }, "redis": { "image": "redis:6", diff --git a/docker-compose.single-domain.yaml b/docker-compose.single-domain.yaml index 52875ce8..1612e396 100644 --- a/docker-compose.single-domain.yaml +++ b/docker-compose.single-domain.yaml @@ -28,7 +28,7 @@ services: NODE_ENV: development PUSHER_URL: /pusher UPLOADER_URL: /uploader - ADMIN_URL: /admin + #ADMIN_URL: /admin MAPS_URL: /maps ICON_URL: /icon STARTUP_COMMAND_1: ./templater.sh @@ -92,11 +92,12 @@ services: - "traefik.http.routers.pusher-ssl.service=pusher" maps: - image: thecodingmachine/nodejs:12-apache + image: thecodingmachine/php:8.1-v4-apache-node12 environment: DEBUG_MODE: "$DEBUG_MODE" HOST: "0.0.0.0" NODE_ENV: development + FRONT_URL: http://play.workadventure.localhost #APACHE_DOCUMENT_ROOT: dist/ #APACHE_EXTENSIONS: headers #APACHE_EXTENSION_HEADERS: 1 diff --git a/docker-compose.yaml b/docker-compose.yaml index ed5389c0..e5e6489c 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -34,7 +34,7 @@ services: NODE_ENV: development PUSHER_URL: //pusher.workadventure.localhost UPLOADER_URL: //uploader.workadventure.localhost - ADMIN_URL: //workadventure.localhost + #ADMIN_URL: //workadventure.localhost ICON_URL: //icon.workadventure.localhost STARTUP_COMMAND_1: ./templater.sh STARTUP_COMMAND_2: yarn install @@ -96,11 +96,12 @@ services: - "traefik.http.routers.pusher-ssl.service=pusher" maps: - image: thecodingmachine/nodejs:12-apache + image: thecodingmachine/php:8.1-v4-apache-node12 environment: DEBUG_MODE: "$DEBUG_MODE" HOST: "0.0.0.0" NODE_ENV: development + FRONT_URL: http://play.workadventure.localhost #APACHE_DOCUMENT_ROOT: dist/ #APACHE_EXTENSIONS: headers #APACHE_EXTENSION_HEADERS: 1 diff --git a/front/src/Connexion/ConnectionManager.ts b/front/src/Connexion/ConnectionManager.ts index 23e8c7f8..5bed0a16 100644 --- a/front/src/Connexion/ConnectionManager.ts +++ b/front/src/Connexion/ConnectionManager.ts @@ -164,12 +164,13 @@ class ConnectionManager { console.error(err); } } else { + const query = urlParams.toString(); roomPath = window.location.protocol + "//" + window.location.host + window.location.pathname + - urlParams.toString() + //use urlParams because the token param must be deleted + (query ? "?" + query : "") + //use urlParams because the token param must be deleted window.location.hash; } diff --git a/front/src/WebRtc/CoWebsiteManager.ts b/front/src/WebRtc/CoWebsiteManager.ts index d48513c3..da09f634 100644 --- a/front/src/WebRtc/CoWebsiteManager.ts +++ b/front/src/WebRtc/CoWebsiteManager.ts @@ -15,6 +15,7 @@ const cowebsiteContainerDomId = "cowebsite-container"; // the id of the whole co const cowebsiteMainDomId = "cowebsite-slot-0"; // the id of the parent div of the iframe. const cowebsiteBufferDomId = "cowebsite-buffer"; // the id of the container who contains cowebsite iframes. const cowebsiteAsideDomId = "cowebsite-aside"; // the id of the parent div of the iframe. +const cowebsiteAsideHolderDomId = "cowebsite-aside-holder"; const cowebsiteSubIconsDomId = "cowebsite-sub-icons"; export const cowebsiteCloseButtonId = "cowebsite-close"; const cowebsiteFullScreenButtonId = "cowebsite-fullscreen"; @@ -60,6 +61,7 @@ class CoWebsiteManager { private cowebsiteMainDom: HTMLDivElement; private cowebsiteBufferDom: HTMLDivElement; private cowebsiteAsideDom: HTMLDivElement; + private cowebsiteAsideHolderDom: HTMLDivElement; private cowebsiteSubIconsDom: HTMLDivElement; private previousTouchMoveCoordinates: TouchMoveCoordinates | null = null; //only use on touchscreens to track touch movement @@ -105,6 +107,7 @@ class CoWebsiteManager { this.cowebsiteMainDom = HtmlUtils.getElementByIdOrFail(cowebsiteMainDomId); this.cowebsiteBufferDom = HtmlUtils.getElementByIdOrFail(cowebsiteBufferDomId); this.cowebsiteAsideDom = HtmlUtils.getElementByIdOrFail(cowebsiteAsideDomId); + this.cowebsiteAsideHolderDom = HtmlUtils.getElementByIdOrFail(cowebsiteAsideHolderDomId); this.cowebsiteSubIconsDom = HtmlUtils.getElementByIdOrFail(cowebsiteSubIconsDomId); this.initResizeListeners(); @@ -194,21 +197,23 @@ class CoWebsiteManager { this.fire(); }; - this.cowebsiteAsideDom.addEventListener("mousedown", (event) => { + this.cowebsiteAsideHolderDom.addEventListener("mousedown", (event) => { + if (this.isFullScreen) return; this.cowebsiteMainDom.style.display = "none"; this.resizing = true; document.addEventListener("mousemove", movecallback); }); document.addEventListener("mouseup", (event) => { - if (!this.resizing) return; + if (!this.resizing || this.isFullScreen) return; document.removeEventListener("mousemove", movecallback); this.cowebsiteMainDom.style.display = "block"; this.resizing = false; this.cowebsiteMainDom.style.display = "flex"; }); - this.cowebsiteAsideDom.addEventListener("touchstart", (event) => { + this.cowebsiteAsideHolderDom.addEventListener("touchstart", (event) => { + if (this.isFullScreen) return; this.cowebsiteMainDom.style.display = "none"; this.resizing = true; const touchEvent = event.touches[0]; @@ -217,7 +222,7 @@ class CoWebsiteManager { }); document.addEventListener("touchend", (event) => { - if (!this.resizing) return; + if (!this.resizing || this.isFullScreen) return; this.previousTouchMoveCoordinates = null; document.removeEventListener("touchmove", movecallback); this.cowebsiteMainDom.style.display = "block"; @@ -642,17 +647,22 @@ class CoWebsiteManager { } private fullscreen(): void { + const openFullscreenImage = HtmlUtils.getElementByIdOrFail(cowebsiteOpenFullScreenImageId); + const closeFullScreenImage = HtmlUtils.getElementByIdOrFail(cowebsiteCloseFullScreenImageId); + if (this.isFullScreen) { this.resetStyleMain(); this.fire(); //we don't trigger a resize of the phaser game since it won't be visible anyway. - HtmlUtils.getElementByIdOrFail(cowebsiteOpenFullScreenImageId).style.display = "inline"; - HtmlUtils.getElementByIdOrFail(cowebsiteCloseFullScreenImageId).style.display = "none"; + this.cowebsiteAsideHolderDom.style.visibility = "visible"; + openFullscreenImage.style.display = "inline"; + closeFullScreenImage.style.display = "none"; } else { this.verticalMode ? (this.height = window.innerHeight) : (this.width = window.innerWidth); //we don't trigger a resize of the phaser game since it won't be visible anyway. - HtmlUtils.getElementByIdOrFail(cowebsiteOpenFullScreenImageId).style.display = "none"; - HtmlUtils.getElementByIdOrFail(cowebsiteCloseFullScreenImageId).style.display = "inline"; + this.cowebsiteAsideHolderDom.style.visibility = "hidden"; + openFullscreenImage.style.display = "none"; + closeFullScreenImage.style.display = "inline"; } } } diff --git a/front/style/cowebsite.scss b/front/style/cowebsite.scss index 69085cc1..a6af21ee 100644 --- a/front/style/cowebsite.scss +++ b/front/style/cowebsite.scss @@ -28,7 +28,7 @@ justify-content: space-between; #cowebsite-aside-holder { - pointer-events: none; + background: gray; height: 20px; flex: 1; display: flex; @@ -38,6 +38,7 @@ img { width: 80%; + pointer-events: none; } } @@ -206,12 +207,14 @@ aside { width: 30px; - cursor: ew-resize; img { - cursor: ew-resize; transform: rotate(90deg); } } + + &-aside-holder { + cursor: ew-resize; + } } } diff --git a/front/webpack.config.ts b/front/webpack.config.ts index ca11313d..4af6c1b6 100644 --- a/front/webpack.config.ts +++ b/front/webpack.config.ts @@ -189,7 +189,7 @@ module.exports = { DISABLE_NOTIFICATIONS: false, PUSHER_URL: undefined, UPLOADER_URL: null, - ADMIN_URL: undefined, + ADMIN_URL: null, CONTACT_URL: null, PROFILE_URL: null, ICON_URL: null, diff --git a/maps/Dockerfile b/maps/Dockerfile index 7fc6fd19..d75ade4a 100644 --- a/maps/Dockerfile +++ b/maps/Dockerfile @@ -1,4 +1,4 @@ -FROM thecodingmachine/nodejs:12-apache +FROM thecodingmachine/php:8.1-v4-apache-node12 COPY --chown=docker:docker . . #RUN yarn install @@ -6,4 +6,5 @@ COPY --chown=docker:docker . . #ENV NODE_ENV=production #ENV STARTUP_COMMAND_1="yarn run build" #ENV APACHE_DOCUMENT_ROOT=dist/ -RUN sudo a2enmod headers +#RUN sudo a2enmod headers +ENV APACHE_EXTENSION_HEADERS=1 diff --git a/maps/tests/EmbeddedWebsite/website_in_map_script.json b/maps/tests/EmbeddedWebsite/website_in_map_script.json index 00ce95cb..3b667c11 100644 --- a/maps/tests/EmbeddedWebsite/website_in_map_script.json +++ b/maps/tests/EmbeddedWebsite/website_in_map_script.json @@ -12,8 +12,8 @@ { "name":"openWebsite", "type":"string", - "value":"website_in_map_script.html" - }, + "value":"website_in_map_script.php" + }, { "name":"openWebsiteAllowApi", "type":"bool", @@ -24,7 +24,7 @@ "width":30, "x":0, "y":0 - }, + }, { "data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "height":30, @@ -36,7 +36,7 @@ "width":30, "x":0, "y":0 - }, + }, { "draworder":"topdown", "id":3, @@ -90,4 +90,4 @@ "type":"map", "version":1.5, "width":30 -} \ No newline at end of file +} diff --git a/maps/tests/EmbeddedWebsite/website_in_map_script.html b/maps/tests/EmbeddedWebsite/website_in_map_script.php similarity index 89% rename from maps/tests/EmbeddedWebsite/website_in_map_script.html rename to maps/tests/EmbeddedWebsite/website_in_map_script.php index 1180a2de..c822b8ca 100644 --- a/maps/tests/EmbeddedWebsite/website_in_map_script.html +++ b/maps/tests/EmbeddedWebsite/website_in_map_script.php @@ -1,12 +1,8 @@ + - - -

Website opened by script.

- - diff --git a/maps/tests/Metadata/cowebsiteAllowApi.js b/maps/tests/Metadata/cowebsiteAllowApi.js index 56c7b767..aa2ad5a9 100644 --- a/maps/tests/Metadata/cowebsiteAllowApi.js +++ b/maps/tests/Metadata/cowebsiteAllowApi.js @@ -1 +1 @@ -WA.nav.openCoWebSite("cowebsiteAllowApi.html", true, ""); +WA.nav.openCoWebSite("cowebsiteAllowApi.php", true, ""); diff --git a/maps/tests/Metadata/cowebsiteAllowApi.php b/maps/tests/Metadata/cowebsiteAllowApi.php new file mode 100644 index 00000000..c3d1ddff --- /dev/null +++ b/maps/tests/Metadata/cowebsiteAllowApi.php @@ -0,0 +1,14 @@ + + + + + + + +

Website opened by script.

+ + diff --git a/maps/tests/Metadata/customIframeMenuApi.html b/maps/tests/Metadata/customIframeMenuApi.html deleted file mode 100644 index afe840cc..00000000 --- a/maps/tests/Metadata/customIframeMenuApi.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - API in iframe menu - - - -

This is an iframe in a custom menu.

- - \ No newline at end of file diff --git a/maps/tests/Metadata/customIframeMenuApi.php b/maps/tests/Metadata/customIframeMenuApi.php new file mode 100644 index 00000000..977c36d1 --- /dev/null +++ b/maps/tests/Metadata/customIframeMenuApi.php @@ -0,0 +1,16 @@ + + + + + API in iframe menu + + + + +

This is an iframe in a custom menu.

+ + diff --git a/maps/tests/Metadata/customMenu.html b/maps/tests/Metadata/customMenu.html deleted file mode 100644 index 4b38f0b9..00000000 --- a/maps/tests/Metadata/customMenu.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - -

Add a custom menu

- - \ No newline at end of file diff --git a/maps/tests/Metadata/customMenu.js b/maps/tests/Metadata/customMenu.js index ba66ee0d..7cedb632 100644 --- a/maps/tests/Metadata/customMenu.js +++ b/maps/tests/Metadata/customMenu.js @@ -7,9 +7,9 @@ WA.ui.registerMenuCommand('custom callback menu', () => { WA.ui.registerMenuCommand('custom iframe menu', {iframe: 'customIframeMenu.html'}); WA.room.onEnterZone('iframeMenu', () => { - menuIframeApi = WA.ui.registerMenuCommand('IFRAME USE API', {iframe: 'customIframeMenuApi.html', allowApi: true}); + menuIframeApi = WA.ui.registerMenuCommand('IFRAME USE API', {iframe: 'customIframeMenuApi.php', allowApi: true}); }) WA.room.onLeaveZone('iframeMenu', () => { menuIframeApi.remove(); -}) \ No newline at end of file +}) diff --git a/maps/tests/Metadata/customMenu.json b/maps/tests/Metadata/customMenu.json index c107aaf2..fdb69168 100644 --- a/maps/tests/Metadata/customMenu.json +++ b/maps/tests/Metadata/customMenu.json @@ -54,7 +54,7 @@ { "name":"openWebsite", "type":"string", - "value":"customMenu.html" + "value":"customMenu.php" }, { "name":"openWebsiteAllowApi", @@ -97,4 +97,4 @@ "type":"map", "version":"1.6", "width":10 -} \ No newline at end of file +} diff --git a/maps/tests/Metadata/customMenu.php b/maps/tests/Metadata/customMenu.php new file mode 100644 index 00000000..68205085 --- /dev/null +++ b/maps/tests/Metadata/customMenu.php @@ -0,0 +1,14 @@ + + + + + + + +

Add a custom menu

+ + diff --git a/maps/tests/Metadata/playerMove.html b/maps/tests/Metadata/playerMove.html deleted file mode 100644 index 46a36845..00000000 --- a/maps/tests/Metadata/playerMove.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - -

Log in the console the movement of the current player in the zone of the iframe

- - \ No newline at end of file diff --git a/maps/tests/Metadata/playerMove.json b/maps/tests/Metadata/playerMove.json index db590b05..109c78c0 100644 --- a/maps/tests/Metadata/playerMove.json +++ b/maps/tests/Metadata/playerMove.json @@ -13,7 +13,7 @@ "width":10, "x":0, "y":0 - }, + }, { "data":[33, 34, 34, 34, 34, 34, 34, 34, 34, 35, 41, 42, 42, 42, 42, 42, 42, 42, 42, 43, 41, 42, 42, 42, 42, 42, 42, 42, 42, 43, 41, 42, 42, 42, 42, 42, 42, 42, 42, 43, 41, 42, 42, 42, 42, 42, 42, 42, 42, 43, 41, 42, 42, 42, 42, 42, 42, 42, 42, 43, 41, 42, 42, 42, 42, 42, 42, 42, 42, 43, 41, 42, 42, 42, 42, 42, 42, 42, 42, 43, 41, 42, 42, 42, 42, 42, 42, 42, 42, 43, 49, 50, 50, 50, 50, 50, 50, 50, 50, 51], "height":10, @@ -25,7 +25,7 @@ "width":10, "x":0, "y":0 - }, + }, { "data":[0, 0, 0, 128, 128, 128, 128, 128, 128, 128, 0, 0, 0, 128, 128, 128, 128, 128, 128, 128, 0, 0, 0, 128, 128, 128, 128, 128, 128, 128, 0, 0, 0, 128, 128, 128, 128, 128, 128, 128, 0, 0, 0, 128, 128, 128, 128, 128, 128, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "height":10, @@ -36,8 +36,8 @@ { "name":"openWebsite", "type":"string", - "value":"playerMove.html" - }, + "value":"playerMove.php" + }, { "name":"openWebsiteAllowApi", "type":"bool", @@ -48,7 +48,7 @@ "width":10, "x":0, "y":0 - }, + }, { "draworder":"topdown", "id":5, @@ -105,7 +105,7 @@ "type":"bool", "value":true }] - }, + }, { "id":1, "properties":[ @@ -114,7 +114,7 @@ "type":"bool", "value":true }] - }, + }, { "id":2, "properties":[ @@ -123,7 +123,7 @@ "type":"bool", "value":true }] - }, + }, { "id":3, "properties":[ @@ -132,7 +132,7 @@ "type":"bool", "value":true }] - }, + }, { "id":4, "properties":[ @@ -141,7 +141,7 @@ "type":"bool", "value":true }] - }, + }, { "id":8, "properties":[ @@ -150,7 +150,7 @@ "type":"bool", "value":true }] - }, + }, { "id":9, "properties":[ @@ -159,7 +159,7 @@ "type":"bool", "value":true }] - }, + }, { "id":10, "properties":[ @@ -168,7 +168,7 @@ "type":"bool", "value":true }] - }, + }, { "id":11, "properties":[ @@ -177,7 +177,7 @@ "type":"bool", "value":true }] - }, + }, { "id":12, "properties":[ @@ -186,7 +186,7 @@ "type":"bool", "value":true }] - }, + }, { "id":16, "properties":[ @@ -195,7 +195,7 @@ "type":"bool", "value":true }] - }, + }, { "id":17, "properties":[ @@ -204,7 +204,7 @@ "type":"bool", "value":true }] - }, + }, { "id":18, "properties":[ @@ -213,7 +213,7 @@ "type":"bool", "value":true }] - }, + }, { "id":19, "properties":[ @@ -222,7 +222,7 @@ "type":"bool", "value":true }] - }, + }, { "id":20, "properties":[ @@ -233,7 +233,7 @@ }] }], "tilewidth":32 - }, + }, { "columns":8, "firstgid":65, @@ -251,4 +251,4 @@ "type":"map", "version":1.4, "width":10 -} \ No newline at end of file +} diff --git a/maps/tests/Metadata/playerMove.php b/maps/tests/Metadata/playerMove.php new file mode 100644 index 00000000..a9cf0495 --- /dev/null +++ b/maps/tests/Metadata/playerMove.php @@ -0,0 +1,14 @@ + + + + + + + +

Log in the console the movement of the current player in the zone of the iframe

+ + diff --git a/maps/tests/Metadata/setProperty.json b/maps/tests/Metadata/setProperty.json index 06addc2f..db6087bb 100644 --- a/maps/tests/Metadata/setProperty.json +++ b/maps/tests/Metadata/setProperty.json @@ -13,7 +13,7 @@ "width":10, "x":0, "y":0 - }, + }, { "data":[33, 34, 34, 34, 34, 34, 34, 34, 34, 35, 41, 42, 42, 42, 42, 42, 42, 42, 42, 43, 41, 42, 42, 42, 42, 42, 42, 42, 42, 43, 41, 42, 42, 42, 42, 42, 42, 42, 42, 43, 41, 42, 42, 42, 42, 42, 42, 42, 42, 43, 41, 42, 42, 42, 42, 42, 42, 42, 42, 43, 41, 42, 42, 42, 42, 42, 42, 42, 42, 43, 41, 42, 42, 42, 42, 42, 42, 42, 42, 43, 41, 42, 42, 42, 42, 42, 42, 42, 42, 43, 49, 50, 50, 50, 50, 50, 50, 50, 50, 51], "height":10, @@ -25,7 +25,7 @@ "width":10, "x":0, "y":0 - }, + }, { "data":[0, 0, 0, 0, 0, 0, 128, 128, 128, 128, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "height":10, @@ -36,8 +36,8 @@ { "name":"openWebsite", "type":"string", - "value":"setProperty.html" - }, + "value":"setProperty.php" + }, { "name":"openWebsiteAllowApi", "type":"bool", @@ -48,7 +48,7 @@ "width":10, "x":0, "y":0 - }, + }, { "data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 101, 101, 101, 101, 101, 0, 0, 0, 0, 0, 101, 101, 101, 101, 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "height":10, @@ -60,7 +60,7 @@ "width":10, "x":0, "y":0 - }, + }, { "draworder":"topdown", "id":5, @@ -117,7 +117,7 @@ "type":"bool", "value":true }] - }, + }, { "id":1, "properties":[ @@ -126,7 +126,7 @@ "type":"bool", "value":true }] - }, + }, { "id":2, "properties":[ @@ -135,7 +135,7 @@ "type":"bool", "value":true }] - }, + }, { "id":3, "properties":[ @@ -144,7 +144,7 @@ "type":"bool", "value":true }] - }, + }, { "id":4, "properties":[ @@ -153,7 +153,7 @@ "type":"bool", "value":true }] - }, + }, { "id":8, "properties":[ @@ -162,7 +162,7 @@ "type":"bool", "value":true }] - }, + }, { "id":9, "properties":[ @@ -171,7 +171,7 @@ "type":"bool", "value":true }] - }, + }, { "id":10, "properties":[ @@ -180,7 +180,7 @@ "type":"bool", "value":true }] - }, + }, { "id":11, "properties":[ @@ -189,7 +189,7 @@ "type":"bool", "value":true }] - }, + }, { "id":12, "properties":[ @@ -198,7 +198,7 @@ "type":"bool", "value":true }] - }, + }, { "id":16, "properties":[ @@ -207,7 +207,7 @@ "type":"bool", "value":true }] - }, + }, { "id":17, "properties":[ @@ -216,7 +216,7 @@ "type":"bool", "value":true }] - }, + }, { "id":18, "properties":[ @@ -225,7 +225,7 @@ "type":"bool", "value":true }] - }, + }, { "id":19, "properties":[ @@ -234,7 +234,7 @@ "type":"bool", "value":true }] - }, + }, { "id":20, "properties":[ @@ -245,7 +245,7 @@ }] }], "tilewidth":32 - }, + }, { "columns":8, "firstgid":65, @@ -263,4 +263,4 @@ "type":"map", "version":1.4, "width":10 -} \ No newline at end of file +} diff --git a/maps/tests/Metadata/setProperty.html b/maps/tests/Metadata/setProperty.php similarity index 52% rename from maps/tests/Metadata/setProperty.html rename to maps/tests/Metadata/setProperty.php index c61aa5fa..f23504f1 100644 --- a/maps/tests/Metadata/setProperty.html +++ b/maps/tests/Metadata/setProperty.php @@ -1,12 +1,8 @@ + + diff --git a/maps/tests/iframe_api.json b/maps/tests/iframe_api.json index db840b3f..11f2202b 100644 --- a/maps/tests/iframe_api.json +++ b/maps/tests/iframe_api.json @@ -20,7 +20,7 @@ "width":10, "x":0, "y":0 - }, + }, { "data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "height":10, @@ -32,7 +32,7 @@ "width":10, "x":0, "y":0 - }, + }, { "data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 34, 34, 34, 34, 0, 0, 0, 0, 0, 34, 34, 34, 34, 34, 0, 0, 0, 0, 0, 34, 34, 34, 34, 34, 0, 0, 0, 0, 0, 34, 34, 34, 34, 34, 0, 0, 0, 0, 0, 34, 34, 34, 34, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "height":10, @@ -43,8 +43,8 @@ { "name":"openWebsite", "type":"string", - "value":"iframe.html" - }, + "value":"iframe.php" + }, { "name":"openWebsiteAllowApi", "type":"bool", @@ -55,7 +55,7 @@ "width":10, "x":0, "y":0 - }, + }, { "data":[0, 0, 93, 0, 104, 0, 0, 0, 0, 0, 0, 0, 104, 0, 115, 0, 0, 0, 93, 0, 0, 0, 115, 0, 0, 0, 93, 0, 104, 0, 0, 0, 0, 0, 0, 0, 104, 0, 115, 93, 0, 0, 0, 0, 0, 0, 115, 0, 0, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "height":10, @@ -67,7 +67,7 @@ "width":10, "x":0, "y":0 - }, + }, { "draworder":"topdown", "id":3, @@ -121,4 +121,4 @@ "type":"map", "version":1.4, "width":10 -} \ No newline at end of file +} diff --git a/tests/tests/test.ts b/tests/tests/test.ts index c7747578..94659ad7 100644 --- a/tests/tests/test.ts +++ b/tests/tests/test.ts @@ -4,8 +4,9 @@ const fs = require('fs') import { Selector } from 'testcafe'; import {userAlice} from "./utils/roles"; +// Note: we are also testing that we can connect if the URL contains a random query string fixture `Variables` - .page `http://play.workadventure.localhost/_/global/maps.workadventure.localhost/tests/Variables/Cache/variables_tmp.json`; + .page `http://play.workadventure.localhost/_/global/maps.workadventure.localhost/tests/Variables/Cache/variables_tmp.json?somerandomparam=1`; test("Test that variables cache in the back don't prevent setting a variable in case the map changes", async (t: TestController) => { // Let's start by visiting a map that DOES not have the variable.