Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 21 additions & 9 deletions framework/fileStore/BrowserPerformanceVariables.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,32 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#########################################################################
css3_test_url="https://css3test.com/#css3-background"
css3_test_subcategory_list = ["Animations Level 1", "Backgrounds and Borders Level 3", "Backgrounds and Borders Level 4", "Basic User Interface Level 3", "Basic User Interface Level 4", "Box Alignment Level 3", "Cascading and Inheritance Level 3", "Cascading and Inheritance Level 4", "Compositing and Blending Level 1", "Custom Properties for Cascading Variables Level 1", "Filter Effects Level 1", "Flexible Box Layout Level 1", "Fonts Level 3", "Fonts Level 4", "Generated Content Level 3", "Grid Layout Level 1", "Grid Layout Level 2", "Grid Layout Level 3", "Images Level 3", "Lists Level 3", "Masking Level 1", "Media Queries Level 3", "Media Queries Level 4", "Media Queries Level 5", "Pointer Events Level 1", "Pointer Events Level 3", "Positioned Layout Level 3", "Ruby Layout Level 1", "Scroll Snap Level 1", "Shadow Parts", "Shapes Level 1", "SVG 2 Coordinate Systems, Transformations and Units", "SVG 2 Geometry Properties", "SVG 2 Paint Servers", "SVG 2 Painting", "SVG 2 Scripting and Interactivity", "SVG 2 Text", "Text Decoration Level 3", "Text Decoration Level 4", "Transforms Level 1", "Transforms Level 2", "Transitions", "Will Change Level 1"]
octane_test_url ="https://chromium.github.io/octane/?auto=1"

app_download_url = ""

strike_app_bundle_name = ""

octane_app_bundle_name = ""
octane_test_subcategory_list = ["Crypto","EarleyBoyer","Splay","SplayLatency","pdf.js","CodeLoad"]

animation_app_bundle_name = ""

kraken_app_bundle_name = ""

smashcat_app_bundle_name = ""

motion_app_bundle_name = ""

speedometer_app_bundle_name = ""

css3_app_bundle_name = ""
css3_test_subcategory_list = ["Animations Level 1", "Backgrounds and Borders Level 3", "Backgrounds and Borders Level 4", "Basic User Interface Level 3", "Basic User Interface Level 4", "Box Alignment Level 3", "Cascading and Inheritance Level 3", "Cascading and Inheritance Level 4", "Compositing and Blending Level 1", "Custom Properties for Cascading Variables Level 1", "Filter Effects Level 1", "Flexible Box Layout Level 1", "Fonts Level 3", "Fonts Level 4", "Generated Content Level 3", "Grid Layout Level 1", "Grid Layout Level 2", "Grid Layout Level 3", "Images Level 3", "Lists Level 3", "Masking Level 1", "Media Queries Level 3", "Media Queries Level 4", "Media Queries Level 5", "Pointer Events Level 1", "Pointer Events Level 3", "Positioned Layout Level 3", "Ruby Layout Level 1", "Scroll Snap Level 1", "Shadow Parts", "Shapes Level 1", "SVG 2 Coordinate Systems, Transformations and Units", "SVG 2 Geometry Properties", "SVG 2 Paint Servers", "SVG 2 Painting", "SVG 2 Scripting and Interactivity", "SVG 2 Text", "Text Decoration Level 3", "Text Decoration Level 4", "Transforms Level 1", "Transforms Level 2", "Transitions", "Will Change Level 1"]


