Skip to content

Commit

Permalink
Feature/smart tv functional test (#4559)
Browse files Browse the repository at this point in the history
* Starting webapp on LG works

* First working webOS test execution

* Add WebOS testapp files

* Working Samsung TV karma test execution

* Minor change to smoke tests

* Provide config parameters for Tizen runner via config json

* Reset command

* Remove selenium certs
  • Loading branch information
dsilhavy committed Aug 27, 2024
1 parent 97c553b commit b3c61fc
Show file tree
Hide file tree
Showing 21 changed files with 772 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,6 @@ test/unit/results
# Karma Functional tests
test/functional/results
test/functional/config/selenium/jars
/samples/custom/
/samples/modules/webpack/package-lock.json
/test/functional/apps/webos/test-app/com.dashjs.app_1.0.0_all.ipk
17 changes: 17 additions & 0 deletions test/functional/apps/tizen/config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns:tizen="http://tizen.org/ns/widgets" xmlns="http://www.w3.org/ns/widgets" id="http://yourdomain/dashjs" version="1.0.0" viewmodes="maximized">
<access origin="*" subdomains="true"/>
<tizen:application id="JrSSYX615t.dashjs" package="JrSSYX615t" required_version="2.3"/>
<content src="index.html"/>
<feature name="http://tizen.org/feature/screen.size.normal.1080.1920"/>
<icon src="icon.png"/>
<tizen:metadata key="http://tizen.org/metadata/app_ui_type/base_screen_resolution" value="extensive"/>
<name>dashjs</name>
<tizen:privilege name="http://developer.samsung.com/privilege/network.public"/>
<tizen:privilege name="http://developer.samsung.com/privilege/drmplay"/>
<tizen:privilege name="http://tizen.org/privilege/filesystem.read"/>
<tizen:privilege name="http://tizen.org/privilege/filesystem.write"/>
<tizen:privilege name="http://tizen.org/privilege/filesystem.manage"/>
<tizen:profile name="tv-samsung"/>
<tizen:setting screen-orientation="landscape" context-menu="enable" background-support="disable" encryption="disable" install-location="auto" hwkey-event="enable"/>
</widget>
75 changes: 75 additions & 0 deletions test/functional/apps/tizen/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
* {
font-family: Lucida Sans, Arial, Helvetica, sans-serif;
}

body {
margin: 50px auto;
background-color: #ffffff;
}

header h1 {
font-size: 108px;
margin: 0px;
}

header h2 {
font-size: 54px;
margin: 0px;
color: #888;
font-style: italic;
}

nav ul {
list-style: none;
padding: 20px;
display: block;
clear: right;
background-color: #666;
padding-left: 4px;
height: 48px;
}

nav ul li {
display: inline;
padding: 0px 20px 5px 10px;
border-right: 1px solid #ccc;
}

nav ul li a {
color: #EFD3D3;
text-decoration: none;
font-size: 39px;
font-weight: bold;
}

nav ul li a:hover {
color: #fff;
}

article > header h1 {
font-size: 60px;
margin-left: 14px;
}

article > header h1 a {
color: #993333;
}

article > header h1 img {
vertical-align:middle;
}

article > section header h1 {
font-size: 48px;
}

article p {
clear: both;
}

footer p {
text-align: center;
font-size: 36px;
color: #888;
margin-top: 30px;
}
Binary file added test/functional/apps/tizen/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/functional/apps/tizen/images/tizen_32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions test/functional/apps/tizen/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta name="description" content="Tizen basic template generated by Tizen Web IDE"/>

<title>dash.js tests</title>

<link rel="stylesheet" type="text/css" href="css/style.css"/>
<script src="js/main.js"></script>
</head>

<body>
<header>
<hgroup>
<h1>dash.js Tests</h1>
</hgroup>
</header>
</body>
</html>
19 changes: 19 additions & 0 deletions test/functional/apps/tizen/js/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//Initialize function
var init = function () {
// Path to the text file where the URL is written
let filePath = 'wgt-package/url.txt';

tizen.filesystem.resolve(filePath, function(file) {
file.readAsText(function(url) {
console.log('Read URL from file:', url);
window.location.href = url
}, function(error) {
console.error('Error reading URL from file:', error);
});
}, function(error) {
console.error('Error resolving file path:', error);
}, 'r');
};
// window.onload can work without <body onload="">
window.onload = init;

10 changes: 10 additions & 0 deletions test/functional/apps/webos/test-app/appinfo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"id": "com.dashjs.app",
"version": "1.0.0",
"vendor": "My Company",
"type": "web",
"main": "index.html",
"title": "dashjs LG",
"icon": "icon.png",
"largeIcon": "largeIcon.png"
}
Binary file added test/functional/apps/webos/test-app/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions test/functional/apps/webos/test-app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<!--
Copyright (c) 2024 LG Electronics Inc.
SPDX-License-Identifier: Apache-2.0
-->

<!DOCTYPE html>
<html>

<head>
<title>new app</title>
<style type="text/css">
body {
width: 100%;
height: 100%;
background-color: #202020;
}

div {
position: absolute;
height: 100%;
width: 100%;
display: table;
}

h1 {
display: table-cell;
vertical-align: middle;
text-align: center;
color: #FFFFFF;
}

</style>
</head>

<script src="webOSTVjs-1.2.10/webOSTV.js" charset="utf-8"></script>
<script src="webOSTVjs-1.2.10/webOSTV-dev.js" charset="utf-8"></script>
<script type="text/javascript">
document.addEventListener('webOSLaunch', function (event) {
var url = event.detail.url;
window.location.href = url;
});

</script>

<body>
<div>
<h1>Hello, World!</h1>
</div>
</body>

</html>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit b3c61fc

Please sign in to comment.