uppy/test/endtoend/utils.js
Renée Kooi fedfb98fa7 Split integration tests and add one using create-react-app (#952)
* Split up integration tests.

* Remove unused bits from xhr-limit integration test.

* Use a shared base config for local and remote webdriver tests.

* Remove npmignores

These are no longer needed because we publish from packages/* and not
the root.

* Keep xhr-limit disabled because it still does not work

* Extract integration test helper functions to utils.js.

* Stash React integration test stub

* Fix build steps for CRA integration test.

* Add Webpack CSS test and CRA mount/unmount test

* Add DashboardModal integration tests.

* Add suites to wdio so we can run single tests.

* Fix create-react-app CI build.
2018-07-18 11:24:55 +02:00

26 lines
690 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* global window, capabilities */
function selectFakeFile (uppyID) {
var blob = new Blob(
['data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTIwIDEyMCI+CiAgPGNpcmNsZSBjeD0iNjAiIGN5PSI2MCIgcj0iNTAiLz4KPC9zdmc+Cg=='],
{ type: 'image/svg+xml' }
)
window[uppyID].addFile({
source: 'test',
name: 'test-file',
type: blob.type,
data: blob
})
}
function supportsChooseFile () {
// Webdriver for Safari and Edge doesnt support .chooseFile
return capabilities.browserName !== 'safari' &&
capabilities.browserName !== 'MicrosoftEdge' &&
capabilities.platformName !== 'Android'
}
module.exports = {
selectFakeFile,
supportsChooseFile
}