Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Commit 4cdd779

Browse files
committed
chore(tests): Set upload e2e to manual
1 parent 8bd3a44 commit 4cdd779

3 files changed

Lines changed: 80 additions & 80 deletions

File tree

src/storage/FirebaseStorage.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,21 @@
2020
$progress: function $progress(callback) {
2121
task.on('state_changed', function () {
2222
$digestFn(function () {
23-
callback.apply(null, [unwrapStorageSnapshot(task.snapshot)]);
23+
callback([unwrapStorageSnapshot(task.snapshot)]);
2424
});
2525
});
2626
},
2727
$error: function $error(callback) {
2828
task.on('state_changed', function () {}, function (err) {
2929
$digestFn(function () {
30-
callback.apply(null, [err]);
30+
callback([err]);
3131
});
3232
});
3333
},
3434
$complete: function $complete(callback) {
3535
task.on('state_changed', function () {}, function () {}, function () {
3636
$digestFn(function () {
37-
callback.apply(null, [unwrapStorageSnapshot(task.snapshot)]);
37+
callback([unwrapStorageSnapshot(task.snapshot)]);
3838
});
3939
});
4040
},
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
var protractor = require('protractor');
2+
var firebase = require('firebase');
3+
var path = require('path');
4+
require('../../initialize-node.js');
5+
6+
describe('Upload App', function () {
7+
// Reference to the Firebase which stores the data for this demo
8+
var firebaseRef;
9+
10+
// Boolean used to load the page on the first test only
11+
var isPageLoaded = false;
12+
13+
// Reference to the messages repeater
14+
var messages = element.all(by.repeater('message in messages'));
15+
16+
var flow = protractor.promise.controlFlow();
17+
18+
function waitOne() {
19+
return protractor.promise.delayed(500);
20+
}
21+
22+
function sleep() {
23+
flow.execute(waitOne);
24+
}
25+
26+
function clearFirebaseRef() {
27+
var deferred = protractor.promise.defer();
28+
29+
firebaseRef.remove(function(err) {
30+
if (err) {
31+
deferred.reject(err);
32+
} else {
33+
deferred.fulfill();
34+
}
35+
});
36+
37+
return deferred.promise;
38+
}
39+
40+
beforeEach(function (done) {
41+
if (!isPageLoaded) {
42+
isPageLoaded = true;
43+
44+
browser.get('upload/upload.html').then(function () {
45+
return browser.waitForAngular()
46+
}).then(done)
47+
} else {
48+
done()
49+
}
50+
});
51+
52+
it('loads', function () {
53+
expect(browser.getTitle()).toEqual('AngularFire Upload e2e Test');
54+
});
55+
56+
it('starts with an empty list of messages', function () {
57+
expect(messages.count()).toBe(0);
58+
});
59+
60+
it('uploads a file', function (done) {
61+
var fileToUpload = './upload/logo.png',
62+
absolutePath = path.resolve(__dirname, fileToUpload);
63+
64+
$('input[type="file"]').sendKeys(absolutePath);
65+
$('#submit').click();
66+
67+
var el = element(by.id('url'));
68+
browser.driver.wait(protractor.until.elementIsVisible(el))
69+
.then(function () {
70+
return el.getText();
71+
}).then(function (text) {
72+
var result = "https://firebasestorage.googleapis.com/v0/b/oss-test.appspot.com/o/user%2F1.png";
73+
expect(text.slice(0, result.length)).toEqual(result);
74+
done();
75+
});
76+
});
77+
});

tests/protractor/upload/upload.spec.js

Lines changed: 0 additions & 77 deletions
This file was deleted.

0 commit comments

Comments
 (0)