7 Testing an Embedded Widget
The utility can view the embedded widgets with fixture data by
appending fixtures=true
as a query parameter
definition in the <script>
tag for any webpage
that includes embedded widgets. Enabling fixtures removes the
authentication process and displays the widget content with example
data and configuration. This configuration applies to an entire
page and thus applies to all widgets embedded on the page. This
type of testing is helpful for viewing a widget in a web
environment ahead of full widget configuration and authentication
setup. Examples are shown below.
WARNING:
Fixture-based testing is not a replacement for more comprehensive testing procedures. It is recommended to test with a test user account available in the Oracle Utilities Opower data set, or once single sign-on setup is completed.Stage Environment Example
<!DOCTYPE html><html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Page Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://ei-util-stage.opower.com/ei/x/embedded-api/core.js?fixtures=true"></script>
</head>
<body>
<div>
<opower-widget-neighbor-comparison></opower-widget-neighbor-comparison>
</div>
<div>
<opower-widget-data-browser></opower-widget-data-browser>
</div>
</body>
</html>
Production Environment Example
<!DOCTYPE html><html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Page Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://util.opower.com/ei/x/embedded-api/core.js?fixtures=true"></script>
</head>
<body>
<div>
<opower-widget-neighbor-comparison></opower-widget-neighbor-comparison>
</div>
<div>
<opower-widget-data-browser></opower-widget-data-browser>
</div>
</body>
</html>