|
@@ -1,7 +1,7 @@
|
|
|
var test = require('tape')
|
|
|
var path = require('path')
|
|
|
var core = require('./core')
|
|
|
-var driver = core.setDriver()
|
|
|
+var browser = core.setDriver()
|
|
|
var By = core.By
|
|
|
|
|
|
var config = {
|
|
@@ -10,29 +10,29 @@ var config = {
|
|
|
imageAbsolutePath: path.join(__dirname, 'image.jpg')
|
|
|
}
|
|
|
|
|
|
-var consoleElement = driver.findElement(By.id('console-log'))
|
|
|
+var consoleElement = browser.findElement(By.id('console-log'))
|
|
|
|
|
|
test('dragdrop: make sure DragDrop accepts and uploads 1 file via input', function (t) {
|
|
|
t.plan(1)
|
|
|
|
|
|
// Go to the example URL
|
|
|
- driver.get(config.dragDropTestUrl)
|
|
|
+ browser.get(config.dragDropTestUrl)
|
|
|
|
|
|
// Find input by css selector
|
|
|
- var input = driver.findElement(core.By.css(config.dragDropInputSelector))
|
|
|
+ var input = browser.findElement(core.By.css(config.dragDropInputSelector))
|
|
|
|
|
|
// Pass absolute image path to the input
|
|
|
input.sendKeys(config.imageAbsolutePath)
|
|
|
|
|
|
// Wait for a while for upload to go through
|
|
|
- driver.sleep(3000)
|
|
|
+ browser.sleep(3000)
|
|
|
|
|
|
// Get console elements’s value, then check if it has “Download” there somewhere,
|
|
|
// if it does, then test passes
|
|
|
consoleElement.getAttribute('value').then(function (value) {
|
|
|
var isFileUploaded = value.indexOf('Download') !== -1
|
|
|
t.equal(isFileUploaded, true)
|
|
|
- })
|
|
|
|
|
|
- driver.quit()
|
|
|
+ browser.quit()
|
|
|
+ })
|
|
|
})
|