Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.0 rc #1021

Open
wants to merge 55 commits into
base: master
Choose a base branch
from
Open

3.0 rc #1021

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
7e453f3
Update README.md
vdelendik Aug 16, 2024
33a11ba
#990 Mobile: home button fix
ignacionar Aug 29, 2024
5623d25
#992 Mobile: Tap fixes
ignacionar Aug 29, 2024
a8dbd94
#996 Mobile: Fix moving screen behavior
ignacionar Aug 29, 2024
b661404
#997 Mobile: Caption for stf routes
ignacionar Aug 30, 2024
c06cbe9
additional control panes adjustments
ignacionar Aug 30, 2024
34ecf5b
Merge pull request #998 from ignacionar/#990
dhreben Aug 30, 2024
8f2f3a4
Merge pull request #999 from ignacionar/#992
dhreben Aug 30, 2024
3732f76
Merge pull request #1000 from ignacionar/#996
dhreben Aug 30, 2024
19f0bab
add missing text
ignacionar Sep 3, 2024
89d1b3b
#1002 Mobile: cancel auto scroll
ignacionar Sep 3, 2024
bf90e3c
Merge pull request #1004 from ignacionar/#1002
dhreben Sep 4, 2024
df7c6ce
#995 Mobile: 'use' button correct styles
ignacionar Sep 4, 2024
80bd157
Merge pull request #1005 from ignacionar/#995
dhreben Sep 4, 2024
f3bd1a0
Merge pull request #1001 from ignacionar/#997
dhreben Sep 5, 2024
cdeb746
Mobile fixes for #997, #1002, #1007
ignacionar Sep 6, 2024
1d17c55
#994 Testing: reduce canvas size if exceeded
ignacionar Sep 6, 2024
aa405ed
additional device control route fix
ignacionar Sep 6, 2024
d14770e
Merge pull request #1008 from ignacionar/#1007
dhreben Sep 6, 2024
f580004
Mobile: fixes for Android
ignacionar Sep 6, 2024
237b55c
Merge pull request #1010 from ignacionar/#1007
dhreben Sep 9, 2024
98674fd
Merge pull request #1009 from ignacionar/#994
dhreben Sep 10, 2024
53932a1
#1011 remove button changes
ignacionar Sep 10, 2024
9d1f32b
#994 Testing: adjust canvas size on new Image detection
ignacionar Sep 10, 2024
aad1bfc
Merge pull request #1012 from ignacionar/#1011
dhreben Sep 11, 2024
92c0ced
Merge pull request #1013 from ignacionar/#994
dhreben Sep 11, 2024
88a9e03
#994 Testing: reducing canvas size by 5%
ignacionar Sep 11, 2024
ae5b69e
Merge pull request #1014 from ignacionar/#994
dhreben Sep 12, 2024
940e897
#994 Testing: adjusting canvas image size
ignacionar Sep 12, 2024
a351fd2
Merge pull request #1015 from ignacionar/#994
dhreben Sep 12, 2024
253b3da
#994 Set image size to canvas size
ignacionar Sep 12, 2024
ed06b77
Merge pull request #1016 from ignacionar/#994
dhreben Sep 13, 2024
4324904
#994 Redraw canvas image
ignacionar Sep 13, 2024
106728e
Merge pull request #1017 from ignacionar/#994
dhreben Sep 13, 2024
5c35577
#994 Testing: condition fix and draw image revert
ignacionar Sep 13, 2024
d9dde20
Merge pull request #1018 from ignacionar/#994
dhreben Sep 13, 2024
e85a929
#996 Fix for rotation icons styles and exceeded canvas on landscape
ignacionar Sep 16, 2024
8bcf491
Merge pull request #1019 from ignacionar/#996
dhreben Sep 16, 2024
33abeaa
#996 timeout exception for basicmode
ignacionar Sep 16, 2024
1469baa
Merge pull request #1020 from ignacionar/#996
dhreben Sep 17, 2024
560abc4
#918 using underscores for device name
ignacionar Sep 17, 2024
d823743
Merge pull request #1022 from ignacionar/#918
dhreben Sep 17, 2024
a2dc440
#1023 workaround to use ios18 in mobile
ignacionar Sep 20, 2024
e299849
Merge pull request #1024 from ignacionar/#1023
dhreben Sep 20, 2024
9b7c2cf
Revert "#918 using underscores for device name"
dhreben Sep 20, 2024
1c16a3f
Merge pull request #1025 from zebrunner/revert-1022-#918
dhreben Sep 20, 2024
4366dc6
#991: Workaround for mobile swipe in iOS
ignacionar Sep 25, 2024
c8e6bc0
Merge pull request #1026 from ignacionar/#991
dhreben Sep 25, 2024
e228f9d
#918 Display correct device info. in manufacturer
ignacionar Sep 25, 2024
aa1e809
Update info.pug
ignacionar Sep 25, 2024
5ae03b3
Include device.name in info.pug
ignacionar Sep 26, 2024
af04949
Use device.name in enhance-device-service.js
ignacionar Sep 26, 2024
3162806
Merge pull request #1027 from ignacionar/#918
dhreben Sep 26, 2024
9d1d156
#918 using enhancedName var.
ignacionar Oct 3, 2024
50c6489
Merge pull request #1028 from ignacionar/#918
dhreben Oct 4, 2024
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SmartTestFarm
==================

