how to click a link using page object in watir-webdriver with cucumber - watir-webdriver

I want to use page objects for my project and need to know how to click on link as I have tried with methods which I got from the google search but it is not working. step definition is
Given /^I navigate to the RCM Home Page$/ do
visit_page HomePage
end
When /^I click the Show Filters Link$/ do
#current_page.show_filters
end
my page object class file is
class HomePage
include PageObject
page_url Common.get_url('rcm')
link(:show_filters, :id => "portletComponentWorkList_viewNormalModeWorkList_viewPanel_showFiltersLink")
end
my .feature file is
Feature: RCM Workspace basic features test
Scenario: Perform basic operations on RCM project
Given I navigate to the RCM Home Page
When I click the Show Filters Link

#current_page.show_filters.click

Related

Add Facebook tab for page for angular2 site

I want to add tab in my business page for angular2 site. For that I follow that steps :-
https://blog.hubspot.com/blog/tabid/6307/bid/26330/how-to-create-custom-tabs-for-facebook-business-pages.aspx
when I click on that particular tab its showing "can not Post error message" and when I try to hit this link :-
http://www.facebook.com/dialog/pagetab?app_id=12345678901234&next=https://www.aaa.com/#!/home
its remove home from this link and create that new link :-
https://www.aaa.com/#= and this link is not valid for my site.
Please tell me what I can do for angular2 site
its remove home from this link and create that new link :- https://www.aaa.com/#= and this link is not valid for my site.
You did not properly URL-encode the value - so the #!/home part belongs to the “outer” URL.
&next=https%3A%2F%2Fwww.aaa.com%2F%23%21%2Fhome
is what your URL to call the Page Tab add dialog should end with.

Reloading the existing browser Tab when the user tries to open same in GWT?

I have a one GWT application which contains 3 modules. The user can switch from one module another module by using buttons.
The user can access the modules in the following ways:
1) The user can enter the URL in the browser like below:
Ex: http://localhost:1045//app1
2) Clicking on the button once any of the 3 modules are already opened using above stpe 1:
On button click: Window.open("http://localhost:1045//app2", "app2Window", "");
So the app2 will be opened in the another tab.
Now If the user opens app1 by entering the module url in the browser and then click on the button to open the app2
in the new tab.
So We have two tabs with two modules(app1, app2).
Now the actual issue is:
If the user clicks on a button(to open "app1") in the 2nd tab with "app2". The new tab is opened instead of loading the
existing tab with "app1".
Steps:
As per the above mentioned steps:
1) User can open "app1" by entering the url in the browser(http"//localhost:1045/app1)
2) User clicks on button in the opened "App1" to open "App2" in the new tab.
3) From the "App2", the user can open "App3" by clicking on the button.
4) Now if the user clicks on the button in "App3" to open "App2" which is alreay opened. that time
new tab wont be opened the existing tab will be reloaded.
So the mentioned scenario is possible. but the problem here is, the browser is not able to reload the
(tab) module which is opened by using "entering URL".
How to avoid opening the new tab? I saw the window name will differentaiate the tab is opened or not?
But I was not able to find the method to name the window when the user enters the url in the browser?
How Can I achieve this GWT?
Window.Location.assign(String url) ?
GWT can do everything that Javascript can do, and can't do what is not possible in JS.
Seems like it is not possible to pick and choose which tab to open a link into (discussion here).
What you can do is to create your own container for you three modules or compile all three of them into one GWT application able to easily switch between them and never reload.
EDIT:
One of the great things about GWT is that you can create one-page-apps, and switch between functions, screens or applications with no problems. Actually GWT has a MVP implementations that is well done and serves this purpose ( MVP examples ).
I would strongly suggest to abandon the multi-window (or multi-tab) design and embrace the GWT nature. It will be painful at first but in the long term this design choice will make your application more solid and your code better.

Tx_News_ViewHelpers Generate Link to another site in same typo3

