libreoffice-online/cypress_test/data/multiuser/cypress-multiuser.html
Rash419 4fa3926103 cypress: enabled and updated multiuser test
Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: Ib20c93ec9c45ce234ef974e0cb0bd5323873ac42
2021-12-01 19:36:29 +05:30

45 lines
2 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 params = new URLSearchParams(window.location.search);
var filePath = params.get('file_path').substr(1);
params.delete('file_path');
var wopiSrc = window.location.protocol + "//" + window.location.host + "/wopi/files/" + encodeURIComponent(filePath);
wopiUrl = wopiUrl + "WOPISrc=" + wopiSrc + '&' + params.toString();
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>