-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_main._spec.js
More file actions
44 lines (35 loc) · 1.09 KB
/
_main._spec.js
File metadata and controls
44 lines (35 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
var username = 'john.aaron.nelson@gmail.com',
password = 'Science3',
chai = require('chai'),
assert = chai.assert,
jsforce = require('jsforce'),
conn = new jsforce.Connection(),
webdriverio = require('webdriverio'),
remote = webdriverio.remote({ desiredCapabilities: { browserName: 'chrome' } });
// remote.init()
// .then(login)
// .then(goToNewAccount)
// .then(remote.debug)
// .then(remote.end);
describe('Salesforce E2E', function () {
this.timeout(30000);
before(function () {
return remote.init().then(login);
});
it('should make a new account', () => {
return goToNewAccount().then(res => remote.debug());
});
after(function () {
return remote.end();
});
});
function login() {
return conn.login(username, password)
.then(userInfo => `${conn.instanceUrl}/secur/frontdoor.jsp?sid=${conn.accessToken}`)
.then(url => remote.url(url));
}
function goToNewAccount() {
return conn.describe("Account")
.then(meta => meta.urls['uiNewRecord'])
.then(url => remote.url(url));
}