Using Karate - geckodriver (Firefox) I need to run it in specific browser window size. According to documentation I have tried (JS configuration file):
karate.configure('driver', { type: 'geckodriver', executable: 'geckodriver', start: false, port: 4444, addOptions: ['windows-size=320,200'] });
or
karate.configure('driver', { type: 'geckodriver', executable: 'geckodriver', start: false, port: 4444, addOptions: ['--windows-size=320,200'] });
No error raised, but window size is not 320,200.
Probably there will be some small change in configuration needed.
Thank you for help.
To set the window size, use driver.dimensions any time after the driver has been initialized:
* driver.dimensions = { x: 0, y: 0, width: 300, height: 800 }
If needed, you can do * driver 'about:blank' before this if you want to start your flow with the browser in a certain size.
If you really mean the display resolution, that is a harder problem. We have a way to do it for the Chrome Docker container by exporting KARATE_WIDTH and KARATE_HEIGHT environment variables. If we get some community help we can do it for FireFox sooner, also based on a Docker container, or you may be able to create one yourself.
Related
Is it possible to clear the current watermark in a DataStream?
Example input for a month-long watermark with no allowed lateness:
[
{ timestamp: '10/2018' },
{ timestamp: '11/2018' },
{ timestamp: '11/2018', clearState: true },
{ timestamp: '9/2018' }
]
Normally, the '9/2018' record would be thrown out as it is late. Is there a way to programmatically reset the watermark state when the clearState message is seen?
Watermarks are not supposed to go backwards -- it's undefined what will happen, and in practice it's a bad idea. There are, however, various ways to accommodate late data.
If you are using the window API, Flink will clear any window state once the allowed lateness has expired for a window. If you want more control than this, consider using a ProcessFunction, which will allow/require you to manage state (and timers) explicitly.
I am using this code to show the AudioRecorder on the Apple Watch (taken from https://www.raywenderlich.com/345-audio-recording-in-watchos-tutorial)
let outputURL = chatMasterController.newOutputURL()
let preset = WKAudioRecorderPreset.narrowBandSpeech
let options: [String : Any] =
[WKAudioRecorderControllerOptionsMaximumDurationKey: 30]
presentAudioRecorderController(
withOutputURL: outputURL,
preset: preset,
options: options) {
[weak self] (didSave: Bool, error: Error?) in
guard didSave else { return }
print("finished audio to \(chatID) at \(outputURL)")
print(outputURL)
}
The Recorder pops up however it doesn't seem to take any input. The wave forms don't rise while speaking and trying to play the recording afterwards leaves me with 0.2seconds of silence no matter how long the recording is.
I've tried another app that's making use of the microphone and this app did ask me for permission to record audio. I have feared having dismissed the permission before so I have reinstalled my app which however didn't change anything - no permission being asked, no input being generated.
Is there something I've missed e.g. importing a lib?
I've now figured it out. You don't just need the Privacy - Microphone Usage Description string in your Watch app's plist - you also need to set it in the iPhone's plist.
Only setting it on the Watch does nothing, only setting it on the iPhone doesn't let you allow it on the Watch directly. So you need it on both.
No idea why this isn't documented anywhere but it fits Apple's "we are going downhill" movement :)
I am running a simple WebDriverIO script, and inserting any amount of async behaviour is making it time out at the 10 sec threshold (or before?). I want to control the timeout setting, but no matter what I try I cannot increase it.
As I am using ChromeDriver, not all Selenium settings are applicable, and setting browser.timeouts('implicit', 30000) (or script or pageLoad) will throw an error: unknown error: unknown type of timeout:pageLoad.
The only other timeouts I have found are
mochaOpts.timeout
waitforTimeout
This is my test:
it.only('should be able to register', ()=>{
// Mocha timeout
this.timeout(50000)
browser.url('/encounter/new');
browser.waitUntil( function() {
return browser.isExisting('[name=lastName]');
});
browser.setValue('#problem', 'something fishy');
// this is problematic: comment this out and everything works
// also works with very small timeouts
browser.executeAsync(function(done){
setTimeout(done, 1000);
});
browser.click('#appdetailsheader button');
console.log(browser.getUrl(), browser.log('browser'))
browser.waitUntil( function() {
return !browser.isExisting('[name=lastName]');
});
console.log(browser.getTitle(), browser.getUrl());
console.log(browser.log('browser'))
});
I can totally understand you frustration. WebdriverIO is extremely modular & configurable, but this comes with an increased level of complexity which often leads to confusion.
For this:
// Mocha timeout
this.timeout(50000);
!!! This has no effect because you are configuring/setting your Mocha timeout in an arrow function which is discouraged by Mocha. Read more about it here.
Solution (pick as applicable to your setup):
run your script with WebdriverIO test-runner and set mochaOpts: { timeout: <desiredTimeout>}, or you can even override it from your test run: wdio wdio.config.js --mochaOpts.timeout=<desiredTimeout>;
set your timeout in your root describe statement, or even better, in a before hook: before(function() { this.timeout(<desiredTimeout>); (...)});;
if you're running your test case using Mocha, pass the timeout either into your CLI command (if you're using it to run your tests): mocha yourTestFile.js --timeout <desiredTimeout>, or change it's value in your mocha.opts file;
Note: I'm sure there are even more ways to do this, but these are a few that worked for me.
For this:
browser.waitUntil( function() {
return browser.isExisting('[name=lastName]');
});
!!! This will always wait for the existence of the element with attribute name="lastName" for the default 1000 ms before timing out. This value can be changed via waitforTimeout.
Solution (pick as applicable to your setup):
explicitly give your waitUntil.../waitfor... commands the timeout: browser.waitUntil( function() { return browser.isExisting('[name=lastName]');}, <desiredTimeout>, <errorMessage>);;
run your script with WebdriverIO test-runner and set waitforTimeout: <desiredTimeout>, or you can even override it from your test run: wdio wdio.config.js --waitforTimeout=<desiredTimeout>;
Finally, I tried to run a few test cases with obscene timeout values (50000 ms) and it worked as expected for every one of the issues you mentioned above.
waitforTimeout example:
Logs (1 failing (57s)):
[chrome #0-0] ConnectWeb Devices Content Test Suite
[chrome #0-0] 1) "before all" hook
[chrome #0-0]
[chrome #0-0]
[chrome #0-0] 1 failing (57s)
[chrome #0-0]
[chrome #0-0] 1) ConnectWeb Devices Content Test Suite "before all" hook:
[chrome #0-0] Oups! An error occured.
Timed out waiting for element ('span[connectqa-device="events"]') to exist
Note: I've never used Selenium timeouts in WebdriverIO before (implicit, pageLoad, script), but I never had this necessity before as waitforTimeout & Mocha's timeout have been more than effective for my testing scenarios.
Small mention: This statement inserting any amount of async behaviour is making it time out at the 10 sec threshold is not true. First off, WDIO is completely asynchronous. You might be using the sync: true flag, but behind the scenes, everything is still async.
This is a vast topic and I tried to cover as much as possible given the information at hand. Sorry if I didn't completely answer your question. Tell me in the comments and I'll try to update the answer with the relevant info.
Hope it helps. Cheers!
Just started playing with A-Frame and I can see vive-controls and oculus-touch-controls but nothing for google daydream.
I've looked at the component repo and don't see anything that looks like it'll do the job. The closest thing to now investigate would be the Gamepad API, but I'm amazed I can't find anything.
I've got a Pixel XL & daydream and would like to incorporate the controller rather than just head tracking and gaze based control. Can someone point me in the right direction please.
Thanks
UPDATE - I've got the Daydream controller working for clicks! Running the 360-image-gallery(https://aframe.io/examples/showcase/360-image-gallery/) accepts clicks from the Daydream controller. I guess maybe it had timed out on my previous attempts or I hadn't paired it properly! I'll keep playing!
Working on setting up a Daydream remote in an Aframe project. There are no components for the daydream remote yet, but I'm hoping to complete one soon – and it sounds like they are gonna mainline support in an upcoming Aframe release.
But you can hand roll support no problem.
First, there are a few things you'll need to do in preparation:
Download Chrome Beta 56 on your Pixel:https://www.google.com/chrome/browser/beta.html
.
Open Chrome Beta, navigate to chrome://flags and enable the WebVR and Gamepad flags.
Now, you will be able to launch experiences that are built with Aframe v0.4 or higher in true WebVR. You'll get prompted with the usual Daydream screens (place your phone in the headset, and connect the remote.) If you are connecting to a local development environment, you'll see a secure connection warning but this, while annoying, won't stop you from working.
Second, now that you are running true WebVR, you need to leverage the Gamepad API to get information from your daydream remote. Lets start by just logging that it is connected.
window.addEventListener('gamepadconnected', function(evt) {
console.log("Gamepad connected at index %d: %s. %d buttons, %d axes.",
e.gamepad.index, e.gamepad.id,
e.gamepad.buttons.length, e.gamepad.axes.length);
});
Third, now that you are logging a connection, you will need to setup an update loop to get the current state of the Gamepad. You can do this with requestAnimationFrame. Follow the tutorial here: https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API/Using_the_Gamepad_API
Once I've published a basic dayframe-remote component, I'll post a link here. Hope this helps get you started!
EDIT: Looks like the suggestion below works great. Just pass "Daydream Controller" as the id for tracked controls: tracked-controls="id: Daydream Controller".
Here is a sample Daydream controller output. At the moment, only the trackpad button appears to be exposed – not the app or home buttons.
{
axes: [0, 1],
buttons: [{
pressed: false,
touched: false,
value: 0
}],
connected: true,
displayId: 16,
hand: "left",
id: "Daydream Controller",
index: 0,
mapping: "",
pose: {
angularAcceleration: null,
angularVelocity: [0, 0, 0],
hasOrientation: true,
hasPosition: false,
linearAcceleration: [0,0,0],
orientation: [0,0,0,1],
position: null
},
timestamp: 1234567890123
}
Something for you to try...
the way the current A-Frame 0.4.0 support in tracked-controls should work:
if you specify that it should only match an ID value of empty string '' then it should match any gamepad with a pose... so you can try something like
<a-entity tracked-controls="id:"></a-entity>
and see if that gets events etc.?
A-Frame master branch now contains a daydream controller component: https://aframe.io/docs/master/components/daydream-controls.html
I would like to have some apps (which I open when starting my session) always in the same order in the task bar. Is that possible?
Vim | Chrome | Terminal
Another question: for now, when I open an app, it is opened on the left part of the task bar, is there a way to open it rather on the right side, after the already open apps?
I have this lines in rc.lua:
-- Add widgets to the wibox - order matters
mywibox[s].widgets = {
{
mylauncher,
mytaglist[s],
mypromptbox[s],
layout = awful.widget.layout.horizontal.leftright
},
mylayoutbox[s],
mytextclock,
s == 1 and mysystray or nil,
mytasklist[s],
layout = awful.widget.layout.horizontal.rightleft
}
Javi
To place new windows to the end of the list (make them slave) you can add rule to the rc.lua file
{ rule = { }, properties = { }, callback = awful.client.setslave }
To autostart apps use
awful.util.spawn_with_shell("App1 -with -keys")
awful.util.spawn_with_shell("App2 -with -keys")
They will run in this order I believe. And make sure that you added awful in the rc.lua. You can do it by function require("awful")
Take a look at the FAQ
P.S. Sorry, I'm not sure do I understand you right.