Commit 3f31c663 authored by Quentin Monnier's avatar Quentin Monnier Committed by Sylvain Berfini
Browse files

change autoClose screport to windowed and fix xml report attachment

1 merge request!1192Added automated UI tests
Showing with 12 additions and 12 deletions
No preview for this file type
...@@ -3,7 +3,7 @@ import os ...@@ -3,7 +3,7 @@ import os
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
from junit_xml import TestSuite, TestCase from junit_xml import TestSuite, TestCase
parser = argparse.ArgumentParser('screport',description='screport - The comparison tool to check and manage the conform display of any app') parser = argparse.ArgumentParser('html2xml',description='html2xml - Python script to convert html androidTest reports into jUnit xml reports')
parser.add_argument('-p', '--reports-path', parser.add_argument('-p', '--reports-path',
help='The path to search for reports files', help='The path to search for reports files',
required=False, required=False,
...@@ -53,12 +53,12 @@ for file in classNames: ...@@ -53,12 +53,12 @@ for file in classNames:
message = failure.find("pre") message = failure.find("pre")
images = [] images = []
for img in message.find_all("img"): for img in message.find_all("img"):
images.append(img["src"]) images.append(os.path.join(path,img["src"]))
img.decompose() img.decompose()
for div in message.find_all("div"): for div in message.find_all("div"):
div.decompose() div.decompose()
Tests[fileName][testName][2] = message.text Tests[fileName][testName][2] = message.text
Tests[fileName][testName][3] = " ".join(images) Tests[fileName][testName][3] = "[[ATTACHMENT|" + " ".join(images) + "]]"
except: except:
pass pass
......
...@@ -9,7 +9,7 @@ variables: ...@@ -9,7 +9,7 @@ variables:
android_api: "33" #android 13 android_api: "33" #android 13
emulator_type: "apis" #atd for api < 30 more efficient emulator_type: "apis" #atd for api < 30 more efficient
system_architecture: "arm64-v8a" #x86_64 or x86 for Intels system_architecture: "arm64-v8a" #x86_64 or x86 for Intels
android_system_image: "system-images;android-$android_api;google_$emulator_type;$system_architecture" #'sdkmanager --list | grep system-images' to have all existing configs android_system_image: "system-images;android-$android_api;google_$emulator_type;$system_architecture" # 'sdkmanager --list | grep system-images' to have all existing configs
emulator_device: "pixel_6" emulator_device: "pixel_6"
emulator_name: "$emulator_device-api_$android_api-google_$emulator_type-arch_$system_architecture" emulator_name: "$emulator_device-api_$android_api-google_$emulator_type-arch_$system_architecture"
...@@ -34,12 +34,12 @@ job-android-uitests: ...@@ -34,12 +34,12 @@ job-android-uitests:
script: script:
- set +e - set +e
- ./gradlew -Pandroid.testInstrumentationRunnerArguments.class=org.linphone.testsuites.CallTestSuite -PscreportAutoClose=true connectedAndroidTest --continue - ./gradlew -Pandroid.testInstrumentationRunnerArguments.class=org.linphone.testsuites.CallTestSuite -PscreportWindowed=false connectedAndroidTest --continue
- export BUILD_RESULT=$? - export BUILD_RESULT=$?
- ${ANDROID_HOME}/platform-tools/adb -s emulator-5554 emu kill - ${ANDROID_HOME}/platform-tools/adb -s emulator-5554 emu kill
- ${ANDROID_HOME}/platform-tools/adb -s emulator-5554 emu kill - ${ANDROID_HOME}/platform-tools/adb -s emulator-5554 emu kill #in case a confirm dialog popup appears
- ${ANDROID_HOME}/platform-tools/adb kill-server - ${ANDROID_HOME}/platform-tools/adb kill-server
- if [$BUILD_RESULT -eq 0]; then exit 0; else exit 1; fi - if [$BUILD_RESULT -eq 0] || [ ! -d app/build/reports/androidTests/connected/failures ]; then exit 0; else exit 1; fi
after_script: after_script:
- mv app/build/reports/androidTests/connected/* reports - mv app/build/reports/androidTests/connected/* reports
......
...@@ -420,11 +420,11 @@ def fetchScreenshotsTask = task('fetchScreenshots', type: Exec, group: 'reportin ...@@ -420,11 +420,11 @@ def fetchScreenshotsTask = task('fetchScreenshots', type: Exec, group: 'reportin
def launchScreenshotsComparisonTask = task('launchScreenshotsComparison', type: Exec, group: 'reporting') { def launchScreenshotsComparisonTask = task('launchScreenshotsComparison', type: Exec, group: 'reporting') {
workingDir "$rootDir/screport/" workingDir "$rootDir/screport/"
def autoClose = "false" def windowed = "true"
if (project.hasProperty("screportAutoClose") ) { if (project.hasProperty("screportWindowed") ) {
autoClose = screportAutoClose windowed = screportWindowed
} }
commandLine "python3", "launch.py", "-rp", "$projectDir/src/androidTest/java/org/linphone/screenshots", "-sp", "$projectDir/build/reports/androidTests/connected/screenshots", "-ac", "$autoClose" commandLine "python3", "launch.py", "-rp", "$projectDir/src/androidTest/java/org/linphone/screenshots", "-sp", "$projectDir/build/reports/androidTests/connected/screenshots", "-wd", "$windowed"
dependsOn() { dependsOn() {
fetchScreenshotsTask fetchScreenshotsTask
......
Subproject commit 3cbfaf20a15d7944025156711b655e5b13e0f779 Subproject commit c43b608d346d1ee440e874a2c19e3802847c4916
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment