Protractor right click open in a new tab wrong menu proposed - protractor

I have a problem when I do the test of a right click with Protractor.
The element where I right click is a link ''
However when the test is run in chromeDriver the tab that appears is not a tab that offers the possibility of opening in a new tab.
It should rather be this
In protractor I use the following code:
let link = element(by.css('.ag-body-container div[colid="test"] a'));
await browser.actions().mouseMove(link).perform();
await browser.actions().click(protractor.Button.RIGHT).perform();
await browser.actions().mouseMove(link).keyDown(protractor.Key.CONTROL).click().perform();
await browser.actions().mouseMove(link).keyDown(protractor.Key.CONTROL).click().keyUp(protractor.Key.CONTROL).perform();
If you have a solution to this problem
I know that this problem has already been posed but without solution provided
No right click - open in new tab

I assume you have a Single Page App or some similar setup and you are executing the nav clicks with javascript, but you want them to also behave like links.
If so, wrap your navigation item in an a tag linking to the link, and prevent executing the link on left click with js
function navClick(event){
alert("click action");
return false;
}
<button>Link</button>
Hope this helps!

Related

How to detect if side menu is open/closed in ionic 2?

I am using cordova-google-maps plugin with my ionic 2 app, and I want to show the menu (sidenav) on that page. Problem is for the sidenav to receive events properly I need to call map.setClickable( false ) while opening the sidenav and set it back to true when the user closes the sidenav. It seems there is an event for checking while the menu is being opened with opening, but I don't know how to track when the user closes the menu.
For using ionDrag, ionOpen, ionClose in Ionic2 you must add it on the menu itself
for example modify menu in your app.html file by
<ion-menu [content]="content" (ionOpen)="menuOpened()" (ionClose)="menuClosed()">
After I use "Events" see doc here: http://ionicframework.com/docs/v2/api/util/Events/
For detect in my page if the menu was close or open.
Example in my app.ts
menuClosed() {
this.events.publish('menu:closed', '');
}
menuOpened() {
this.events.publish('menu:opened', '');
}
And in my other page
events.subscribe('menu:opened', () => {
// your action here
});
events.subscribe('menu:closed', () => {
// your action here
});
I hope this help
It seems new events have been added to the menu component which solves this problem. I am also using the google maps plugin and it works fine
http://ionicframework.com/docs/v2/api/components/menu/Menu/
ionDrag
When the menu is being dragged open.
ionOpen
When the menu has been opened.
ionClose
When the menu has been closed.
Using these output events, in your handlers you can keep a flag for the menu if its open or not :)

How to Create Tabgroup on smartface app studio

I have tried to create a tab-view or tab-group like control on smartface.io but I can't find any solution on the website.
Please any one have idea on how to create tab group. I can't find any tab-view on their the view pallet of IDE. thanks
You can use textbuttons, place them at the top of the page, use as many as you need. And place container objects under these buttons. When you press a button, make the related container's visibility true and other's false. For example, when pressed button1, let
cont1.visible = true;
cont2.visible = false;
cont3.visible = false;
and so on.
Also you should check Smartface in Action project. You can find project in Welcome page, for example in pgListView.

Enable browser action for an event in Google chrome

I am writing a chrome extension for capturing the URL. This is the code for my js file.
chrome.tabs.getSelected(null, function(tab) {
myFunction(tab.url);
});
function myFunction(tablink) {
alert(tablink);
}
Now i can get the URL alert for the page by explicitly clicking on the browser action. I need it to popup the alert whenever i click on any tab in my browser.
Could you please let me know how to proceed with this?
PS: I am sure i have to use some kind of event listener.
chrome.tabs.getSelected is deprecated since Chrome 33. Use chrome.tabs.query instead if needed.
Base on your need to make popup the alert whenever you click on any tab in your browser. You can use chrome.tabs.onActivated.addListener.
The code I created is as below and it works with me. It popup the alert of current page's url whenever you click on any tab in your browser.
chrome.tabs.onActivated.addListener(function(activeInfo) {
//alert("popup");
chrome.tabs.get(activeInfo.tabId, function(tab){
alert(tab.url);
});
});
Also keep in mind to add "permissions": ["tabs"], in your manifest file since it requires access to the url. See here:https://developer.chrome.com/extensions/tabs

How to open an external web page from a Wicket modal dialog

I have a modal dialog in Wicket that contains a link. I need to open an external web page (for example, http://www.google.com) by clicking on the link. The target of the link is set dynamically. How can I do this?
I think that my question hasn't been so clear(I apologize for that). I need to open Web page from modal dialog. Actually, I can explain the problem in the example of modal dialog that #Don Roby has proposed me (wicketstuff.org/wicket14/ajax/modal-window.0). If we click the "Show modal dialog with a page" link in the example, there will be shown the modal dialog with another link called "Open another modal dialog". By clicking on that link, I want to open Web page (for example: www.google.com). My question is: how to open a Web page in this situation?
You can use a PageCreator (instead of setContent()), and return a RedirectPage:
ModalWindow modal = new ModalWindow("modal");
modal.setPageCreator(new ModalWindow.PageCreator() {
#Override
public Page createPage() {
return new RedirectPage("http://www.google.com");
}
});
add(modal);
I understand what you mean.
I have found the solution here :
http://apache-wicket.1842946.n4.nabble.com/How-to-redirect-from-a-ModalWindow-td1889646.html
onClick( AjaxRequestTarget target ){
target.appendJavascript( "Wicket.Window.unloadConfirmation = false;" );
modal.show( target);
}
It sounds like you already know how to deal with the modal, but there's an example of doing it here. Opening an external link is not difficult, and there's an example of doing it here.
how do you create your link ?
did you tried with an externalLink ?
new ExternalLink("applicationLink","http://www.google.com");

How can I link to a specific tab created with Dojo/Zend Combination

I have the following html / Javascript:
http://pastie.org/782618
And the following Zend PHP Code for the tabs:
http://pastie.org/782620
I would like to link to the Second Tab (Event Information2). If possible I would prefer to be able to have a button on the first tab that when clicked it goes to the next form. If that isn't possible I could also do a link to the second tab as long as it wouldn't refresh the page (there will be content in a form that will need to not be lost).
I figured it out, for future users:
$next = new Zend_Form_Element_Button ('next', array('onClick'=>"dijit.byId('createEventForm-TabContainer').forward()"));
$next->setLabel('Next');
$back = new Zend_Form_Element_Button ('back', array('onClick'=>"dijit.byId('createEventForm-TabContainer').back()"));
$back->setLabel('Back');