@salesforcedevs/sfdocs-e2e 1.0.3-alpha2 → 1.0.3
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/README.md +0 -1
- package/bin/run-e2e.js +0 -1
- package/common-wdio.conf.js +9 -20
- package/package.json +1 -2
- package/src/content-repo/specs/homepage.test.ts +1 -1
- package/src/shared/specs/devCenterLink.test.ts +9 -26
- package/src/shared/specs/reference.test.ts +1 -3
- package/static-dsc-portal-wdio.conf.js +0 -49
package/README.md
CHANGED
package/bin/run-e2e.js
CHANGED
|
@@ -56,7 +56,6 @@ Environment Variables:
|
|
|
56
56
|
const configName = parsedArgs.config || 'static-portal';
|
|
57
57
|
const configMap = {
|
|
58
58
|
'static-portal': 'static-portal-wdio.conf.js',
|
|
59
|
-
'static-dsc-portal': 'static-dsc-portal-wdio.conf.js',
|
|
60
59
|
portal: 'portal-wdio.conf.js',
|
|
61
60
|
search: 'search-wdio.conf.js',
|
|
62
61
|
};
|
package/common-wdio.conf.js
CHANGED
|
@@ -80,7 +80,6 @@ const defaultCapabilities = [
|
|
|
80
80
|
},
|
|
81
81
|
];
|
|
82
82
|
const defaultMochaTimeoutInterval = 200000; //increased timeout because its taking more time to load for references file
|
|
83
|
-
const isGithubActions = Boolean(process.env.GITHUB_ACTIONS);
|
|
84
83
|
|
|
85
84
|
// Resolve ChromeDriver version: env var → Chrome for Testing API lookup → latest
|
|
86
85
|
const resolvedChromeDriverVersion = resolveChromedriverVersion();
|
|
@@ -182,25 +181,15 @@ exports.config = {
|
|
|
182
181
|
// Services take over a specific job you don't want to take care of. They enhance
|
|
183
182
|
// your test setup with almost no effort. Unlike plugins, they don't add new
|
|
184
183
|
// commands. Instead, they hook themselves up into the test process.
|
|
185
|
-
services:
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
],
|
|
195
|
-
],
|
|
196
|
-
...(isGithubActions
|
|
197
|
-
? {
|
|
198
|
-
protocol: 'http',
|
|
199
|
-
hostname: '127.0.0.1',
|
|
200
|
-
port: 4444,
|
|
201
|
-
path: '/wd/hub',
|
|
202
|
-
}
|
|
203
|
-
: {}),
|
|
184
|
+
services: [
|
|
185
|
+
[
|
|
186
|
+
'selenium-standalone',
|
|
187
|
+
{
|
|
188
|
+
installArgs: { drivers }, // drivers to install
|
|
189
|
+
args: { drivers }, // drivers to use
|
|
190
|
+
},
|
|
191
|
+
],
|
|
192
|
+
],
|
|
204
193
|
|
|
205
194
|
// Framework you want to run your specs with.
|
|
206
195
|
// The following are supported: Mocha, Jasmine, and Cucumber
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforcedevs/sfdocs-e2e",
|
|
3
|
-
"version": "1.0.3
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "E2E test suite for SFDocs static portal pages (SSG)",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"bin": {
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
"test:e2e": "TS_NODE_TRANSPILE_ONLY=true TS_NODE_PROJECT=./tsconfig.json wdio wdio.conf.js",
|
|
17
17
|
"test:e2e:portal": "TS_NODE_TRANSPILE_ONLY=true TS_NODE_PROJECT=./tsconfig.json wdio portal-wdio.conf.js",
|
|
18
18
|
"test:e2e:static:portal": "TS_NODE_TRANSPILE_ONLY=true TS_NODE_PROJECT=./tsconfig.json wdio static-portal-wdio.conf.js",
|
|
19
|
-
"test:e2e:static:dsc:portal": "TS_NODE_TRANSPILE_ONLY=true TS_NODE_PROJECT=./tsconfig.json wdio static-dsc-portal-wdio.conf.js",
|
|
20
19
|
"test:scope-search": "TS_NODE_TRANSPILE_ONLY=true TS_NODE_PROJECT=./tsconfig.json wdio search-wdio.conf.js",
|
|
21
20
|
"release:alpha:e2e": "f() { bash bin/publish.sh $1 --tag alpha; }; f",
|
|
22
21
|
"release:e2e": "f() { bash bin/publish.sh $1; }; f"
|
|
@@ -13,7 +13,7 @@ describe('Homepage', () => {
|
|
|
13
13
|
it('should show the expected number of projects', async () => {
|
|
14
14
|
const projectCards = await HomePage.projectCards;
|
|
15
15
|
|
|
16
|
-
expect(projectCards.length).toEqual(
|
|
16
|
+
expect(projectCards.length).toEqual(18);
|
|
17
17
|
});
|
|
18
18
|
|
|
19
19
|
// it('is accessible', () => {
|
|
@@ -2,58 +2,41 @@ import Page from '../pageobjects/page';
|
|
|
2
2
|
|
|
3
3
|
let page: Page;
|
|
4
4
|
|
|
5
|
-
/** Prefix logs so they are easy to find in GitHub Actions (and local) output. */
|
|
6
|
-
function logDevCenter(step: string, detail?: string): void {
|
|
7
|
-
const suffix = detail !== undefined ? ` ${detail}` : '';
|
|
8
|
-
console.log(`[devCenterLink] ${step}${suffix}`);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
5
|
describe('DevCenter Link Tests', () => {
|
|
12
6
|
it('Check if the devCenter link is displayed for Overview Page', async () => {
|
|
13
|
-
logDevCenter('start', 'Overview Page');
|
|
14
7
|
page = new Page('/docs/commerce/test-cc-orders-api/overview');
|
|
15
8
|
page.open();
|
|
16
|
-
logDevCenter('navigated', await browser.getUrl());
|
|
17
|
-
|
|
18
9
|
(await $('>>> div.content-type.content-type-overview')).waitForDisplayed({ timeout: 5000 });
|
|
19
|
-
logDevCenter('overview content visible');
|
|
20
10
|
|
|
21
11
|
const devCenterItem = await $('>>> div.dev-center-link');
|
|
22
12
|
expect(devCenterItem.isExisting()).toBeTruthy();
|
|
23
13
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
logDevCenter('done', 'Overview Page');
|
|
14
|
+
expect(await (await devCenterItem.$('span.subtitle.dx-text-body-4')).getText()).toEqual(
|
|
15
|
+
'Commerce Cloud',
|
|
16
|
+
);
|
|
28
17
|
});
|
|
29
18
|
|
|
30
19
|
it('Check if the devCenter link is displayed for Guides Page', async () => {
|
|
31
|
-
logDevCenter('start', 'Guides Page');
|
|
32
20
|
page = new Page('/docs/service/vscode-maintainer/guide/vscode-quickstart.html');
|
|
33
21
|
page.open();
|
|
34
|
-
logDevCenter('navigated', await browser.getUrl());
|
|
35
22
|
|
|
36
23
|
const devCenterItem = await $('>>> div.dev-center-link');
|
|
37
24
|
expect(devCenterItem.isExisting()).toBeTruthy();
|
|
38
25
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
logDevCenter('done', 'Guides Page');
|
|
26
|
+
expect(await (await devCenterItem.$('span.subtitle.dx-text-body-4')).getText()).toEqual(
|
|
27
|
+
'Service Cloud',
|
|
28
|
+
);
|
|
43
29
|
});
|
|
44
30
|
|
|
45
31
|
it('Check if the devCenter link is displayed for References Page', async () => {
|
|
46
|
-
logDevCenter('start', 'References Page');
|
|
47
32
|
page = new Page('docs/commerce/test-cc-orders-api/references/Z11hRXt1?meta=Summary');
|
|
48
33
|
page.open();
|
|
49
|
-
logDevCenter('navigated', await browser.getUrl());
|
|
50
34
|
|
|
51
35
|
const devCenterItem = await $('>>> div.dev-center-link');
|
|
52
36
|
expect(devCenterItem.isExisting()).toBeTruthy();
|
|
53
37
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
logDevCenter('done', 'References Page');
|
|
38
|
+
expect(await (await devCenterItem.$('span.subtitle.dx-text-body-4')).getText()).toEqual(
|
|
39
|
+
'Commerce Cloud',
|
|
40
|
+
);
|
|
58
41
|
});
|
|
59
42
|
});
|
|
@@ -9,7 +9,6 @@ describe('API Pages', () => {
|
|
|
9
9
|
beforeEach(async () => {
|
|
10
10
|
referencePage = new ReferencePage('/docs/commerce/test-cc-orders-api/references');
|
|
11
11
|
referencePage.open();
|
|
12
|
-
await referencePage.waitForSpecBasedReferencePageLoad();
|
|
13
12
|
});
|
|
14
13
|
|
|
15
14
|
layoutTest(referencePage, 'doc-header');
|
|
@@ -86,7 +85,6 @@ describe('Reference Versioning', () => {
|
|
|
86
85
|
beforeEach(async () => {
|
|
87
86
|
referencePage = new ReferencePage('/docs/c-cart-apis/references/ref1?meta=Summary');
|
|
88
87
|
referencePage.open();
|
|
89
|
-
await referencePage.waitForSpecBasedReferencePageLoad();
|
|
90
88
|
});
|
|
91
89
|
|
|
92
90
|
it('should check for the presence of version picker dropdown', async () => {
|
|
@@ -135,7 +133,7 @@ describe('Reference Versioning', () => {
|
|
|
135
133
|
|
|
136
134
|
await versionOptions[1].waitForClickable();
|
|
137
135
|
await versionOptions[1].click();
|
|
138
|
-
await
|
|
136
|
+
await browser.pause(1000);
|
|
139
137
|
|
|
140
138
|
const apiTitle = await (await $('>>>div.api-title span')).getText();
|
|
141
139
|
const apiVersion = await (await $('>>>p.version span')).getText();
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WebdriverIO configuration for E2E tests on Static Portal Pages (SSG) on DSC
|
|
3
|
-
*
|
|
4
|
-
* Prerequisites:
|
|
5
|
-
* 1. Build static pages: yarn build:static:portal
|
|
6
|
-
* 2. Start static server: yarn start:static:portal (runs on port 3000)
|
|
7
|
-
* 3. Run tests: yarn test:e2e:static:portal
|
|
8
|
-
*/
|
|
9
|
-
const BASE_CONFIG = require('./common-wdio.conf');
|
|
10
|
-
|
|
11
|
-
exports.config = {
|
|
12
|
-
...BASE_CONFIG.config,
|
|
13
|
-
// Static pages are served on port 3000 by default; override via E2E_BASE_URL env var
|
|
14
|
-
baseUrl: process.env.E2E_BASE_URL || 'http://localhost:3000',
|
|
15
|
-
|
|
16
|
-
// Reuse the same portal specs - static pages have the same URL structure
|
|
17
|
-
specs: ['./src/shared/specs/devCenterLink.test.ts'],
|
|
18
|
-
|
|
19
|
-
// Exclude tests that require dynamic server features or pages not in static build
|
|
20
|
-
exclude: [
|
|
21
|
-
// './src/portal/specs/docs.api.test.ts',
|
|
22
|
-
// './src/portal/specs/docs.test.ts',
|
|
23
|
-
'./src/shared/specs/banner.test.ts',
|
|
24
|
-
],
|
|
25
|
-
|
|
26
|
-
// Output directory for static test results
|
|
27
|
-
outputDir: './_results_/static-portal',
|
|
28
|
-
|
|
29
|
-
// Override reporters to use separate output directories
|
|
30
|
-
reporters: [
|
|
31
|
-
'spec',
|
|
32
|
-
[
|
|
33
|
-
require('wdio-video-reporter'),
|
|
34
|
-
{
|
|
35
|
-
saveAllVideos: false,
|
|
36
|
-
videoSlowdownMultiplier: 3,
|
|
37
|
-
outputDir: './_results_/static-portal/videos',
|
|
38
|
-
},
|
|
39
|
-
],
|
|
40
|
-
[
|
|
41
|
-
'allure',
|
|
42
|
-
{
|
|
43
|
-
outputDir: './_results_/static-portal/allure-raw',
|
|
44
|
-
disableWebdriverStepsReporting: true,
|
|
45
|
-
disableWebdriverScreenshotsReporting: false,
|
|
46
|
-
},
|
|
47
|
-
],
|
|
48
|
-
],
|
|
49
|
-
};
|