html5_test_url ="https://html5test.com/"
html5_test_subcategory_list = ["Parsing rules","Elements","Forms","Web Components","Location and Orientation","Communication","Streams","Performance","Security","Payments","Video","Audio","Streaming","Animation","Files"]
sunspider_url = "https://webkit.org/perf/sunspider-1.0.2/sunspider-1.0.2/driver.html"
sunspider_test_subcategory_list = ["access","bitops","3bit-bits-in-byte","bits-in-byte","bitwise-and","nsieve-bits","controlflow","recursive","crypto","math"]
strike_tool_url = "https://strike.lightningjs.io/"
motionmark_test_url = "https://browserbench.org/MotionMark1.2/"
animation_benchmark_test_url = "https://themaninblue.com/experiment/AnimationBenchmark/canvas/"
speedometer_test_url = "https://browserbench.org/Speedometer3.1/"
smashcat_test_url = "http://www.smashcat.org/av/canvas_test/"
kraken_test_url = "https://mozilla.github.io/krakenbenchmark.mozilla.org/kraken-1.1/driver.html"
#https://askubuntu.com/questions/432255/what-is-the-display-environment-variable
display_variable=":0"
#Give the path where the chromedriver executable is available
Expand Down
348 changes: 338 additions & 10 deletions framework/fileStore/rdkv_performancelib.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
import rdkv_performancelib
import BrowserPerformanceVariables
from StabilityTestUtility import *
import json

#Test component to be tested
obj = tdklib.TDKScriptingLibrary("rdkv_performance","1",standAlone=True)
Expand All @@ -115,111 +116,53 @@

expectedResult = "SUCCESS"
if expectedResult in result.upper():
browser_test_url=BrowserPerformanceVariables.animation_benchmark_test_url
print("\n Check Pre conditions")
sub_category_failure = False
#No need to revert any values if the pre conditions are already set.
revert="NO"
status,curr_webkit_status,curr_cobalt_status = check_pre_requisites(obj)
print("Current values \nWebKitBrowser:%s\nCobalt:%s"%(curr_webkit_status,curr_cobalt_status))
if status == "FAILURE":
if "FAILURE" not in (curr_webkit_status,curr_cobalt_status):
#Need to revert the values since we are changing plugin status
revert="YES"
set_status = set_pre_requisites(obj)
if set_status == "SUCCESS":
status,webkit_status,cobalt_status = check_pre_requisites(obj)
else:
status = "FAILURE"
else:
status = "FAILURE"
app_bundle_name=BrowserPerformanceVariables.animation_app_bundle_name
app_download_url=BrowserPerformanceVariables.app_download_url
app_name = "com.rdkcentral.animation"

status = rdkservice_install_launch_app(obj, app_bundle_name, app_name, app_download_url)
if status == "SUCCESS":
print("\nPre conditions for the test are set successfully")
print("\nGet the URL in WebKitBrowser")
tdkTestObj = obj.createTestStep('rdkservice_getValue')
tdkTestObj.addParameter("method","WebKitBrowser.1.url")
time.sleep(20)
tdkTestObj = obj.createTestStep('rdkservice_getBrowserScore_AnimationBenchmark')
tdkTestObj.executeTestCase(expectedResult)
current_url = tdkTestObj.getResultDetails()
browser_score_dict = json.loads(tdkTestObj.getResultDetails())
result = tdkTestObj.getResult()
if current_url != None and expectedResult in result:
tdkTestObj.setResultStatus("SUCCESS")
print("Current URL:",current_url)
print("\nSet test URL")

tdkTestObj = obj.createTestStep('rdkservice_setValue')
tdkTestObj.addParameter("method","WebKitBrowser.1.url")
tdkTestObj.addParameter("value",browser_test_url)
tdkTestObj.executeTestCase(expectedResult)
result = tdkTestObj.getResult()
if expectedResult in result:
time.sleep(10)

print("\nValidate if the URL is set successfully or not")
tdkTestObj = obj.createTestStep('rdkservice_getValue')
tdkTestObj.addParameter("method","WebKitBrowser.1.url")
tdkTestObj.executeTestCase(expectedResult)
new_url = tdkTestObj.getResultDetails()
result = tdkTestObj.getResult()
if new_url == browser_test_url and expectedResult in result:
tdkTestObj.setResultStatus("SUCCESS")
print("URL(",new_url,") is set successfully")

