Я создаю свое приложение с помощью OpenUI5, и я хочу попробовать интегрировать OPA5 для его проверки. я пишу тестовую страницу: TestOPA.html
Не загружать правильно esource в OPA5
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Opa sample for matchers</title>
<script id="sap-ui-bootstrap" src="https://openui5.netweaver.ondemand.com/resources/sap-ui-core.js"></script>
<link rel="stylesheet" href="https://openui5.netweaver.ondemand.com/resources/sap/ui/thirdparty/qunit.css" type="text/css" media="screen" />
<script>
(function() {
jQuery.sap.require("sap.ui.thirdparty.qunit");
jQuery.sap.require("sap.ui.test.Opa5");
jQuery.sap.require("sap.ui.test.opaQunit");
var Opa = sap.ui.test.Opa;
var Opa5 = sap.ui.test.Opa5;
module("Matchers");
opaTest("Should find a Button with a matching property", function(Given, When, Then) {
// Act
Given.iStartMyAppInAFrame("../index.html");
/* When.waitFor({
viewName : "view.Main",
controlType : "sap.m.Button",
matchers : new sap.ui.test.matchers.PropertyStrictEquals({name : "text", value : "Changed text"}),
success : function (aButtons) {
ok(true, "Found the button: " + aButtons[0]);
},
errorMessage : "Did not find the button with the property Text equal to Changed text"
});
Then.iTeardownMyAppFrame(); */
});
})();
</script>
</head>
<body>
<h1 id="qunit-header">Opa sample for matchers</h1>
<h2 id="qunit-banner"></h2>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
<div id="qunit-fixture"></div>
</body>
</html>
index.html
является корнем моего приложения. Внутри потока (не в начале) я загружаю ресурсы, которые не загружаются должным образом. Я хочу, чтобы загрузить ресурс http://localhost:8080/ZWebapp2/apps/appChangePwd/changePwd.js
но консоль браузера показать мне ошибку, чтобы загрузить ресурс на http://localhost:8080/ZWebapp2/index.htmlapps/appChangePwd/changePwd.js
На всех браузерах он работает отлично (открытый http://localhost:8080/ZWebapp2/apps/appChangePwd/changePwd.js
), но у меня есть проблема, когда я начинаю TestOPA.html
у меня есть Та же проблема, если я launche в мое приложение (index.html
) на внутреннем браузере Eclipse, с помощью Run As -> Web App Preview