How to Perform rightClick on an element using WebDriverIO? - webdriver-io

I tried Keys and rightClick() option.
Was getting ReferenceError: Key is not defined error with await browser.keys([Key.shift,'F10'])
and, seeing error TypeError: elem[prop] is not a function with ** await this.pivotItem.rightClick()**
Can someone help ?

to perform right click, use await elementLocator.click({ button: 'right' })
you can also pass the number for key like [0, "left", 1, "middle", 2, "right"]
Here you can find the link for more details:
https://webdriver.io/docs/api/element/click/

Related

Upgrading from slot-scope to v-slot breaks without errors

I'm trying to upgrade from the old slot-scope syntax to the relatively new v-slot syntax but it doesn't seem to work.
Steps to reproduce the behavior:
Go to the Form.vue file in this codesandbox
To see it working using the old slot-scope syntax, just let the app compile and use the login form (enter some text in both the fields)
Uncomment lines 5, 18, 23, and 36 and comment lines 6, 19, 24, and 37
Use the login form again. The inputs disappear as soon as you start typing.
What am I doing wrong?
your render function in FormGroup.vue returns more than one VNode. Try that:
render(createElement) {
return createElement(
"div",
this.$scopedSlots.default({
errors: this.errors,
invalid: this.invalid,
})
);
}

GoodData charts components throwing error of TypeError: item.predicate is not a function on setting color from configuration

On setting colors from configuration and using Gooddata UI Charts component it is throwing following error
TypeError: item.predicate is not a function
My config is as follows, On reseting default color it is working fine but as change color i get the colorMapping object in the api and after applying this config throwing the error.
How can i resolve it, Please help me out.
config={{
colorMapping: [{
color: { type: "guid", value: "17" },
id:"0d447449c2844b228923c37de7b6aaf9"
}]
}}
usage of ColorMapping is described in documentation
https://sdk.gooddata.com/gooddata-ui/docs/chart_config.html#Color-mapping
You need to define predicate function which when returning true, will apply corresponding color (https://sdk.gooddata.com/gooddata-ui/docs/ht_create_predicates.html).
In your case localId predicate seems to be right for you
https://github.com/gooddata/gooddata-ui-sdk/blob/master/libs/sdk-ui/src/base/headerMatching/HeaderPredicateFactory.ts#L264
In case you are using older version of Gooddata UI.SDK than v8, you need to implement predicate by your own. Something like this (or equivalent for measures).
predicate: headerItem =>
headerItem.attributeHeaderItem &&
headerItem.attributeHeaderItem.localIdentifier === "0d447449c2844b228923c37de7b6aaf9", // find attribute item by localIdentifier
You can switch the official documentation to whathever version of Gooddata UI.SDK lib you are using and read the same article about ColorMapping
https://sdk.gooddata.com/gooddata-ui/docs/7.9.0/chart_config.html#color-mapping

Problem using Filters and Sprites in a StageGL context

First of all, sory my English.
I am working with some sprites using WebGL on CreateJS library. I need apply a custom color filter over the jpg used to create the spritsheet.
Here is my code:
let bmp = new createjs.Bitmap(rscTexture);
bmp.filters = [new createjs.AlphaFilter()];
bmp.cache(0, 0, rscTexture.width, rscTexture.height, {1, useGL:"stage"});
let frames = this.generateFrames();
this.sprite = new createjs.Sprite( new createjs.SpriteSheet({
framerate: 24,
"images": [bmp.cacheCanvas],
"frames": frames,
"animations": {
"run": [0, frames.length - 1],
}
}));
The problem is that this trow next error:
ERROR Cannot use 'stage' for cache because the object's parent stage
is not set, please addChild to the correct stage.
How can I add the element to the stage first, if I still do not create it?
If you have a StageGL instance that already exists, you can pass it in directly instead. The "stage" shortcut attempts to figure it out; however, sometimes you need to be specific and directly passing the reference is the only solution.
bmp.cache(0, 0, rscTexture.width, rscTexture.height, 1, { useGL: myStage });
The specific and full documentation can be found here:
https://createjs.com/docs/easeljs/classes/BitmapCache.html#method_define

casperjs click on the second match selector

there are some button share the same id or class that casperjs cant classify, i want to click on the second or N selector match, i can do it with:
document.querySelectorAll('[id="something"]').click();
but i have to do it with the following basic format:
casper.then(function (){
this.click(id="something");
});
or. is there anyway i can make the following statement work?
var clickthis= '[id="something"]';
document.querySelectorAll(clickthis).click();
the var clickthis is working in casper.click,
but cant work in document.querySelector
thanks!
Try this way:
casper.evaluate(function(sel) {
document.querySelectorAll(sel)[1].click();
}, '[id="something"]');
To click on a second element, you can use:
function click(sel,n){var event=document.createEvent('MouseEvents');
event.initMouseEvent('click',1,1,window,1,0,0,0,0,0,0,0,0,0,null);
document.querySelectorAll(sel)[n].dispatchEvent(event);}
var casper = require('casper').create();
casper.start('http://domu-test-2/',function(){
this.evaluate(function(click){
click('li.node-readmore a',1);// click on a second element of the array.
},click);
})
.wait(3000,function(){this.capture('test.png');})
.run();

YouTube API: Uncaught SyntaxError: missing ) after argument list

I'm using the YouTube API and I keep getting
"Uncaught SyntaxError: missing ) after argument list" for the second line of code here:
$(".addVideoUrlBtn").on("click", function(){
player.loadVideoByUrl(mediaContentUrl: videoUrl,
startSeconds:0,
suggestedQuality:"large"):Void
})
The code is practically copied and pasted from YouTube api docs here: https://developers.google.com/youtube/iframe_api_reference so I'm not sure why I'm getting an error.
you're taking the docs too literally. The examples shown are a) not valid js (because they aren't supposed to be) b) showing the TYPES of expected argument
when they say
player.cueVideoById(videoId:String,
startSeconds:Number,
suggestedQuality:String):Void
they mean that the function player.cueVideoById takes arguments videoId, startSeconds, and suggestedQuality which are a String, Number, and String respectively and that its return type is Void (nothing)
$(".addVideoUrlBtn").on("click", function(){
player.loadVideoByUrl(url, 0, "large")
})
is that you want