Loading ...
Sorry, an error occurred while loading the content.
 

Re: Testing relative img src's with yahoo test

Expand Messages
  • Razee Marikar
    Hi, did you try the webdeveloper plugin for firefox? Its here: https://addons.mozilla.org/en-US/firefox/addon/60 Install it, click on Images in the
    Message 1 of 2 , Jan 6, 2009
      Hi, did you try the webdeveloper plugin for firefox? Its here:
      https://addons.mozilla.org/en-US/firefox/addon/60

      Install it, click on "Images" in the webdeveloper toolbar, and click
      "Display Image Paths".


      --- In ydn-javascript@yahoogroups.com, "Chris Adams" <mail@...> wrote:
      >
      > Hi guys,
      >
      > Sorry if this is really obvious, but I couldn't find relevant property
      > to test when using firebug; is there a quick easy way to return the
      > relative path of an image src when testing?
      >
      > Consider the following simplified html and javascript
      >
      > <html>
      >
      > <img id="logo" src="logo.gif" />
      >
      > </html>
      >
      > And javascript like below:
      >
      > <script>
      >
      > // .. include YUI test harness, and test up testcase
      >
      > var logo_image = document.getElementById("logo");
      >
      > YAHOO.util.Assert.areEqual("logo.jpg", logo_image.src, "image should
      > be 'logo.gif' onload before mouse hover");
      >
      > // .. add logger and run tests
      >
      > </script>
      >
      > I'm failing a test because logo_image.src returns a long absolute
      > filename when testing locally, like:
      >
      > "file:///Users/chrisadams/Desktop/FOO/BAR/BAZ/PROJECT/TEST/logo.jpg"
      > instead of simple "logo.gif".
      >
      > I know it's possible to strip the absolute path by doing some string
      > manipulation jiggery pokery, or by using a regex, but before I go down
      > this path,but these all seem overly complex ways to do something very
      > simple.
      >
      > There must be other people who've had to test for relative src's
      > locally before deploying to server here - am I missing something
      > obvious?
      >
      > Thanks guys, and happy new year.
      >
      > C
      >
      > --
      > Chris Adams
      > mob: 07974 368 229
      > tel: 0207 558 8971
      > skype: chris.d.adams
      > twitter: chris_d_adams
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.