I'm building a React app and I'm testing it with Cypress and React Testing library.
I was wondering: How can I test the app "on mobile". Meaning how can I write tests for the app that run if the window size is below the breakpoint? I couldn't find anything about that in the respective packages documentation.
You may need to check this page - https://docs.cypress.io/api/commands/viewport.html
You can control the size and orientation of the screen for your application. There are also preset dimensions available already for various devices,
Preset width height
macbook-15 1440 900
macbook-13 1280 800
macbook-11 1366 768
ipad-2 768 1024
ipad-mini 768 1024
iphone-6+ 414 736
iphone-6 375 667
iphone-5 320 568
iphone-4 320 480
iphone-3 320 480
Just need to pass cy.viewport('iphone-6') which will set the viewport to 375px x 667px. Hope this helps.
Related
We are running a WPF app and have CefSharp control embedded inside it.
The app works fine in most the machines but takes about 30-40 seconds to load in on a specific customer's VM.
We already tried:
CefSharp argument no-proxy-server set to 1
The Minimal CefSharp example loads up quickly (3-4 seconds).
Upgraded the Intel graphics driver
Enabled the CefSharp logs, but couldn't guess much from it. Here's the debug.log from a run which took > 40 seconds to show up:
[0512/090835.087:VERBOSE1:pref_proxy_config_tracker_impl.cc(186)] 3FE40680: set chrome proxy config service to 3FD043C0
[0512/090835.115:VERBOSE1:webrtc_internals.cc(118)] Could not get the download directory.
[0512/090835.116:VERBOSE1:media_stream_manager.cc(705)] MSM::InitializeMaybeAsync([this=3FD15080])
[0512/090835.117:VERBOSE1:media_stream_manager.cc(705)] MDM::MediaDevicesManager()
[0512/090835.117:VERBOSE1:media_stream_manager.cc(705)] MSM::MediaStreamManager([this=3FD15080]))
[0512/090835.739:VERBOSE1:pref_proxy_config_tracker_impl.cc(186)] 3FE41EE0: set chrome proxy config service to 3FD040F0
[0512/090840.931:VERBOSE1:video_capture_oracle.cc(96)] Capture size auto-throttling is now enabled.
[0512/090840.932:VERBOSE1:video_capture_oracle.cc(124)] Capture size auto-throttling is now disabled.
[0512/090840.933:VERBOSE1:capture_resolution_chooser.cc(205)] Recomputed snapped frame sizes: 1928x1013
[0512/090840.933:VERBOSE1:capture_resolution_chooser.cc(157)] Recomputed capture size from 640x360 to 1928x1013 (100% of ideal size)
[0512/090854.178:INFO:cpu_info.cc(53)] Available number of cores: 8
[0512/090854.221:VERBOSE1:media_stream_manager.cc(705)] RFAOSF::Core() [process_id=4, frame_id=1]
[0512/090854.222:VERBOSE1:document.cc(3712)] Document::DispatchUnloadEvents() URL = <null>
[0512/090854.222:VERBOSE1:document.cc(3792)] Actually dispatching an UnloadEvent: URL = <null>
[0512/090854.231:VERBOSE1:media_stream_manager.cc(705)] RFAOSF::Core() [process_id=4, frame_id=1]
[0512/090854.248:VERBOSE1:script_context.cc(189)] Created context:
extension id: (none)
frame: 54CA2018
URL:
context_type: WEB_PAGE
effective extension id: (none)
effective context type: WEB_PAGE
[0512/090854.249:VERBOSE1:script_context.cc(189)] Created context:
extension id: (none)
frame: 00000000
URL:
context_type: UNSPECIFIED
effective extension id: (none)
effective context type: UNSPECIFIED
[0512/090854.249:VERBOSE1:dispatcher.cc(434)] Num tracked contexts: 1
[0512/090854.682:VERBOSE1:capture_resolution_chooser.cc(205)] Recomputed snapped frame sizes: 1928x1013
[0512/090854.769:VERBOSE1:layout_shift_tracker.cc(365)] in "local://formdisplay.html/", 57020540:LayoutNGBlockFlow (positioned) ::before moved from "-555.25,0 723.438x4" to "-326.25,0 816.797x4" (visible from "0,0 168x4" to "0,0 491x4")
[0512/090854.770:VERBOSE1:layout_shift_tracker.cc(547)] in "local://formdisplay.html/", viewport was 0.10056% impacted with distance fraction 0.118776 and subframe weighting factor 1
[0512/090854.770:VERBOSE1:layout_shift_tracker.cc(626)] in "local://formdisplay.html/", layout shift of 0.000119441 reported; cumulative score is 0.000119441
[0512/090854.897:VERBOSE1:layout_shift_tracker.cc(365)] in "local://formdisplay.html/", 57020540:LayoutNGBlockFlow (positioned) ::before moved from "-325.516,0 816.797x4" to "-59.5156,0 925.453x4" (visible from "0,0 491x4" to "0,0 866x4")
[0512/090854.898:VERBOSE1:layout_shift_tracker.cc(547)] in "local://formdisplay.html/", viewport was 0.177362% impacted with distance fraction 0.137967 and subframe weighting factor 1
[0512/090854.898:VERBOSE1:layout_shift_tracker.cc(626)] in "local://formdisplay.html/", layout shift of 0.000244701 reported; cumulative score is 0.000364142
[0512/090854.901:VERBOSE1:layout_shift_tracker.cc(365)] in "local://formdisplay.html/", 57020540:LayoutNGBlockFlow (positioned) ::before moved from "-60.0469,0 925.453x4" to "-9.04688,0 946.047x4" (visible from "0,0 865x4" to "0,0 937x4")
[0512/090854.902:VERBOSE1:layout_shift_tracker.cc(547)] in "local://formdisplay.html/", viewport was 0.191904% impacted with distance fraction 0.0264523 and subframe weighting factor 1
[0512/090854.902:VERBOSE1:layout_shift_tracker.cc(626)] in "local://formdisplay.html/", layout shift of 5.07629e-05 reported; cumulative score is 0.000414905
[0512/090854.923:VERBOSE1:layout_shift_tracker.cc(365)] in "local://formdisplay.html/", 57020F00:LayoutNGBlockFlow (relative positioned) DIV id='e85pk6q' class='form-group has-feedback formio-component formio-component-button formio-component-submit' moved from "35,114 1858x34" to "35,118 1858x38" (visible from "35,114 1858x34" to "35,118 1858x38")
[0512/090854.924:VERBOSE1:layout_shift_tracker.cc(365)] in "local://formdisplay.html/", 5703C2C0:LayoutNGButton BUTTON class='btn btn-primary btn-md' moved from "35,114 69.5781x34" to "35,118 69.5781x38" (visible from "35,114 70x34" to "35,118 70x38")
[0512/090854.924:VERBOSE1:layout_shift_tracker.cc(547)] in "local://formdisplay.html/", viewport was 3.99557% impacted with distance fraction 0.00207469 and subframe weighting factor 1
[0512/090854.924:VERBOSE1:layout_shift_tracker.cc(626)] in "local://formdisplay.html/", layout shift of 8.28956e-05 reported; cumulative score is 0.000497801
[0512/090901.150:VERBOSE1:statistics_recorder.cc(471)] Collections of all histograms
I have some SVG graphics that I would like to apply conditional styling on (e.g. linearGradient when it's active). How would I go about achieving this? I'd rather not (if there's another way) have to go in a manually add a defs tag with linearGradients in there, and I've seen stuff about using an externals defs file to access the fill I want (so I can specify either a solid color or gradient depending on state). I'm not sure how to ask, or where to look.
An example:
An SVG file:
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 26">
<path d="M20.94 9.56c.74 0 1.35.62 1.35 1.38v1.84c0 3.79-2.48 7.85-6.44 8.81v1.36A3.02 3.02 0 0 1 12.88 26a3.02 3.02 0 0 1-2.97-3.05v-1.34c-3.36-.83-6.2-5.05-6.2-8.83v-1.84c0-.76.6-1.38 1.35-1.38.74 0 1.34.62 1.34 1.38v1.84a6.7 6.7 0 0 0 6.6 6.79 6.7 6.7 0 0 0 6.6-6.79v-1.84c0-.76.6-1.38 1.34-1.38ZM13.08 0c2.77 0 5 2.28 5 5.09v7.44c0 2.8-2.23 5.08-5 5.08-2.76 0-5-2.28-5-5.08V5.09a5.05 5.05 0 0 1 5-5.09Z" fill-rule="evenodd"/>
</svg>
Now - I have a LOT of these, so I was hoping I could link the gradient from an external source, or use some other way to just slap a linear gradient on top of them. Is there such a way? What would be the best way to add gradients to 100+ icons without having to go in and edit each one of them? Is there a bulk editor somewhere that I don't know about?
I am using Vespa in a docker with one single content node on a Ubuntu server. The total storage is:
[root#vespa-container /]# df -h .
Filesystem Size Used Avail Use% Mounted on
overlay 485G 118G 343G 26% /
Apparently, 26% is far less than the default 80% (0.8) limit ratio in the Vespa setting. But I still got a NO_SPACE error:
ReturnCode(NO_SPACE, External feed is blocked due to resource exhaustion: memory on node 0 [vespa-container] (0.802 > 0.800))
How can I fix this? Thanks!
In this case you are limited by memory:
memory on node 0 [vespa-container] (0.802 > 0.800))
The camera animation always starts from the initial camera pose.
We do not want this behaviour.
You can check this issue with:
https://app.3d.io/default_setup.
This code worked before. We didn't change anything.
<a-entity camera="" tour="autoStart: false" wasd-controls="" look-controls="" position="-2.073 1.6 -1.474" rotation="-2.063 203.308 0">
<a-entity tour-waypoint="Top View" io3d-uuid="add7b140-7563-463a-b324-75e2b460e915" position="-7.959815433483447 22.172638840745442 1.675735956699384" rotation="-89.9 450 0"></a-entity>
<a-entity tour-waypoint="Living" io3d-uuid="486a6760-e8d1-456d-a2d0-5358d65b2ef1" position="1.1168750348397785 1.037108274040117 1.7797448740972899" rotation="0 412.98472385428914 0"></a-entity>
<a-entity tour-waypoint="Kitchen" io3d-uuid="4a0f17c1-fcde-4706-9188-48ddeb808927" position="-0.4316313757947364 1.37 0.10205065263211961" rotation="0 491.46180963572306 0"></a-entity>
<a-entity tour-waypoint="Dining" io3d-uuid="5d76c74b-a2b5-4ddf-a6e9-a6fe009377b7" position="-1.0699430785395438 8 -3.5236261145326577" rotation="-38.48648648648648 539.873168157716 0"></a-entity>
<a-entity tour-waypoint="Bedroom" io3d-uuid="4d6fec29-1467-40be-8f91-5435f0317072" position="-9.650512503727434 8 2.1338268605968826" rotation="-59.152761457109314 594.7591069330199 0"></a-entity>
<a-entity tour-waypoint="Bedroom" io3d-uuid="3851ec4b-53c0-47d4-afc2-3d646043eb5d" position="-9.639031885443684 8 5.539305773258945" rotation="-56.77438307873098 400.8960173400832 0"></a-entity>
<a-entity tour-waypoint="Master Bedroom" io3d-uuid="97eabbe1-578a-48ee-a40f-60af0187f2b1" position="-13.334875006116892 8 -1.701906768812833" rotation="-59.08108108108104 494.6322427235562 0"></a-entity>
<a-entity tour-waypoint="Top View" io3d-uuid="fe33bb66-b1fe-4d13-9904-2e98fc05a525" position="-7.959815433483447 22.172638840745442 1.675735956699384" rotation="-89.9 450 0"></a-entity>
</a-entity>
This code doesn't work as desired either. The camera still kept same position.
document.querySelector('[camera]').components['tour'].updateViewPoint({position:{y:1.6}, rotation:{x:0}})
It turns out that there was a somewhat breaking change in aframe-animation-component moving to version 4.x.x and if you find yourself using the following way of including that component:
<script src="https://unpkg.com/aframe-animation-component/dist/aframe-animation-component.min.js"></script>
you wanna change it for this line:
<script src="https://unpkg.com/aframe-animation-component#3.2.5/dist/aframe-animation-component.min.js"></script>
The tour animation will always tween from the current camera position to the next tour point.
So what you want to do is set your camera to the starting position either in aframe source code or programmatically:
<a-entity camera position="x y z"></a-entity>
Or via JavaScript:
document.querySelector('[camera]').setAttribute('position', 'x y z');
Then you can set the next waypoint programmatically:
document.querySelector('[camera]').components['tour'].goTo(waypointUuid)
Or you can start the tour:
document.querySelector('[camera]').components['tour'].playTour()
If this does not work for you please describe your desired outcome and share your code with glitch or app creator.
I am using app.yaml file to configure my app engine flexible. The file looks like the following,
runtime: java
env: flex
service: hello-service
health_check:
enable_health_check: True
check_interval_sec: 10
timeout_sec: 4
unhealthy_threshold: 2
healthy_threshold: 2
automatic_scaling:
min_num_instances: 3
max_num_instances: 10
cool_down_period_sec: 120 # default value
cpu_utilization:
target_utilization: 0.5
However, when I click the "view" link for the version list in the cloud console, I only can see the following in the popup,
runtime: java
env: flexible
threadsafe: true
automatic_scaling:
min_num_instances: 3
max_num_instances: 10
health_check:
enable_health_check: true
check_interval_sec: 10
timeout_sec: 4
unhealthy_threshold: 2
healthy_threshold: 2
As you can see, it is missing few "automatic_scaling" properties. I am not sure why. Do I need to stop and start the relevant version to see the changes?
It is most likely that the config values matching the default values are not displayed.
From the documentation the default values for the missing parameters:
cool_down_period_sec
The number of seconds that the autoscaler should wait before it
starts collecting information from a new instance. This prevents the
autoscaler from collecting information when the instance is
initializing, during which the collected usage would not be reliable.
The cool-down period must be greater than or equal to 60 seconds.
The default is 120 seconds.
target_utilization
Target CPU utilization (default 0.5). CPU use is averaged across
all running instances and is used to decide when to reduce or increase
the number of instances.
The cpu_utilization is likely not displayed because target_utilization (the only item under it) dissapeared.
It should be easy to check - just change the values for the missing configs slightly, re-deploy and see if the updated values are remebered or not.