sfdx-browserforce-plugin 4.1.2 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/plugins/index.js +3 -1
- package/lib/plugins/index.js.map +1 -1
- package/lib/plugins/slack/index.e2e-spec.js +52 -0
- package/lib/plugins/slack/index.e2e-spec.js.map +1 -0
- package/lib/plugins/slack/index.js +48 -0
- package/lib/plugins/slack/index.js.map +1 -0
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/lib/plugins/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.linkedInSalesNavigatorSettings = exports.companyInformation = exports.security = exports.salesforceToSalesforce = exports.reportsAndDashboards = exports.relateContactToMultipleAccounts = exports.recordTypes = exports.picklists = exports.opportunitySplits = exports.lightningExperienceSettings = exports.homePageLayouts = exports.highVelocitySalesSettings = exports.emailDeliverability = exports.densitySettings = exports.deferSharingCalculation = exports.customerPortal = exports.communities = exports.activitySettings = void 0;
|
|
3
|
+
exports.linkedInSalesNavigatorSettings = exports.companyInformation = exports.slack = exports.security = exports.salesforceToSalesforce = exports.reportsAndDashboards = exports.relateContactToMultipleAccounts = exports.recordTypes = exports.picklists = exports.opportunitySplits = exports.lightningExperienceSettings = exports.homePageLayouts = exports.highVelocitySalesSettings = exports.emailDeliverability = exports.densitySettings = exports.deferSharingCalculation = exports.customerPortal = exports.communities = exports.activitySettings = void 0;
|
|
4
4
|
const activity_settings_1 = require("./activity-settings");
|
|
5
5
|
Object.defineProperty(exports, "activitySettings", { enumerable: true, get: function () { return activity_settings_1.ActivitySettings; } });
|
|
6
6
|
const communities_1 = require("./communities");
|
|
@@ -33,6 +33,8 @@ const salesforce_to_salesforce_1 = require("./salesforce-to-salesforce");
|
|
|
33
33
|
Object.defineProperty(exports, "salesforceToSalesforce", { enumerable: true, get: function () { return salesforce_to_salesforce_1.SalesforceToSalesforce; } });
|
|
34
34
|
const security_1 = require("./security");
|
|
35
35
|
Object.defineProperty(exports, "security", { enumerable: true, get: function () { return security_1.Security; } });
|
|
36
|
+
const slack_1 = require("./slack");
|
|
37
|
+
Object.defineProperty(exports, "slack", { enumerable: true, get: function () { return slack_1.Slack; } });
|
|
36
38
|
const company_information_1 = require("./company-information");
|
|
37
39
|
Object.defineProperty(exports, "companyInformation", { enumerable: true, get: function () { return company_information_1.CompanyInformation; } });
|
|
38
40
|
const linkedin_sales_navigator_settings_1 = require("./linkedin-sales-navigator-settings");
|
package/lib/plugins/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":";;;AAAA,2DAA2E;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":";;;AAAA,2DAA2E;AAqBzE,iGArB2B,oCAAgB,OAqB3B;AApBlB,+CAA2D;AAqBzD,4FArBsB,yBAAW,OAqBtB;AApBb,uDAAqE;AAqBnE,+FArByB,gCAAc,OAqBzB;AApBhB,2EAAiG;AAqB/F,wGArBkC,mDAAuB,OAqBlC;AApBzB,yDAAwE;AAqBtE,gGArB0B,kCAAe,OAqB1B;AApBjB,iEAAoF;AAqBlF,oGArB8B,0CAAmB,OAqB9B;AApBrB,iFAAwG;AAqBtG,0GArBoC,wDAAyB,OAqBpC;AApB3B,2DAAyE;AAqBvE,gGArB0B,mCAAe,OAqB1B;AApBjB,mFAA6G;AAqB3G,4GArBsC,2DAA2B,OAqBtC;AApB7B,6DAA8E;AAqB5E,kGArB4B,sCAAiB,OAqB5B;AApBnB,2CAAqD;AAqBnD,0FArBoB,qBAAS,OAqBpB;AApBX,iDAA4D;AAqB1D,4FArBsB,0BAAW,OAqBtB;AApBb,+FAA2H;AAqBzH,gHArB0C,qEAA+B,OAqB1C;AApBjC,qEAAwF;AAqBtF,qGArB+B,6CAAoB,OAqB/B;AApBtB,yEAA8F;AAqB5F,uGArBiC,iDAAsB,OAqBjC;AApBxB,yCAAkD;AAqBhD,yFArBmB,mBAAQ,OAqBnB;AApBV,mCAAyC;AAqBvC,sFArBgB,aAAK,OAqBhB;AApBP,+DAAiF;AAqB/E,mGArB6B,wCAAkB,OAqB7B;AApBpB,2FAAuH;AAqBrH,+GArByC,kEAA8B,OAqBzC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const assert_1 = __importDefault(require("assert"));
|
|
7
|
+
const _1 = require(".");
|
|
8
|
+
describe(_1.Slack.name, function () {
|
|
9
|
+
let plugin;
|
|
10
|
+
before(() => {
|
|
11
|
+
plugin = new _1.Slack(global.bf);
|
|
12
|
+
});
|
|
13
|
+
const configEnable = {
|
|
14
|
+
agreeToTermsAndConditions: true,
|
|
15
|
+
enableSalesCloudForSlack: true
|
|
16
|
+
};
|
|
17
|
+
const configDisabledSalesCloud = {
|
|
18
|
+
agreeToTermsAndConditions: true,
|
|
19
|
+
enableSalesCloudForSlack: false
|
|
20
|
+
};
|
|
21
|
+
const configDisabled = {
|
|
22
|
+
agreeToTermsAndConditions: false,
|
|
23
|
+
enableSalesCloudForSlack: false
|
|
24
|
+
};
|
|
25
|
+
it('should accept terms and conditions', async () => {
|
|
26
|
+
await plugin.run(configEnable);
|
|
27
|
+
});
|
|
28
|
+
it('should already be accepted', async () => {
|
|
29
|
+
const res = await plugin.run(configEnable);
|
|
30
|
+
assert_1.default.deepStrictEqual(res, { message: 'no action necessary' });
|
|
31
|
+
});
|
|
32
|
+
it('should disable Sales Cloud for Slack', async () => {
|
|
33
|
+
await plugin.run(configDisabledSalesCloud);
|
|
34
|
+
});
|
|
35
|
+
it('should already be disabled', async () => {
|
|
36
|
+
const res = await plugin.run(configDisabledSalesCloud);
|
|
37
|
+
assert_1.default.deepStrictEqual(res, { message: 'no action necessary' });
|
|
38
|
+
});
|
|
39
|
+
it('should fail to unaccept terms and conditions', async () => {
|
|
40
|
+
let err;
|
|
41
|
+
try {
|
|
42
|
+
await plugin.apply(configDisabled);
|
|
43
|
+
}
|
|
44
|
+
catch (e) {
|
|
45
|
+
err = e;
|
|
46
|
+
}
|
|
47
|
+
assert_1.default.throws(() => {
|
|
48
|
+
throw err;
|
|
49
|
+
}, /cannot be unaccepted/);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
//# sourceMappingURL=index.e2e-spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.e2e-spec.js","sourceRoot":"","sources":["../../../src/plugins/slack/index.e2e-spec.ts"],"names":[],"mappings":";;;;;AAAA,oDAA4B;AAC5B,wBAAuC;AAEvC,QAAQ,CAAC,QAAK,CAAC,IAAI,EAAE;IACnB,IAAI,MAAa,CAAC;IAClB,MAAM,CAAC,GAAG,EAAE;QACV,MAAM,GAAG,IAAI,QAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;IAEH,MAAM,YAAY,GAAW;QAC3B,yBAAyB,EAAE,IAAI;QAC/B,wBAAwB,EAAE,IAAI;KAC/B,CAAC;IACF,MAAM,wBAAwB,GAAW;QACvC,yBAAyB,EAAE,IAAI;QAC/B,wBAAwB,EAAE,KAAK;KAChC,CAAC;IACF,MAAM,cAAc,GAAW;QAC7B,yBAAyB,EAAE,KAAK;QAChC,wBAAwB,EAAE,KAAK;KAChC,CAAC;IACF,EAAE,CAAC,oCAAoC,EAAE,KAAK,IAAI,EAAE;QAClD,MAAM,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IACjC,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,4BAA4B,EAAE,KAAK,IAAI,EAAE;QAC1C,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAC3C,gBAAM,CAAC,eAAe,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,sCAAsC,EAAE,KAAK,IAAI,EAAE;QACpD,MAAM,MAAM,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,4BAA4B,EAAE,KAAK,IAAI,EAAE;QAC1C,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;QACvD,gBAAM,CAAC,eAAe,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,8CAA8C,EAAE,KAAK,IAAI,EAAE;QAC5D,IAAI,GAAG,CAAC;QACR,IAAI;YACF,MAAM,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;SACpC;QAAC,OAAO,CAAC,EAAE;YACV,GAAG,GAAG,CAAC,CAAC;SACT;QACD,gBAAM,CAAC,MAAM,CAAC,GAAG,EAAE;YACjB,MAAM,GAAG,CAAC;QACZ,CAAC,EAAE,sBAAsB,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Slack = void 0;
|
|
4
|
+
const plugin_1 = require("../../plugin");
|
|
5
|
+
const PATHS = {
|
|
6
|
+
BASE: 'lightning/setup/SlackSetupAssistant/home'
|
|
7
|
+
};
|
|
8
|
+
const SELECTORS = {
|
|
9
|
+
TOS_LIGHTNING_INPUT: 'pierce/setup_service-slack-setup-assistant-container setup_service-slack-agree-to-terms lightning-input',
|
|
10
|
+
SALES_CLOUD_FOR_SLACK_TOGGLE: 'pierce/setup_service-slack-setup-assistant-container setup_service-stage setup_service-steps setup_service-step lightning-input:has(lightning-primitive-input-toggle input[name="SlkSetupStepSalesCloudForSlack"])',
|
|
11
|
+
TOAST_MESSAGE: 'div[id^="toastDescription"]'
|
|
12
|
+
};
|
|
13
|
+
class Slack extends plugin_1.BrowserforcePlugin {
|
|
14
|
+
async retrieve(definition) {
|
|
15
|
+
const page = await this.browserforce.openPage(PATHS.BASE);
|
|
16
|
+
await page.waitForSelector(SELECTORS.TOS_LIGHTNING_INPUT, { visible: true });
|
|
17
|
+
await page.waitForSelector(SELECTORS.SALES_CLOUD_FOR_SLACK_TOGGLE, { visible: true });
|
|
18
|
+
const response = {
|
|
19
|
+
agreeToTermsAndConditions: await page.$eval(SELECTORS.TOS_LIGHTNING_INPUT, (el) => el.hasAttribute('checked')),
|
|
20
|
+
enableSalesCloudForSlack: await page.$eval(SELECTORS.SALES_CLOUD_FOR_SLACK_TOGGLE, (el) => el.hasAttribute('checked'))
|
|
21
|
+
};
|
|
22
|
+
await page.close();
|
|
23
|
+
return response;
|
|
24
|
+
}
|
|
25
|
+
async apply(config) {
|
|
26
|
+
if (config.agreeToTermsAndConditions === false) {
|
|
27
|
+
throw new Error('terms and conditions cannot be unaccepted once accepted');
|
|
28
|
+
}
|
|
29
|
+
const state = await this.retrieve();
|
|
30
|
+
const page = await this.browserforce.openPage(PATHS.BASE);
|
|
31
|
+
await page.waitForSelector(SELECTORS.TOS_LIGHTNING_INPUT, { visible: true });
|
|
32
|
+
if (state.agreeToTermsAndConditions !== config.agreeToTermsAndConditions) {
|
|
33
|
+
await Promise.all([page.waitForSelector(SELECTORS.TOAST_MESSAGE), page.click(SELECTORS.TOS_LIGHTNING_INPUT)]);
|
|
34
|
+
await page.waitForSelector(SELECTORS.TOAST_MESSAGE, { hidden: true });
|
|
35
|
+
}
|
|
36
|
+
await page.waitForSelector(SELECTORS.SALES_CLOUD_FOR_SLACK_TOGGLE, { visible: true });
|
|
37
|
+
if (state.enableSalesCloudForSlack !== config.enableSalesCloudForSlack) {
|
|
38
|
+
await Promise.all([
|
|
39
|
+
page.waitForSelector(SELECTORS.TOAST_MESSAGE),
|
|
40
|
+
page.click(SELECTORS.SALES_CLOUD_FOR_SLACK_TOGGLE)
|
|
41
|
+
]);
|
|
42
|
+
await page.waitForSelector(SELECTORS.TOAST_MESSAGE, { hidden: true });
|
|
43
|
+
}
|
|
44
|
+
await page.close();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.Slack = Slack;
|
|
48
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/slack/index.ts"],"names":[],"mappings":";;;AAAA,yCAAkD;AAElD,MAAM,KAAK,GAAG;IACZ,IAAI,EAAE,0CAA0C;CACjD,CAAC;AACF,MAAM,SAAS,GAAG;IAChB,mBAAmB,EACjB,yGAAyG;IAC3G,4BAA4B,EAC1B,oNAAoN;IACtN,aAAa,EAAE,6BAA6B;CAC7C,CAAC;AAOF,MAAa,KAAM,SAAQ,2BAAkB;IACpC,KAAK,CAAC,QAAQ,CAAC,UAAmB;QACvC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC1D,MAAM,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,mBAAmB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QAC7E,MAAM,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,4BAA4B,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QACtF,MAAM,QAAQ,GAAG;YACf,yBAAyB,EAAE,MAAM,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,mBAAmB,EAAE,CAAC,EAAE,EAAE,EAAE,CAA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