You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "James Carman (JIRA)" <ji...@apache.org> on 2008/09/13 01:03:44 UTC

[jira] Created: (WICKET-1830) Include Component Path in Generated Markup

Include Component Path in Generated Markup
------------------------------------------

                 Key: WICKET-1830
                 URL: https://issues.apache.org/jira/browse/WICKET-1830
             Project: Wicket
          Issue Type: Improvement
          Components: wicket
            Reporter: James Carman
            Priority: Minor


For unit testing purposes, it would be nice to know the exact ids of the components on your wicket pages.  Perhaps the generated markup could contain a wicket:path attribute?

<div wicket:path="some:path:to:this:div">

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-1830) Include Component Path in Generated Markup

Posted by "James Carman (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James Carman updated WICKET-1830:
---------------------------------

    Comment: was deleted

> Include Component Path in Generated Markup
> ------------------------------------------
>
>                 Key: WICKET-1830
>                 URL: https://issues.apache.org/jira/browse/WICKET-1830
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>            Reporter: James Carman
>            Assignee: Igor Vaynberg
>            Priority: Minor
>             Fix For: 1.3.5, 1.4-M4
>
>
> For unit testing purposes, it would be nice to know the exact ids of the components on your wicket pages.  Perhaps the generated markup could contain a wicket:path attribute?
> <div wicket:path="some:path:to:this:div">

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-1830) Include Component Path in Generated Markup

Posted by "Timo Rantalaiho (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12631633#action_12631633 ] 

Timo Rantalaiho commented on WICKET-1830:
-----------------------------------------

Hey Igor, did you try if this can really be used with Selenium?

My colleague seemed to remember that colon (:) would cause problems in values and attribute names when used in Selenium xpath expressions. So it might be good to make their format pluggable.

Maybe something like

 if (getApplication().getDebugSettings().isOutputComponentPath())
 {
     IWicketPathPrinter printer = getApplication().getDebugSettings().getWicketPathPrinter();
     tag.put(printer.getPathAttributeName(), printer.getWicketPathOf(this); 
}

public class DefaultWicketPathPrinter implements IWicketPathPrinter
{
    public String getPathAttributeName() {
        return "wicket:path";
    }

    public String getWicketPathOf(Component component)
    {
        return component.getPageRelativePath();
    }
}


> Include Component Path in Generated Markup
> ------------------------------------------
>
>                 Key: WICKET-1830
>                 URL: https://issues.apache.org/jira/browse/WICKET-1830
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>            Reporter: James Carman
>            Assignee: Igor Vaynberg
>            Priority: Minor
>             Fix For: 1.3.5, 1.4-M4
>
>
> For unit testing purposes, it would be nice to know the exact ids of the components on your wicket pages.  Perhaps the generated markup could contain a wicket:path attribute?
> <div wicket:path="some:path:to:this:div">

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-1830) Include Component Path in Generated Markup

Posted by "Frank van Lankvelt (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12842581#action_12842581 ] 

Frank van Lankvelt commented on WICKET-1830:
--------------------------------------------

As an example of how this functionality can be used, a small HOWTO for the Selenium IDE.

Create a folder "wicketPathLocatorBuilder" with the file "user-extension.js.wicketPathLocatorBuilder".  Paste the following snipped in this file.

LocatorBuilders.add('wicketpath', function(e) {
        this.log.debug("wicketpath: e=" + e);
        if (e.attributes && e.hasAttribute("wicketpath")) {
            this.log.info("found attribute " + e.getAttribute("wicketpath"));
            return "//" + this.xpathHtmlElement(e.nodeName.toLowerCase()) +
                "[@wicketpath=" + this.attributeValue(e.getAttribute("wicketpath")) + "]";
        }
        return null;
    });

LocatorBuilders.order.unshift(LocatorBuilders.order.pop());

Install the Selenium IDE plugin for Firefox from http://seleniumhq.org/download/ .

Open the Selenium IDE, go to menu Options -> Options.  In the Selenium Core extensions input field, paste the path to the earlier created folder "wicketPathLocatorBuilder".  Restart firefox.

You can now record tests by clicking and/or right-clicking to insert additional commands.  By default, the wicketpath attribute is used to generate an element locator.

> Include Component Path in Generated Markup
> ------------------------------------------
>
>                 Key: WICKET-1830
>                 URL: https://issues.apache.org/jira/browse/WICKET-1830
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>            Reporter: James Carman
>            Assignee: Igor Vaynberg
>            Priority: Minor
>             Fix For: 1.3.5, 1.4-RC1
>
>
> For unit testing purposes, it would be nice to know the exact ids of the components on your wicket pages.  Perhaps the generated markup could contain a wicket:path attribute?
> <div wicket:path="some:path:to:this:div">

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-1830) Include Component Path in Generated Markup

Posted by "James Carman (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12631134#action_12631134 ] 

James Carman commented on WICKET-1830:
--------------------------------------

Ok, cool.  I did look through the source to try to figure out where this would go.  I didn't find a nice quick and easy place to make this change.  So, I didn't get around to it yet.  Out of curiosity, do you have the SVN version number of your checkin?  I'd love to see the code changes (I don't get SVN commit messages).