I would like to create a link to a news-detail-page, but this news-detail-page is on another URL (both pages are in the same typo3-installation).
So for example I list news-article on www.domain1.com, the link to the detailpage shall be www.domain2.com/article/123 (article/123 is just how RealURL build the link).
Right now the link is generated with this code in News/Partials/List/Item.html
{n:link(newsItem: newsItem, settings: settings, uriOnly: 1)}
but this generates a link to: www.domain1.com/article/123.
Best would be if the news viewhelper automaticly determinates where the news-article is coming from (where the news-container is), but it would be also very good if I just could manually say what URL it shall take.

How to hide "User Information" options from "My Account" in Liferay 6.1?

I am trying to hide some options in "User Information" from My Account by using hook. I just want to hide it using CSS (style="display:none"). User Information is present in the right side of My Account Page.
I want to know, in which page I should make changes? While creating hook which page I should select for hiding those links like "Organizations, Sites, etc." Please help...
You have to choose the tab you want by writing them in the portal-ext.properties as follow :
#
# Input a list of sections that will be included as part of the user form
# when updating a user in the My Account portlet.
users.form.my.account.main=details,password,organizations,sites,user-groups,roles,personal-site,categorization
users.form.my.account.identification=addresses,phone-numbers,additional-email-addresses,websites,instant-messenger,social-network,sms,open-id
users.form.my.account.miscellaneous=announcements,display-settings,comments,custom-fields
Each field will be linked to its jsp. For exemple, "details" will display details.jsp.
Since your problem is finding the jsp file, you should do these :
download the Liferay source, and add the portal-trunk as a Liferay Project in Eclipse
Navigate through the portal to your desired file (manage my account), and get the url from your browser
Search for the "struts_action" attribute in the usl. For this case, it's "/my_sites/view"
This is very helpful as the first parameter indicates the portlet that controls the jsp page.
The second parameter usually is the jsp you are searching for
Find that file in the portal trunk and search for the html component you want to edit. it might be in the page itself, or it could be on an included one, or a sibling one (provided as a tab)
For your case, it's "/portal-trunk/portal-web/docroot/html/portlet/users_admin/edit_user.jsp"
It is not possible to remove those options using CSS. We can do the following simple java code for removing those tabs... The page which we need to edit is "/portal-trunk/portal-web/docroot/html/portlet/users_admin/edit_user.jsp".
List<String> identificationList = new ArrayList<String>();
for(String identificationItem : identificationSections){
identificationList.add(identificationItem);
System.out.println(identificationItem);
}
identificationList.remove("websites");
identificationList.remove("instant-messenger");
identificationList.remove("social-network");
identificationList.remove("sms");
identificationList.remove("open-id");
identificationSections = new String[identificationList.size()];
for(int i = 0; i < identificationList.size(); i++){
identificationSections[i] =identificationList.get(i);
}
Its easy to hide those links by using the simple java code written above.

Vbulletin plugin development tutorial

I searched for tutorials but i didn't found any useful tutorial. I want to create simple plugin which add "123" to header of every pages of forum.
I tried to go to admin panel -> create new plugin. But i don't know what hook i need to display "123" in header.
I will be very thankful for any help.
Assuming vBulletin 4 and above:
Create a Product
Logon to your AdminCP
Goto Plugins & Products -> Manage Products
Click Add/Import Product
On the following screen enter your product name etc in the Add New Product section (you can leave Product URL and Product Check URL blank)
Add a Plugin to your Product
Goto Plugins & Products -> Add New Plugin
Select your Product
To add something to the header on every page select the global_bootstrap_init_complete hook location
In PHP code enter the following:
$template_hook['mycustommesage'] = 'hello world';
Update your header template to include the plugin output
In ACP goto Styles & Templates -> Style Manager
Select the style you want to edit and select edit templates
Open the header template
Whereever you want you plugin output to appear add:
{vb:raw template_hook.mycustommesage}