Is it possible to add a custom attribute to the upload widget iframe?

Comments

5 comments

  • Avatar
    Daniel Mendoza

    Hi @Alex,

    Can you provide details on the use case?

    Since the upload widget is added to an html element, there is a query selector already available to get that element. But seems like you wish to insert this custom attribute to a particular element within the upload widget code. If you can provide more details, that would be helpful.

    0
    Comment actions Permalink
  • Avatar
    Alex Bjørlig

    We don't add the widget to an HTML element - it's a page-wide pop-up in our angular application?

     

    So the use-case is about automated testing here. We are using cypress to automate our testing, also uploading a small file to cloudinary (just to make sure everything works as expected). The first step of automating the process is to select the Cloudinary iframe. But the only issue is that there are multiple iframes in our application (for example intercom).

    Thefore it would be nice to use a attribute selector, cypress documentation suggest something like this:

    ```

    <iframe src="some-url" data-cy="the-frame"></iframe>

    ```

    Because then we can write a robust selector in our test scripts, that targets:

    .get('iframe[data-cy="the-frame"]')

     

    I hope this makes more sense - and please ask if you need more details ☺️

     

    0
    Comment actions Permalink
  • Avatar
    Michal Kuperman

    Hi Alex,

    Thank you for providing your use case.

    It is not possible to add a custom attribute to the iframe, however, we have an attribute specifically for testing purposes: `data-test="uw-iframe"`. 

    Please let us know if this works for you,

    Thanks

    1
    Comment actions Permalink
  • Avatar
    Alex Bjørlig

    Thanks for the answer Michal - I guess that attribute is ok 👍

    0
    Comment actions Permalink
  • Avatar
    Michal Kuperman

    Great! Thanks for the update.

    0
    Comment actions Permalink

Please sign in to leave a comment.