> Include Component Path in Generated Markup
> ------------------------------------------
>
>                 Key: WICKET-1830
>                 URL: https://issues.apache.org/jira/browse/WICKET-1830
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>            Reporter: James Carman
>            Assignee: Igor Vaynberg
>            Priority: Minor
>             Fix For: 1.3.5, 1.4-M4
>
>
> For unit testing purposes, it would be nice to know the exact ids of the components on your wicket pages.  Perhaps the generated markup could contain a wicket:path attribute?
> <div wicket:path="some:path:to:this:div">

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (WICKET-1830) Include Component Path in Generated Markup

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg reassigned WICKET-1830:
-------------------------------------

    Assignee: Igor Vaynberg

> Include Component Path in Generated Markup
> ------------------------------------------
>
>                 Key: WICKET-1830
>                 URL: https://issues.apache.org/jira/browse/WICKET-1830
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>            Reporter: James Carman
>            Assignee: Igor Vaynberg
>            Priority: Minor
>
> For unit testing purposes, it would be nice to know the exact ids of the components on your wicket pages.  Perhaps the generated markup could contain a wicket:path attribute?
> <div wicket:path="some:path:to:this:div">

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-1830) Include Component Path in Generated Markup

Posted by "Timo Rantalaiho (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12632098#action_12632098 ] 

Timo Rantalaiho commented on WICKET-1830:
-----------------------------------------

Looks good, cheers Igor!



> Include Component Path in Generated Markup
> ------------------------------------------
>
>                 Key: WICKET-1830
>                 URL: https://issues.apache.org/jira/browse/WICKET-1830
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>            Reporter: James Carman
>            Assignee: Igor Vaynberg
>            Priority: Minor
>             Fix For: 1.3.5, 1.4-M4
>
>
> For unit testing purposes, it would be nice to know the exact ids of the components on your wicket pages.  Perhaps the generated markup could contain a wicket:path attribute?
> <div wicket:path="some:path:to:this:div">

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-1830) Include Component Path in Generated Markup

Posted by "James Carman (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12630707#action_12630707 ] 

James Carman commented on WICKET-1830:
--------------------------------------

As I mentioned in the email thread, I'd like to try to take a stab at this one.  I'll try to submit a patch soon.

> Include Component Path in Generated Markup
> ------------------------------------------
>
>                 Key: WICKET-1830
>                 URL: https://issues.apache.org/jira/browse/WICKET-1830
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>            Reporter: James Carman
>            Priority: Minor
>
> For unit testing purposes, it would be nice to know the exact ids of the components on your wicket pages.  Perhaps the generated markup could contain a wicket:path attribute?
> <div wicket:path="some:path:to:this:div">

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-1830) Include Component Path in Generated Markup

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12842719#action_12842719 ] 

Igor Vaynberg commented on WICKET-1830:
---------------------------------------

added to http://cwiki.apache.org/confluence/display/WICKET/Selenium+Tips
cheers

> Include Component Path in Generated Markup
> ------------------------------------------
>
>                 Key: WICKET-1830
>                 URL: https://issues.apache.org/jira/browse/WICKET-1830
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>            Reporter: James Carman
>            Assignee: Igor Vaynberg
>            Priority: Minor
>             Fix For: 1.3.5, 1.4-RC1
>
>
> For unit testing purposes, it would be nice to know the exact ids of the components on your wicket pages.  Perhaps the generated markup could contain a wicket:path attribute?
> <div wicket:path="some:path:to:this:div">

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-1830) Include Component Path in Generated Markup

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12631635#action_12631635 ] 

Igor Vaynberg commented on WICKET-1830:
---------------------------------------

i definately do not think we need to go this far, just find a character that works, perhaps escape : with _

> Include Component Path in Generated Markup
> ------------------------------------------
>
>                 Key: WICKET-1830
>                 URL: https://issues.apache.org/jira/browse/WICKET-1830
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>            Reporter: James Carman
>            Assignee: Igor Vaynberg
>            Priority: Minor
>             Fix For: 1.3.5, 1.4-M4
>
>
> For unit testing purposes, it would be nice to know the exact ids of the components on your wicket pages.  Perhaps the generated markup could contain a wicket:path attribute?
> <div wicket:path="some:path:to:this:div">

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-1830) Include Component Path in Generated Markup

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12631638#action_12631638 ] 

Igor Vaynberg commented on WICKET-1830:
---------------------------------------

and its in

> Include Component Path in Generated Markup
> ------------------------------------------
>
>                 Key: WICKET-1830
>                 URL: https://issues.apache.org/jira/browse/WICKET-1830
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>            Reporter: James Carman
>            Assignee: Igor Vaynberg
>            Priority: Minor
>             Fix For: 1.3.5, 1.4-M4
>
>
> For unit testing purposes, it would be nice to know the exact ids of the components on your wicket pages.  Perhaps the generated markup could contain a wicket:path attribute?
> <div wicket:path="some:path:to:this:div">

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WICKET-1830) Include Component Path in Generated Markup

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg resolved WICKET-1830.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 1.4-M4
                   1.3.5

i waited a couple of days james, but didnt see a patch so i put this in myself as it is also useful to us for our selenium tests

> Include Component Path in Generated Markup
> ------------------------------------------
>
>                 Key: WICKET-1830
>                 URL: https://issues.apache.org/jira/browse/WICKET-1830
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>            Reporter: James Carman
>            Assignee: Igor Vaynberg
>            Priority: Minor
>             Fix For: 1.3.5, 1.4-M4
>
>
> For unit testing purposes, it would be nice to know the exact ids of the components on your wicket pages.  Perhaps the generated markup could contain a wicket:path attribute?
> <div wicket:path="some:path:to:this:div">

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.