libreoffice-online/cypress_test/data/multiuser/cypress-multiuser.html
Rash419 2bcce2f630 cypress: updated cypress to use WOPI endpoints
Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: Ic5e165c4ebae19e48b9e2b9ffb67832ca41ccd76
2021-12-01 19:36:29 +05:30

42 lines
1.8 KiB
HTML

<!-- when cypress is enabled this html will be copied to dist folder to use it for multiuser tests -->
<html style="height:100%"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Multiuser tests</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0">
</head>
<body>
<form id="form1" action enctype="multipart/form-data" target="iframe1" method="post">
<input name="access_token" value="test" type="hidden"/>
</form>
<form id="form2" action enctype="multipart/form-data" target="iframe2" method="post">
<input name="access_token" value="test" type="hidden"/>
</form>
<iframe id="iframe1" name="iframe1" frameborder="0" scrolling="yes" style="height: 100%;
width: 49%; float: left; " height="100%" width="49%" align="left">
</iframe>
<iframe id="iframe2" name="iframe2" frameborder="0" scrolling="yes" style="overflow: hidden; height: 100%;
width: 49%; " height="100%" width="49%" align="right">
</iframe>
<script>
function constructWopiUrl() {
var wopiUrl = window.location.protocol + "//" + window.location.host + window.location.pathname + "?";
wopiUrl = wopiUrl.replace("cypress-multiuser.html", "cool.html");
var wopiSrc = window.location.protocol + "//" + window.location.host + "/wopi/files/" + encodeURIComponent(window.location.search.substring(window.location.search.indexOf("=")+2));
wopiUrl = wopiUrl + "WOPISrc=" + wopiSrc;
return wopiUrl
}
var wopiUrl = constructWopiUrl();
var form1 = document.getElementById("form1");
form1.action = wopiUrl
form1.submit();
var form2 = document.getElementById("form2");
form2.action = wopiUrl
form2.submit();
</script>
</body>
</html>