time.sleep(20)
tdkTestObj = obj.createTestStep('rdkservice_getBrowserScore_AnimationBenchmark')
tdkTestObj.executeTestCase(expectedResult)
browser_score_dict = json.loads(tdkTestObj.getResultDetails())
result = tdkTestObj.getResult()
if browser_score_dict["main_score"] != "Unable to get the browser score" and expectedResult in result:
tdkTestObj.setResultStatus("SUCCESS");
browser_score = browser_score_dict["main_score"]
conf_file,result = getConfigFileName(tdkTestObj.realpath)
result1, animation_threshold_value = getDeviceConfigKeyValue(conf_file,"ANIMATION_BENCHMARK_THRESHOLD_VALUE")
if animation_threshold_value != "":
print("\n Browser score from test: ",browser_score)
Summ_list.append('Browser score from test: {} '.format(browser_score))
print("\n Threshold value for browser score:",animation_threshold_value)
Summ_list.append('Threshold value for browser score: {}'.format(animation_threshold_value))
if float(browser_score) > float(animation_threshold_value):
print("\n The browser performance score is high as expected\n")
else:
tdkTestObj.setResultStatus("FAILURE")
print("\n The browser performance score is lower than expected \n")
else:
tdkTestObj.setResultStatus("FAILURE")
print("Failed to get the threshold value from config file")
else:
tdkTestObj.setResultStatus("FAILURE")
print("Failed to get the browser score")
if browser_score_dict["main_score"] != "Unable to get the browser score" and expectedResult in result:
tdkTestObj.setResultStatus("SUCCESS");
browser_score = browser_score_dict["main_score"]
conf_file,result = getConfigFileName(tdkTestObj.realpath)
result1, animation_threshold_value = getDeviceConfigKeyValue(conf_file,"ANIMATION_BENCHMARK_THRESHOLD_VALUE")
if animation_threshold_value != "":
print("\n Browser score from test: ",browser_score)
Summ_list.append('Browser score from test: {} '.format(browser_score))
print("\n Threshold value for browser score:",animation_threshold_value)
Summ_list.append('Threshold value for browser score: {}'.format(animation_threshold_value))
if float(browser_score) > float(animation_threshold_value):
print("\n The browser performance score is high as expected\n")
else:
print("Failed to load the URL",new_url)
tdkTestObj.setResultStatus("FAILURE")
#Set the URL back to previous
tdkTestObj = obj.createTestStep('rdkservice_setValue')
tdkTestObj.addParameter("method","WebKitBrowser.1.url")
tdkTestObj.addParameter("value",current_url)
tdkTestObj.executeTestCase(expectedResult)
result = tdkTestObj.getResult()
if result == "SUCCESS":
print("URL is reverted successfully")
tdkTestObj.setResultStatus("SUCCESS")
else:
print("Failed to revert the URL")
tdkTestObj.setResultStatus("FAILURE")
print("\n The browser performance score is lower than expected \n")
else:
tdkTestObj.setResultStatus("FAILURE")
print("Failed to set URL to webkitbrowser")
print("Failed to get the threshold value from config file")
else:
tdkTestObj.setResultStatus("FAILURE")
print("Failed to get URL in webkitbrowser")
print("Failed to get the browser score")
print("\n Terminating the app")
tdkTestObj = obj.createTestStep('rdkv_terminate_app');
tdkTestObj.addParameter("app_id",app_name)
tdkTestObj.executeTestCase(expectedResult)
result = tdkTestObj.getResult()
if result == "SUCCESS":
tdkTestObj.setResultStatus("SUCCESS");
else:
tdkTestObj.setResultStatus("FAILURE");
print("Unable to terminate the app")
else:
print("Pre conditions are not met")
obj.setLoadModuleStatus("FAILURE")
Comment thread
sahithya50 marked this conversation as resolved.
print("Failed to launch the app")
obj.setLoadModuleStatus("FAILURE")

getSummary(Summ_list,obj)
#Revert the values
if revert=="YES":
print("Revert the values before exiting")
status = revert_value(curr_webkit_status,curr_cobalt_status,obj)
obj.unloadModule("rdkv_performance")
else:
obj.setLoadModuleStatus("FAILURE")
Expand Down
Loading
Loading