Feel free to support the development with a [**donation**](https://www.paypal.com/donate?hosted_button_id=JLQ4U468TWQPS) for the next improvements.
Feel free to support the development with a [**donation**](https://www.paypal.com/donate/?hosted_button_id=MNHYYCYHAKUVA) for the next improvements.

<p align="center">
<a href="https://zebrunner.com/"><img alt="Zebrunner" src="https://github.com/zebrunner/zebrunner/raw/master/docs/img/zebrunner_intro.png"></a>
Expand Down
19 changes: 19 additions & 0 deletions lib/units/ios-device/plugins/util/iosutil.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,25 @@ let iosutil = {
}
},
swipe: function(orientation, params, deviceSize) {

if (params.toX >= 2 || params.toY >= 2) {
if (params.fromY >= 0.5) {
params.fromY /= 2
params.toY = 0.25
} else {
params.fromY *= 2
params.toY = 0.75
}

if (params.fromX >= 0.5) {
params.fromX /= 2
params.toX = 0.25
} else {
params.fromX *= 2
params.toX = 0.75
}
}

switch(orientation) {
case 'PORTRAIT':
return {
Expand Down
5 changes: 4 additions & 1 deletion lib/units/ios-device/plugins/wda.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,11 @@ module.exports = syrup.serial()
wdaClient.typeKey({value: [iosutil.asciiparser(message.text)]})
})
.on(wire.KeyDownMessage, (channel, message) => {
log.verbose("wire.TypeMessage: ", message)
log.verbose("wire.KeyDownMessage: ", message)
wdaClient.typeKey({value: [iosutil.asciiparser(message.key)]})
if (message.key === 'home') {
wdaClient.homeBtn()
}
})
.on(wire.BrowserOpenMessage, (channel, message) => {
wdaClient.openUrl(message)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ module.exports = function EnhanceDeviceServiceFactory($filter, AppState) {
}

function enhanceDevice(device) {
device.enhancedName = device.model || device.product || device.marketName || device.serial || 'Unknown'
device.enhancedName = device.name || device.model || device.product || device.marketName || device.serial || 'Unknown'
device.enhancedModel = device.model || 'Unknown'
device.enhancedImage120 = '/static/app/devices/icon/x120/' + (device.platform || device.image || '_default.jpg')
device.enhancedImage24 = '/static/app/devices/icon/x24/' + (device.platform || device.image || '_default.jpg')
Expand Down
23 changes: 2 additions & 21 deletions res/app/components/stf/landscape/landscape-directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ module.exports =
link: function(scope) {
var body = angular.element($document[0].body)

if (typeof $window.orientation !== 'undefined') {
if ($window.orientation !== 0) {
rotateGuest(false)
}
}

function rotateGuest(portrait) {
if (portrait) {
body.addClass('guest-portrait')
Expand All @@ -31,20 +25,7 @@ module.exports =
var isPortrait = (window.innerHeight > window.innerWidth)
rotateGuest(isPortrait)
}

if (BrowserInfo.deviceorientation) {
window.addEventListener('orientationchange', guestDisplayRotated,
true)
}

function off() {
if (BrowserInfo.deviceorientation) {
window.removeEventListener('orientationchange',
guestDisplayRotated)
}
}

scope.$on('$destroy', off)

}
}
}
}
63 changes: 54 additions & 9 deletions res/app/components/stf/screen/screen-directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ module.exports = function DeviceScreenDirective(
function handleScreen() {
let ws, adjustedBoundSize
const canvas = element.querySelector('.screen__canvas')

const g = canvas.getContext('2d')
// const positioner = element.querySelector('div.positioner')
const devicePixelRatio = window.devicePixelRatio || 1
Expand Down Expand Up @@ -272,13 +273,17 @@ module.exports = function DeviceScreenDirective(

img.onload = function() {
updateImageArea(this)
g.drawImage(img, 0, 0, img.width, img.height)
if (canvas.width === 2484 && canvas.height === 5376) {
g.drawImage(img, 0, 0, canvas.width, canvas.height)
return cleanData()
}

// Try to forcefully clean everything to get rid of memory
// leaks. Note that despite this effort, Chrome will still
// leak huge amounts of memory when the developer tools are
// open, probably to save the resources for inspection. When
// the developer tools are closed no memory is leaked.
g.drawImage(img, 0, 0, img.width, img.height)
cleanData()
}

Expand Down Expand Up @@ -448,6 +453,10 @@ module.exports = function DeviceScreenDirective(
return screen.rotation === 90 || screen.rotation === 270
}

function canvasSizeExceeded() {
return $rootScope.basicMode && canvas.width * canvas.height >= 16777216
}

function updateImageArea(img) {
if (!hasImageAreaChanged(img)) {
return
Expand All @@ -465,6 +474,17 @@ module.exports = function DeviceScreenDirective(
canvas.height = cachedImageHeight
}

if (canvasSizeExceeded() && $scope.device.version !== '18.0') {
console.log(`exceeded canvas size limit, reducing previous size: ${canvas.width}x${canvas.height}`);
if ($scope.device.display.rotation === 90) {
canvas.width = 5376;
canvas.height = 2484;
return
}
canvas.width = 2484;
canvas.height = 5376;
}

cssRotation += rotator(cachedScreen.rotation, screen.rotation)
// canvas.style[cssTransform] = 'rotate(' + cssRotation + 'deg)'

Expand Down Expand Up @@ -750,6 +770,12 @@ module.exports = function DeviceScreenDirective(
$document.bind('mouseup', mouseUpListener)
$document.bind('mouseleave', mouseUpListener)

if (!$rootScope.basicMode) {
$element.bind('touchmove', mouseMoveListener)
$document.bind('touchend', mouseUpListener)
$document.bind('touchcancel', mouseUpListener)
}

if (lastPossiblyBuggyMouseUpEvent
&& lastPossiblyBuggyMouseUpEvent.timeStamp > e.timeStamp) {
// We got mouseup before mousedown. See mouseUpBugWorkaroundListener
Expand Down Expand Up @@ -938,6 +964,13 @@ module.exports = function DeviceScreenDirective(
}

function stopMousing() {

if (!$rootScope.basicMode) {
$element.unbind('touchmove', mouseMoveListener)
$document.unbind('touchend', mouseUpListener)
$document.unbind('touchcancel', mouseUpListener)
}

$element.unbind('mousemove', mouseMoveListener)
$document.unbind('mouseup', mouseUpListener)
$document.unbind('mouseleave', mouseUpListener)
Expand Down Expand Up @@ -1013,9 +1046,12 @@ module.exports = function DeviceScreenDirective(
activateFinger(slot, x, y, pressure)
}

$element.bind('touchmove', touchMoveListener)
$document.bind('touchend', touchEndListener)
$document.bind('touchleave', touchEndListener)

if ($rootScope.basicMode) {
$element.bind('touchmove', touchMoveListener)
$document.bind('touchend', touchEndListener)
$document.bind('touchleave', touchEndListener)
}

$scope.control.touchCommit(nextSeq())
}
Expand Down Expand Up @@ -1043,9 +1079,13 @@ module.exports = function DeviceScreenDirective(
$scope.device.ios
)

$scope.control.touchMove(nextSeq(), slot, scaled.xP, scaled.yP, pressure)
//$scope.control.touchMoveIos(nextSeq(), slot, scaled.xP, scaled.yP, pressure)
activateFinger(slot, x, y, pressure)
if ($scope.device.ios) {
const touchev = e.touches[0];

$scope.control.touchMoveIos(touchev.pageX, touchev.pageY, scaled.xP, scaled.yP, 0.5);

activateFinger(slot, x, y, pressure);
}
}

$scope.control.touchCommit(nextSeq())
Expand Down Expand Up @@ -1096,12 +1136,17 @@ module.exports = function DeviceScreenDirective(
$scope.control.gestureStop(nextSeq())
}

$element.on('touchstart', touchStartListener)
$element.on('touchstart', (e) => {
if (!$rootScope.basicMode) {
return mouseDownListener(e)
}
touchStartListener(e)
})
$element.on('mousedown', mouseDownListener)
$element.on('mouseup', mouseUpBugWorkaroundListener)

createSlots()
}
}
}
}
}
2 changes: 1 addition & 1 deletion res/app/control-panes/advanced/advanced.pug
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
.col-md-6
div(ng-include='"control-panes/advanced/maintenance/maintenance.pug"')
.col-md-6
div(ng-include='"control-panes/advanced/device-settings/device-settings.pug"')
div(ng-include='"control-panes/advanced/device-settings/device-settings.pug"', style='{{$root.basicMode ? "height: 250px" : "height: auto;" }}')

5 changes: 5 additions & 0 deletions res/app/control-panes/control-panes.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@media (max-width: 400px) {
.pane-bottom-p.fa-pane.pane-fa-pane.fa-pane-orientation-vertical {
display: none;
}
}
3 changes: 2 additions & 1 deletion res/app/control-panes/control-panes.pug
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ div(ng-controller='ControlPanesHotKeysCtrl').fill-height
.remote-control
div(ng-include='"control-panes/device-control/device-control.pug"').fill-height

div(fa-pane, pane-id='control-bottom-tabs', pane-anchor='south', pane-size='30% + 2px', pane-handle='4', style='{{!root.basicMode ? "display: none" : "display: initial"}}').pane-bottom-p
div(fa-pane, pane-id='control-bottom-tabs', pane-anchor='south', pane-size='30% + 2px', pane-handle='4').pane-bottom-p
.widget-container.fluid-height
nice-tabs(key='ControlBottomTabs', direction='below', tabs='belowTabs', filter='$root.platform')

div(fa-pane, pane-id='control-top-tabs', pane-anchor='' style='{{!$root.basicMode ? "" : "position: relative; height: auto; width: 350px" }}')
.widget-container.fluid-height
nice-tabs(key='ControlBottomTabs', tabs='topTabs', filter='$root.platform')
2 changes: 1 addition & 1 deletion res/app/control-panes/dashboard/dashboard.pug
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
.col-md-6
div(ng-include='"control-panes/dashboard/apps/apps.pug"')
.col-md-6
div(ng-include='"control-panes/advanced/remote-debug/remote-debug.pug"')
div(ng-include='"control-panes/advanced/remote-debug/remote-debug.pug"', style='{{$root.basicMode ? "height: 150px" : "height: auto;" }}')
17 changes: 17 additions & 0 deletions res/app/control-panes/device-control/device-control-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ var _ = require('lodash')
module.exports = function DeviceControlCtrl($scope, DeviceService, GroupService,
$location, $timeout, $window, $rootScope, LogcatService, $route) {

if ($rootScope.basicMode) {
let scrollbarDiv = document.getElementsByClassName('pane-center fill-height ng-scope fa-pane-scroller')[0]
scrollbarDiv.scroll(0, 0)
}

$scope.showScreen = true

$scope.groupTracker = DeviceService.trackGroup($scope)
Expand Down Expand Up @@ -91,11 +96,19 @@ module.exports = function DeviceControlCtrl($scope, DeviceService, GroupService,
$scope.tryToRotate = function(rotation) {
if (rotation === 'portrait') {
$scope.control.rotate(0)
if ($rootScope.basicMode) {
$scope.currentRotation = 'portrait'
return
}
$timeout(function() {
isLandscape() ? $scope.currentRotation = 'landscape' : $scope.currentRotation = 'portrait'
}, 400)
} else if (rotation === 'landscape') {
$scope.control.rotate(90)
if ($rootScope.basicMode) {
$scope.currentRotation = 'landscape'
return
}
$timeout(function() {
isPortrait() ? $scope.currentRotation = 'portrait' : $scope.currentRotation = 'landscape'
}, 400)
Expand All @@ -105,6 +118,10 @@ module.exports = function DeviceControlCtrl($scope, DeviceService, GroupService,
$scope.currentRotation = 'portrait'

$scope.$watch('device.display.rotation', function(newValue) {
if ($rootScope.basicMode) {
return
}

$scope.currentRotation = 'rotating'
if (isPortrait(newValue)) {
$timeout(function() {
Expand Down
4 changes: 2 additions & 2 deletions res/app/control-panes/device-control/device-control.pug
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
.stf-vnc-right-buttons.pull-right
.btn-group
label.btn-sm.btn-primary-outline(type='button', ng-click='tryToRotate("portrait")', ng-hide='device.platform === "tvOS"',
ng-model='currentRotation', uib-btn-radio='"portrait"',
ng-model='currentRotation', uib-btn-radio='"portrait"', id='portrait-label',
uib-tooltip='{{ "Portrait" | translate }} ({{ "Current rotation:" | translate }} {{ device.display.rotation }}°)', tooltip-placement='bottom').pointer
i.fa.fa-mobile
label.btn-sm.btn-primary-outline(type='button', ng-click='tryToRotate("landscape")', ng-hide='device.platform === "tvOS"',
ng-model='currentRotation', uib-btn-radio='"landscape"',
ng-model='currentRotation', uib-btn-radio='"landscape"', id='landscape-label',
uib-tooltip='{{ "Landscape" | translate }} ({{ "Current rotation:" | translate }} {{ device.display.rotation }}°)', tooltip-placement='bottom').pointer
i.fa.fa-mobile.fa-rotate-90
.button-spacer
Expand Down
2 changes: 2 additions & 0 deletions res/app/control-panes/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require('./control-panes.css')

module.exports = angular.module('control-panes', [
require('stf/common-ui/nice-tabs').name,
require('stf/device').name,
Expand Down
4 changes: 2 additions & 2 deletions res/app/control-panes/info/info.pug
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@
div.infocard-table__item {{device.manufacturer}}
div.infocard-table__row
div.infocard-table__item(translate) Product
div.infocard-table__item {{device.name ? device.name : '-'}}
div.infocard-table__item {{device.enhancedName}}
div.infocard-table__row
div.infocard-table__item(translate) Model
div.infocard-table__item {{device.model}}
div.infocard-table__item {{device.enhancedName}}
div.infocard-table__row
div.infocard-table__item(translate) Serial
div.infocard-table__item {{device.serial}}
Expand Down
4 changes: 2 additions & 2 deletions res/app/device-list/column/device-column-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ module.exports = function DeviceColumnService($filter, gettext, SettingsService,
, model: DeviceModelCell({
title: gettext('Model')
, value: function(device) {
return device.name || device.model || device.serial
return device.enhancedName
}
})
, name: DeviceNameCell({
title: gettext('Product')
, value: function(device) {
return device.name || device.model || device.serial
return device.enhancedName
}
}, AppState.user.email)
, platform: TextCell({
Expand Down
8 changes: 7 additions & 1 deletion res/app/device-list/details/device-list-details-directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -825,18 +825,24 @@ module.exports = function DeviceListDetailsDirective(
});

document.addEventListener('DOMContentLoaded', function() {
if ($rootScope.basicMode) {
scrollbarDiv.scroll(0, 0)
}
if (storedScrollPosition) {
scrollbarDiv.scroll(0, parseInt(storedScrollPosition))
}
})

window.addEventListener('load', function() {
if ($rootScope.basicMode) {
scrollbarDiv.scroll(0, 0)
}
if (storedScrollPosition) {
scrollbarDiv.scroll(0, parseInt(storedScrollPosition))
}
})

if (storedScrollPosition) {
if (storedScrollPosition && !$rootScope.basicMode) {
scrollbarDiv.scroll(0, parseInt(storedScrollPosition))
}
}
Expand Down
2 changes: 1 addition & 1 deletion res/app/device-list/device-list.pug
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.stf-device-list
.row.stf-stats-container.unselectable
.row.stf-stats-container.unselectable(style='{{$root.basicMode ? "margin: 5px 0 0 0;" : "margin: 0;" }}')
.col-md-12
device-list-stats(tracker='tracker')

Expand Down
2 changes: 1 addition & 1 deletion res/app/device-list/stats/device-list-stats.css
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@

.device-stats [class^="col-"] .text,
.device-stats [class*="col-"] .text {
font-size: 0.8em;
font-size: 0.6em;
font-weight: 500;
}
}
Loading