Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Selenium #32

Closed
cburgmer opened this issue May 28, 2013 · 2 comments
Closed

Support Selenium #32

cburgmer opened this issue May 28, 2013 · 2 comments

Comments

@cburgmer
Copy link

A feature request. Hope this makes sense.

We use moxie as fallback under IE8/9. Because of the nature of the fallback, we feel we cannot adequately support the implementation with unit tests and would like to run our Selenium-Suite against an instance of IE9 too.

It now seems that uploading a file through the Flash overlay is not easily doable. Would it be possible to provide a simple entry point into the Flash runtime to fake a file upload?

What I'd envision is

fileInput.fakeUpload("fileName", "data:image/png;base64,theFilesContentAsBase64");

I'd look into this myself, but due to the needed bridge into Flash have to pass.

@jayarjo
Copy link
Contributor

jayarjo commented May 29, 2013

You can check how we unit test it here. Does it help, or you need something different?

@cburgmer
Copy link
Author

Thanks a lot. I did not know I could provide my own File with the Flash runtime. Here's my code, might it help others with their testing:

window.mockFileUpload = function (fileName, fileType, content) {
                        var file;

                        fileName = fileName || 'test.svg';
                        fileType = fileType || 'image/svg+xml';
                        content = '<svg xmlns="http://www.w3.org/2000/svg"></svg>';

                        file = new window.mOxie.File(null, {
                            name: fileName,
                            type: fileType,
                            size: content.length,
                            data: content
                        });

                        window.myProductionCodeUploadHandler(file);
                    };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants